Search in sources :

Example 1 with EventRegistry

use of org.opennms.osgi.EventRegistry in project opennms by OpenNMS.

the class Activator method autoExportDefaultServices.

private void autoExportDefaultServices(BundleContext bundleContext) {
    final long bundleId = bundleContext.getBundle().getBundleId();
    Log.info("Auto export of default Services for bundle (id: {}) enabled", bundleId);
    final OnmsServiceManager serviceManager = new OnmsServiceManagerImpl(bundleContext);
    Dictionary<String, Object> props = new Hashtable<String, Object>();
    props.put("bundleId", bundleContext.getBundle().getBundleId());
    Log.info("Registering OnmsServiceManager and SessionListener for bundle (id: {})", bundleId);
    bundleContext.registerService(new String[] { OnmsServiceManager.class.getName(), SessionListener.class.getName() }, serviceManager, props);
    Log.info("Registering EventRegistry for bundle (id: {})", bundleId);
    bundleContext.registerService(EventRegistry.class.getName(), new EventRegistry(bundleContext), props);
}
Also used : OnmsServiceManager(org.opennms.osgi.OnmsServiceManager) EventRegistry(org.opennms.osgi.EventRegistry) Hashtable(java.util.Hashtable) SessionListener(org.opennms.vaadin.extender.SessionListener)

Aggregations

Hashtable (java.util.Hashtable)1 EventRegistry (org.opennms.osgi.EventRegistry)1 OnmsServiceManager (org.opennms.osgi.OnmsServiceManager)1 SessionListener (org.opennms.vaadin.extender.SessionListener)1