use of org.opendaylight.controller.config.manager.impl.jmx.ServiceReference in project controller by opendaylight.
the class ServiceReferenceRegistryImpl method checkServiceReferenceExists.
@Override
public synchronized void checkServiceReferenceExists(final ObjectName objectName) throws InstanceNotFoundException {
String actualTransactionName = ObjectNameUtil.getTransactionName(objectName);
String expectedTransactionName = serviceReferenceRegistrator.getNullableTransactionName();
if (writable && actualTransactionName == null || writable && !actualTransactionName.equals(expectedTransactionName)) {
throw new IllegalArgumentException("Mismatched transaction name in " + objectName);
}
String serviceQName = ObjectNameUtil.getServiceQName(objectName);
String referenceName = ObjectNameUtil.getReferenceName(objectName);
ServiceReference serviceReference = new ServiceReference(serviceQName, referenceName);
if (!refNames.containsKey(serviceReference)) {
LOG.warn("Cannot find {} in {}", serviceReference, refNames);
throw new InstanceNotFoundException("Service reference not found:" + objectName);
}
}
use of org.opendaylight.controller.config.manager.impl.jmx.ServiceReference in project controller by opendaylight.
the class ServiceReferenceRegistryImpl method removeServiceReferences.
private boolean removeServiceReferences(final ObjectName moduleObjectName, final Set<String> names) throws InstanceNotFoundException {
ObjectNameUtil.checkType(moduleObjectName, ObjectNameUtil.TYPE_MODULE);
assertWritable();
Set<ServiceReference> serviceReferencesLinkingTo = findServiceReferencesLinkingTo(moduleObjectName, names);
for (ServiceReference sr : serviceReferencesLinkingTo) {
removeServiceReference(sr);
}
return !serviceReferencesLinkingTo.isEmpty();
}
Aggregations