<plugin>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>blueprint-maven-plugin</artifactId>
+ <configuration>
+ <scanPaths>
+ <scanPath>org.opendaylight.openflowplugin.applications.arbitratorreconciliation</scanPath>
+ </scanPaths>
+ </configuration>
</plugin>
</plugins>
</build>
<plugin>
<groupId>org.apache.aries.blueprint</groupId>
<artifactId>blueprint-maven-plugin</artifactId>
+ <configuration>
+ <scanPaths>
+ <scanPath>org.opendaylight.openflowplugin.applications.frm</scanPath>
+ </scanPaths>
+ </configuration>
</plugin>
</plugins>
</build>
<artifactId>org.apache.karaf.shell.console</artifactId>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <optional>true</optional>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>blueprint-maven-plugin-annotation</artifactId>
+ <optional>true</optional>
+ </dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.aries.blueprint</groupId>
+ <artifactId>blueprint-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
<scm>
<connection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</connection>
<developerConnection>scm:git:ssh://git.opendaylight.org:29418/openflowplugin.git</developerConnection>
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.inject.Inject;
+import javax.inject.Singleton;
+import org.apache.aries.blueprint.annotation.service.Reference;
+import org.apache.aries.blueprint.annotation.service.Service;
import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeException;
import org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@Singleton
+@Service(classes = ReconciliationManager.class)
public class ReconciliationManagerImpl implements ReconciliationManager, ReconciliationFrameworkEvent {
private static final Logger LOG = LoggerFactory.getLogger(ReconciliationManagerImpl.class);
private final Map<ResultState, Integer> resultStateMap = new ConcurrentHashMap<>();
private final AtomicReference<ResultState> decidedResultState = new AtomicReference<>(ResultState.DONOTHING);
- public ReconciliationManagerImpl(MastershipChangeServiceManager mastershipChangeServiceManager) {
+ @Inject
+ public ReconciliationManagerImpl(@Reference MastershipChangeServiceManager mastershipChangeServiceManager) {
this.mastershipChangeServiceManager = Preconditions
.checkNotNull(mastershipChangeServiceManager, "MastershipChangeServiceManager can not be null!");
}
+ @PostConstruct
public void start() throws MastershipChangeException {
mastershipChangeServiceManager.reconciliationFrameworkRegistration(this);
LOG.info("ReconciliationManager has started successfully.");
}
@Override
+ @PreDestroy
public void close() throws Exception {
}
xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
odl:use-default-for-reference-types="true">
- <reference id="reconciliationManagerRef"
- interface="org.opendaylight.openflowplugin.applications.reconciliation.ReconciliationManager"
- availability="optional"/>
<command-bundle xmlns="http://karaf.apache.org/xmlns/shell/v1.1.0">
<command>
<action class="org.opendaylight.openflowplugin.applications.reconciliation.cli.GetRegisteredServices">
<property name="reconciliationManager"
- ref="reconciliationManagerRef"/>
+ ref="reconciliationManagerImpl"/>
</action>
</command>
</command-bundle>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
- xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
- xmlns:odl="http://opendaylight.org/xmlns/blueprint/v1.0.0"
- odl:use-default-for-reference-types="true">
-
- <reference id="mastershipChangeServiceManager"
- interface="org.opendaylight.openflowplugin.api.openflow.mastership.MastershipChangeServiceManager"/>
- <bean id="reconciliationManagerImpl"
- class="org.opendaylight.openflowplugin.applications.reconciliation.impl.ReconciliationManagerImpl"
- init-method="start"
- destroy-method="close">
- <argument ref="mastershipChangeServiceManager"/>
- </bean>
- <service ref="reconciliationManagerImpl"
- interface="org.opendaylight.openflowplugin.applications.reconciliation.ReconciliationManager"
- odl:type="default"/>
-
-</blueprint>
\ No newline at end of file