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 synchronized void removedService(ServiceReference reference, Object service) {
SimpleWebConsolePlugin plugin = this.plugin;
if (plugin != null) {
ControlServlet controller = ((WebConsolePlugin) plugin).controller;
if (controller != null) {
controller.removedService(reference);
}
}
if (tracker.size() == 0 && plugin != null) {
plugin.unregister();
this.plugin = null;
// unregister configuration printer too
ServiceRegistration reg = printerRegistration;
if (reg != null) {
reg.unregister();
printerRegistration = 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 synchronized Object addingService(ServiceReference reference) {
SimpleWebConsolePlugin plugin = this.plugin;
if (plugin == null) {
this.plugin = plugin = new WebConsolePlugin(tracker).register(context);
// register configuration printer
final Dictionary /*<String, Object>*/
props = new Hashtable();
// $NON-NLS-1$
props.put(InventoryPrinter.NAME, "upnp");
// $NON-NLS-1$
props.put(InventoryPrinter.TITLE, "UPnP Devices");
props.put(InventoryPrinter.FORMAT, new String[] { Format.TEXT.toString(), Format.JSON.toString() });
printerRegistration = context.registerService(InventoryPrinter.SERVICE, new ConfigurationPrinterImpl(tracker), props);
}
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(final ServiceReference<ServiceComponentRuntime> reference, final ServiceComponentRuntime service) {
SimpleWebConsolePlugin plugin = this.plugin;
if (tracker.getTrackingCount() == 0 && plugin != null) {
// remove service
plugin.unregister();
this.plugin = null;
// unregister configuration printer too
ServiceRegistration<?> reg = printerRegistration;
if (reg != null) {
reg.unregister();
printerRegistration = null;
}
// unregister info provider too
reg = infoRegistration;
if (reg != null) {
reg.unregister();
infoRegistration = 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;
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 Object addingService(ServiceReference reference) {
SimpleWebConsolePlugin plugin = this.plugin;
Object ret = null;
if (plugin == null) {
ret = context.getService(reference);
this.plugin = plugin = new WebConsolePlugin(context, ret).register(context);
}
return ret;
}
Aggregations