SCR provides for a way to activate components on-demand, so they end up
being dormant when not used. Take advantage of this and also lower the
amount of logging we perform during activation/deactivation.
Change-Id: I3bbdc6bf1d6e20b7e9440f3e3c62b075aa826bbc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
/**
* A factory for creating in-memory data trees.
*/
/**
* A factory for creating in-memory data trees.
*/
-@Component(immediate = true)
+@Component
+@MetaInfServices
@RequireServiceComponentRuntime
public final class InMemoryDataTreeFactory implements DataTreeFactory {
private static final Logger LOG = LoggerFactory.getLogger(InMemoryDataTreeFactory.class);
@RequireServiceComponentRuntime
public final class InMemoryDataTreeFactory implements DataTreeFactory {
private static final Logger LOG = LoggerFactory.getLogger(InMemoryDataTreeFactory.class);
@Activate
@SuppressWarnings("static-method")
void activate() {
@Activate
@SuppressWarnings("static-method")
void activate() {
- LOG.info("In-memory Data Tree activated");
+ LOG.debug("In-memory Data Tree activated");
}
@Deactivate
@SuppressWarnings("static-method")
void deactivate() {
}
@Deactivate
@SuppressWarnings("static-method")
void deactivate() {
- LOG.info("In-memory Data Tree deactivated");
+ LOG.debug("In-memory Data Tree deactivated");
}
private static @NonNull DataTree createDataTree(final DataTreeConfiguration treeConfig,
}
private static @NonNull DataTree createDataTree(final DataTreeConfiguration treeConfig,
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
/**
* Reference {@link YangParserFactory} implementation.
*/
@Beta
/**
* Reference {@link YangParserFactory} implementation.
*/
@Beta
-@Component(immediate = true)
+@MetaInfServices
+@RequireServiceComponentRuntime
public final class DefaultYangParserFactory implements YangParserFactory {
private static final List<ImportResolutionMode> SUPPORTED_MODES = List.of(ImportResolutionMode.DEFAULT);
public final class DefaultYangParserFactory implements YangParserFactory {
private static final List<ImportResolutionMode> SUPPORTED_MODES = List.of(ImportResolutionMode.DEFAULT);
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Deactivate;
+import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-@Component(immediate = true)
+@RequireServiceComponentRuntime
public final class AntlrXPathParserFactory implements YangXPathParserFactory {
private static final Logger LOG = LoggerFactory.getLogger(AntlrXPathParserFactory.class);
public final class AntlrXPathParserFactory implements YangXPathParserFactory {
private static final Logger LOG = LoggerFactory.getLogger(AntlrXPathParserFactory.class);
@Activate
@SuppressWarnings("static-method")
void activate() {
@Activate
@SuppressWarnings("static-method")
void activate() {
- LOG.info("XPath Parser activated");
+ LOG.debug("XPath Parser activated");
}
@Deactivate
@SuppressWarnings("static-method")
void deactivate() {
}
@Deactivate
@SuppressWarnings("static-method")
void deactivate() {
- LOG.info("XPath Parser deactivated");
+ LOG.debug("XPath Parser deactivated");
* on the XPath grammar from <a href="https://github.com/antlr/grammars-v4/blob/master/xpath/xpath.g4">grammars-v4</a>.
*/
@NonNullByDefault
* on the XPath grammar from <a href="https://github.com/antlr/grammars-v4/blob/master/xpath/xpath.g4">grammars-v4</a>.
*/
@NonNullByDefault
-@RequireServiceComponentRuntime
package org.opendaylight.yangtools.yang.xpath.impl;
import org.eclipse.jdt.annotation.NonNullByDefault;
package org.opendaylight.yangtools.yang.xpath.impl;
import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.osgi.service.component.annotations.RequireServiceComponentRuntime;
\ No newline at end of file