Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated osgi annotatation in jobs #314

Conversation

plutasnyy
Copy link
Contributor

Migrate Felix annotations to OSGi in Jobs module

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

I hereby agree to the terms of the AET Contributor License Agreement.

@Component
@Service(ExternalSnippetHttpClient.class)
@Component(service = ExternalSnippetHttpClient.class)
@Designate(ocd = ExternalSnippetHttpClientConf.class)
public class ExternalSnippetHttpClient {

private static final Logger LOGGER = LoggerFactory.getLogger(ExternalSnippetHttpClient.class);

private static final long DEFAULT_CONNECTION_TTL = 60L;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those values were moved to ExternalSnippetHttpClientConf so you probably can remove it from here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

@@ -35,6 +35,18 @@

<dependencies>
<!-- project -->
<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may get rid of

    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.scr.annotations</artifactId>
    </dependency>

and

    <dependency>
      <groupId>org.apache.sling</groupId>
      <artifactId>org.apache.sling.commons.osgi</artifactId>
    </dependency>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@plutasnyy plutasnyy merged commit bfebd04 into feature/upgrade-osgi-annotations Aug 9, 2018
@plutasnyy plutasnyy deleted the feature/upgrade-osgi-annotations-jobs branch August 9, 2018 06:25
name = SOURCE_COLLECTOR_TIMEOUT_VALUE,
description = "Timeout value for source collector [ms]",
type = AttributeType.INTEGER)
int timeoutValue() default DEFAULT_TIMEOUT;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With new @AttributeDefinition annotation, the name property is just a human-readable name (i.e. label for the property) - the property name itself is identified by the method name (timeoutValue). So now the method names should be equal to the value of name property on the old @Property annotations - otherwise we'll need to change property names in all karaf configuration files for this component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants