use of org.apache.sling.installer.api.ResourceChangeListener in project sling by apache.
the class ServicesListener method notifyChange.
public synchronized void notifyChange() {
// check if all services are available
final ResourceChangeListener listener = (ResourceChangeListener) this.changeHandlerListener.getService();
final ConfigurationAdmin configAdmin = (ConfigurationAdmin) this.configAdminListener.getService();
if (configAdmin != null && listener != null) {
if (configTaskCreator == null) {
final Hashtable<String, String> props = new Hashtable<String, String>();
props.put(Constants.SERVICE_DESCRIPTION, "Apache Sling Configuration Install Task Factory");
props.put(Constants.SERVICE_VENDOR, VENDOR);
props.put(InstallTaskFactory.NAME, "org.osgi.service.cm");
props.put(ResourceTransformer.NAME, "org.osgi.service.cm");
this.configTaskCreator = new ConfigTaskCreator(listener, configAdmin);
// start and register osgi installer service
final String[] serviceInterfaces = { InstallTaskFactory.class.getName(), ConfigurationListener.class.getName(), ResourceTransformer.class.getName() };
configTaskCreatorRegistration = this.bundleContext.registerService(serviceInterfaces, configTaskCreator, props);
}
} else {
this.stop();
}
}
Aggregations