public void start() { final Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put("osgi.command.scope", "odpcontroller"); props.put("osgi.command.function", new String[] { "showNodes", "showNodeConnectors" }); this.sr = ServiceHelper.registerGlobalServiceWReg(SwitchManagerCLI.class, this, props); }
public void start() { final Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put("osgi.command.scope", "odpcontroller"); props.put("osgi.command.function", new String[] { "getContainerAdvancedCacheInfo" }); this.sr = ServiceHelper.registerGlobalServiceWReg(ClusterManagerCLI.class, this, props); }
public void start() { final Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put("osgi.command.scope", "odpcontroller"); props.put("osgi.command.function", new String[] { "showRequestedGroupFlows", "showInstalledGroupFlows", "showRequestedNodeFlows", "showInstalledNodeFlows" }); this.sr = ServiceHelper.registerGlobalServiceWReg(ForwardingRulesManagerCLI.class, this, props); }
public void start() { final Dictionary<String, Object> props = new Hashtable<String, Object>(); props.put("osgi.command.scope", "odpcontroller"); props.put("osgi.command.function", new String[] { "getRoute" }); this.sr = ServiceHelper.registerGlobalServiceWReg(DijkstraImplementationCLI.class, this, props); }
/** * Register a Global Service in the OSGi service registry * * @param clazz The target class * @param instance of the object exporting the service, be careful * the object must implement/extend clazz else the registration * will fail unless a ServiceFactory is passed as parameter * @param properties The properties to be attached to the service * registration * @return true if registration happened, false otherwise */ public static boolean registerGlobalService(Class<?> clazz, Object instance, Dictionary<String, Object> properties) { ServiceRegistration<?> registration = registerGlobalServiceWReg(clazz, instance, properties); if (registration == null) { logger.error("Failed to register {} for instance {}", clazz, instance); return false; } return true; }
/** * Register a Service in the OSGi service registry and return the ServiceRegistration * * @param clazz The target class * @param containerName The container name * @param instance of the object exporting the service, be careful * the object must implement/extend clazz else the registration * will fail unless a ServiceFactory is passed as parameter * @param properties The properties to be attached to the service * registration * @return the ServiceRegistration if registration happened, null otherwise */ public static ServiceRegistration<?> registerServiceWReg(Class<?> clazz, String containerName, Object instance, Dictionary<String, Object> properties) { if (properties == null) { properties = (Dictionary<String, Object>) new Hashtable<String, Object>(); } properties.put("containerName", containerName); return registerGlobalServiceWReg(clazz, instance, properties); }
protected <E> void register(Class<E> clazz) { ServiceRegistration reg = ServiceHelper.registerGlobalServiceWReg(clazz, this, null); if (reg != null) this.m_reg.add(reg); assert ServiceHelper.getGlobalInstance(clazz, this) != this; }