public synchronized ServletHost getServletHost() { if (host == null) { try { host = ServiceHelper.newInstance(registry, sd); ServiceHelper.start(host); } catch (Throwable e) { throw new IllegalStateException(e); } } return host; }
public void stop() { ServiceHelper.stop(host); }
/** * Create a service instance from the service declaration * @param <T> * @param registry The extension point registry * @param sd The service declaration * @return The newly created service instance * @throws Exception */ public static <T> T newInstance(ExtensionPointRegistry registry, ServiceDeclaration sd) throws Exception { Class<T> cls = (Class<T>)sd.loadClass(); T instance = null; try { // Try constructor(ExtensionPointRegistry.class) instance = newInstance(cls, ExtensionPointRegistry.class, registry); } catch (NoSuchMethodException e) { try { // Try Try constructor(ExtensionPointRegistry.class, Map.class) instance = newInstance(cls, ARG_TYPES, registry, sd.getAttributes()); } catch (NoSuchMethodException e1) { // Try constructor() instance = newInstance(cls); } } return instance; }
instance = newInstance(registry, sd); start(instance); stop(instance); return null; } else if (method.equals(START_METHOD)) {
public void addDomainRegistryFactory(DomainRegistryFactory factory) { ServiceHelper.start(factory); factories.add(factory); }
/** * Create a service instance from the service declaration * @param <T> * @param registry The extension point registry * @param sd The service declaration * @return The newly created service instance * @throws Exception */ public static <T> T newInstance(ExtensionPointRegistry registry, ServiceDeclaration sd) throws Exception { Class<T> cls = (Class<T>)sd.loadClass(); T instance = null; try { // Try constructor(ExtensionPointRegistry.class) instance = newInstance(cls, ExtensionPointRegistry.class, registry); } catch (NoSuchMethodException e) { try { // Try Try constructor(ExtensionPointRegistry.class, Map.class) instance = newInstance(cls, ARG_TYPES, registry, sd.getAttributes()); } catch (NoSuchMethodException e1) { // Try constructor() instance = newInstance(cls); } } return instance; }
instance = newInstance(registry, sd); start(instance); stop(instance); return null; } else if (method.equals(START_METHOD)) {
public void addDomainRegistryFactory(DomainRegistryFactory factory) { ServiceHelper.start(factory); factories.add(factory); }
utility = newInstance(registry, utilityDeclaration); } else { try { utility = newInstance(utilityClass, ExtensionPointRegistry.class, registry); } catch (NoSuchMethodException e) { utility = newInstance(utilityClass);
private synchronized void loadHosts() { if (loaded) { return; } try { ServiceDeclaration sd = registry.getServiceDiscovery().getServiceDeclaration(CorbaHost.class); CorbaHost host = ServiceHelper.newInstance(registry, sd); ServiceHelper.start(host); corbaHosts.add(host); } catch (Throwable e) { throw new ServiceRuntimeException(e); } }
public void stop() { ServiceHelper.stop(factories); }
public synchronized void addExtensionPoint(Object extensionPoint, ServiceDeclaration declaration) { if (extensionPoint == null) { throw new IllegalArgumentException("Cannot register null as an ExtensionPoint"); } ServiceHelper.start(extensionPoint); Set<Class<?>> interfaces = getAllInterfaces(extensionPoint.getClass()); for (Class<?> i : interfaces) { registerExtensionPoint(i, extensionPoint, declaration); } }
utility = newInstance(registry, utilityDeclaration); } else { try { utility = newInstance(utilityClass, ExtensionPointRegistry.class, registry); } catch (NoSuchMethodException e) { utility = newInstance(utilityClass);
private synchronized void loadHosts() { if (loaded) { return; } try { ServiceDeclaration sd = registry.getServiceDiscovery().getServiceDeclaration(CorbaHost.class); CorbaHost host = ServiceHelper.newInstance(registry, sd); ServiceHelper.start(host); corbaHosts.add(host); } catch (Throwable e) { throw new ServiceRuntimeException(e); } }
public void stop() { ServiceHelper.stop(factories); }
public synchronized void addExtensionPoint(Object extensionPoint, ServiceDeclaration declaration) { if (extensionPoint == null) { throw new IllegalArgumentException("Cannot register null as an ExtensionPoint"); } ServiceHelper.start(extensionPoint); Set<Class<?>> interfaces = getAllInterfaces(extensionPoint.getClass()); for (Class<?> i : interfaces) { registerExtensionPoint(i, extensionPoint, declaration); } }
Class<ModuleActivator> activatorClass = (Class<ModuleActivator>)activatorDeclaration.loadClass(); try { activator = newInstance(activatorClass, ExtensionPointRegistry.class, registry); } catch (NoSuchMethodException e) { try { activator = newInstance(activatorClass, new Class<?>[] {ExtensionPointRegistry.class, Map.class}, registry, activator = newInstance(activatorClass);
public void removeDomainRegistryFactory(DomainRegistryFactory factory) { if (factories.remove(factory)) { ServiceHelper.stop(factory); } }
Class<NodeActivator> activatorClass = (Class<NodeActivator>)activatorDeclaration.loadClass(); try { activator = ServiceHelper.newInstance(activatorClass, ExtensionPointRegistry.class, registry); } catch (NoSuchMethodException e) { try { activator = ServiceHelper.newInstance(activatorClass, new Class<?>[] {ExtensionPointRegistry.class, Map.class}, registry, activator = ServiceHelper.newInstance(activatorClass);
public void removeDomainRegistryFactory(DomainRegistryFactory factory) { if (factories.remove(factory)) { ServiceHelper.stop(factory); } }