use of org.apache.felix.webconsole.SimpleWebConsolePlugin in project felix by apache.
the class Activator method removedService.
/**
* @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(org.osgi.framework.ServiceReference,
* java.lang.Object)
*/
public final void removedService(ServiceReference reference, Object service) {
SimpleWebConsolePlugin plugin = this.plugin;
if (tracker.getTrackingCount() == 0 && plugin != null) {
plugin.unregister();
this.plugin = null;
}
}
use of org.apache.felix.webconsole.SimpleWebConsolePlugin in project felix by apache.
the class Activator method removedService.
/**
* @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(org.osgi.framework.ServiceReference,
* java.lang.Object)
*/
public final void removedService(ServiceReference reference, Object service) {
SimpleWebConsolePlugin plugin = this.plugin;
this.plugin = null;
if (plugin != null) {
// remove service
plugin.unregister();
}
}
use of org.apache.felix.webconsole.SimpleWebConsolePlugin in project felix by apache.
the class Activator method addingService.
/**
* @see org.osgi.util.tracker.ServiceTrackerCustomizer#addingService(org.osgi.framework.ServiceReference)
*/
public final Object addingService(ServiceReference reference) {
SimpleWebConsolePlugin plugin = this.plugin;
if (plugin == null) {
final UserAdmin service = (UserAdmin) context.getService(reference);
this.plugin = new WebConsolePlugin(service).register(context);
// printerRegistration = context.registerService(ConfigurationPrinter.SERVICE,
// new ComponentConfigurationPrinter(service), null);
}
return context.getService(reference);
}
use of org.apache.felix.webconsole.SimpleWebConsolePlugin in project felix by apache.
the class Activator method removedService.
/**
* @see org.osgi.util.tracker.ServiceTrackerCustomizer#removedService(org.osgi.framework.ServiceReference,
* java.lang.Object)
*/
public final void removedService(ServiceReference reference, Object service) {
SimpleWebConsolePlugin plugin = this.plugin;
if (tracker.getTrackingCount() == 0 && plugin != null) {
plugin.unregister();
this.plugin = null;
}
}
use of org.apache.felix.webconsole.SimpleWebConsolePlugin in project felix by apache.
the class Activator method addingService.
/**
* @see org.osgi.util.tracker.ServiceTrackerCustomizer#addingService(org.osgi.framework.ServiceReference)
*/
public final ServiceComponentRuntime addingService(final ServiceReference<ServiceComponentRuntime> reference) {
SimpleWebConsolePlugin plugin = this.plugin;
if (plugin == null) {
final ServiceComponentRuntime service = context.getService(reference);
this.plugin = plugin = new WebConsolePlugin(service).register(context);
final Dictionary<String, Object> props = new Hashtable<String, Object>();
final String name = "Declarative Services Components";
// $NON-NLS-1$
props.put(InventoryPrinter.NAME, "scr");
props.put(InventoryPrinter.TITLE, name);
props.put(InventoryPrinter.FORMAT, new String[] { Format.TEXT.toString(), Format.JSON.toString() });
printerRegistration = context.registerService(InventoryPrinter.class, new ComponentConfigurationPrinter(service, (WebConsolePlugin) plugin), props);
infoRegistration = new InfoProvider(context.getBundle(), service).register(context);
}
return context.getService(reference);
}
Aggregations