<artifactId>javax.annotation-api</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>
-
</project>
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.inject.Singleton;
-import org.apache.aries.blueprint.annotation.service.Reference;
-import org.apache.aries.blueprint.annotation.service.Service;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipChange;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipListener;
import org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService;
import org.slf4j.LoggerFactory;
@Singleton
-@Service(classes = DeviceOwnershipService.class)
public class DeviceOwnershipServiceImpl implements DeviceOwnershipService, EntityOwnershipListener {
private static final Logger LOG = LoggerFactory.getLogger(DeviceOwnershipServiceImpl.class);
private static final String SERVICE_ENTITY_TYPE = "org.opendaylight.mdsal.ServiceEntityType";
private final EntityOwnershipService eos;
private final ConcurrentMap<String, EntityOwnershipState> ownershipStateCache = new ConcurrentHashMap<>();
- public DeviceOwnershipServiceImpl(@Reference final EntityOwnershipService entityOwnershipService) {
+ public DeviceOwnershipServiceImpl(final EntityOwnershipService entityOwnershipService) {
this.eos = entityOwnershipService;
}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
+ <bean id="deviceOwnershipServiceImpl" class="org.opendaylight.openflowplugin.applications.deviceownershipservice.impl.DeviceOwnershipServiceImpl" init-method="start" destroy-method="close">
+ <argument ref="entityOwnershipService"/>
+ </bean>
+ <reference id="entityOwnershipService" interface="org.opendaylight.mdsal.eos.binding.api.EntityOwnershipService"/>
+ <service ref="deviceOwnershipServiceImpl" interface="org.opendaylight.openflowplugin.applications.deviceownershipservice.DeviceOwnershipService"/>
+</blueprint>