use of org.apache.aries.util.filesystem.IDirectoryFinder in project aries by apache.
the class Activator method removedService.
@Override
public synchronized void removedService(ServiceReference<Object> reference, Object service) {
if (service instanceof Coordinator) {
if (service.equals(coordinator)) {
Coordinator coordinator = findAlternateServiceFor(Coordinator.class);
if (coordinator == null)
deactivate();
this.coordinator = coordinator;
}
} else if (service instanceof RegionDigraph) {
if (service.equals(regionDigraph)) {
RegionDigraph regionDigraph = findAlternateServiceFor(RegionDigraph.class);
if (regionDigraph == null)
deactivate();
this.regionDigraph = regionDigraph;
}
} else if (service instanceof Resolver) {
if (service.equals(resolver)) {
Resolver resolver = findAlternateServiceFor(Resolver.class);
if (resolver == null)
deactivate();
this.resolver = resolver;
}
} else if (service instanceof IDirectoryFinder)
finders.remove(service);
else {
if (service.equals(modelledResourceManager)) {
try {
Class clazz = getClass().getClassLoader().loadClass(MODELLED_RESOURCE_MANAGER);
Object manager = findAlternateServiceFor(clazz);
if (manager == null) {
modelledResourceManager = null;
serviceModeller = null;
} else {
modelledResourceManager = service;
serviceModeller = new ApplicationServiceModeller(service);
}
} catch (ClassNotFoundException e) {
// ignore
} catch (NoClassDefFoundError e) {
// ignore
}
}
}
}
Aggregations