<groupId>${project.groupId}</groupId>
<artifactId>threadpool-config-impl</artifactId>
</dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>blueprint</artifactId>
+ <version>0.10.0-SNAPSHOT</version>
+ </dependency>
</dependencies>
</project>
<groupId>${project.groupId}</groupId>
<artifactId>sal-inmemory-datastore</artifactId>
</dependency>
- <dependency>
- <!-- TODO start-level="40" -->
- <groupId>${project.groupId}</groupId>
- <artifactId>blueprint</artifactId>
- <version>0.10.0-SNAPSHOT</version>
- </dependency>
</dependencies>
</project>
public class BlueprintBundleTracker implements BundleActivator, BundleTrackerCustomizer<Bundle>, BlueprintListener,
SynchronousBundleListener {
private static final Logger LOG = LoggerFactory.getLogger(BlueprintBundleTracker.class);
- private static final String BLUEPRINT_FILE_PATH = "org/opendaylight/blueprint/";
+ private static final String ODL_CUSTOM_BLUEPRINT_FILE_PATH = "org/opendaylight/blueprint/";
+ private static final String STANDARD_BLUEPRINT_FILE_PATH = "OSGI-INF/blueprint/";
private static final String BLUEPRINT_FLE_PATTERN = "*.xml";
private static final long SYSTEM_BUNDLE_ID = 0;
}
if (bundle.getState() == Bundle.ACTIVE) {
- List<Object> paths = findBlueprintPaths(bundle);
+ List<Object> paths = findBlueprintPaths(bundle, ODL_CUSTOM_BLUEPRINT_FILE_PATH);
if (!paths.isEmpty()) {
LOG.info("Creating blueprint container for bundle {} with paths {}", bundle, paths);
}
}
- @SuppressWarnings({ "rawtypes", "unchecked" })
static List<Object> findBlueprintPaths(final Bundle bundle) {
- Enumeration<?> rntries = bundle.findEntries(BLUEPRINT_FILE_PATH, BLUEPRINT_FLE_PATTERN, false);
+ List<Object> paths = findBlueprintPaths(bundle, STANDARD_BLUEPRINT_FILE_PATH);
+ return !paths.isEmpty() ? paths : findBlueprintPaths(bundle, ODL_CUSTOM_BLUEPRINT_FILE_PATH);
+ }
+
+ @SuppressWarnings({ "rawtypes", "unchecked" })
+ private static List<Object> findBlueprintPaths(final Bundle bundle, final String path) {
+ Enumeration<?> rntries = bundle.findEntries(path, BLUEPRINT_FLE_PATTERN, false);
if (rntries == null) {
return Collections.emptyList();
} else {
public interface AutoCloseableEventExecutor extends EventExecutor, AutoCloseable {
+ static AutoCloseableEventExecutor globalEventExecutor() {
+ return CloseableEventExecutorMixin.createCloseableProxy(GlobalEventExecutor.INSTANCE);
+ }
+
+ static AutoCloseableEventExecutor immediateEventExecutor() {
+ return CloseableEventExecutorMixin.createCloseableProxy(ImmediateEventExecutor.INSTANCE);
+ }
class CloseableEventExecutorMixin implements AutoCloseable {
public static final int DEFAULT_SHUTDOWN_SECONDS = 1;
}
- private static AutoCloseableEventExecutor createCloseableProxy(
- final CloseableEventExecutorMixin closeableEventExecutorMixin) {
+ private static AutoCloseableEventExecutor createCloseableProxy(final EventExecutor eventExecutor) {
+ final CloseableEventExecutorMixin closeableEventExecutor = new CloseableEventExecutorMixin(eventExecutor);
return Reflection.newProxy(AutoCloseableEventExecutor.class, new AbstractInvocationHandler() {
@Override
- protected Object handleInvocation(final Object proxy, final Method method, final Object[] args) throws Throwable {
+ protected Object handleInvocation(final Object proxy, final Method method, final Object[] args)
+ throws Throwable {
if (method.getName().equals("close")) {
- closeableEventExecutorMixin.close();
+ closeableEventExecutor.close();
return null;
} else {
- return method.invoke(closeableEventExecutorMixin.eventExecutor, args);
+ return method.invoke(closeableEventExecutor.eventExecutor, args);
}
}
});
}
-
- public static AutoCloseableEventExecutor globalEventExecutor() {
- return createCloseableProxy(new CloseableEventExecutorMixin(GlobalEventExecutor.INSTANCE));
- }
-
- public static AutoCloseableEventExecutor immediateEventExecutor() {
- return createCloseableProxy(new CloseableEventExecutorMixin(ImmediateEventExecutor.INSTANCE));
- }
-
- public static AutoCloseableEventExecutor forwardingEventExecutor(final EventExecutor eventExecutor,
- final AutoCloseable closeable) {
- return createCloseableProxy(new CloseableEventExecutorMixin(eventExecutor) {
- @Override
- public void close() throws Exception {
- // Intentional no-op.
- closeable.close();
- }
- });
- }
}
-}
\ No newline at end of file
+}
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0">
- <bean id="executor" class="org.opendaylight.controller.config.yang.netty.eventexecutor.AutoCloseableEventExecutor.CloseableEventExecutorMixin"
- factory-method="globalEventExecutor"/>
+ <bean id="executor" class="org.opendaylight.controller.config.yang.netty.eventexecutor.AutoCloseableEventExecutor"
+ factory-method="globalEventExecutor" destroy-method="close"/>
<service ref="executor" interface="io.netty.util.concurrent.EventExecutor"
odl:type="global-event-executor"/>
<artifactId>netty-config-api</artifactId>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Import-Package>*,io.netty.channel</Import-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
</project>
org.opendaylight.controller.cluster.sharding;
org.opendaylight.controller.cluster.databroker.actors.dds;
</Export-Package>
- <Import-Package>
- *;
- org.opendaylight.controller.md.sal.dom.broker.impl.jmx
- </Import-Package>
</instructions>
</configuration>
</plugin>