private static ClassLoader getClassLoader(ServiceDiscovery discovery, Class<?> serviceType) { try { ServiceDeclaration sd = discovery.getServiceDeclaration(serviceType); if (sd != null) { return sd.loadClass().getClassLoader(); } } catch (Exception e) { // Ignore } return null; }
private static ClassLoader getClassLoader(ServiceDiscovery discovery, Class<?> serviceType) { try { ServiceDeclaration sd = discovery.getServiceDeclaration(serviceType); if (sd != null) { return sd.loadClass().getClassLoader(); } } catch (Exception e) { // Ignore } return null; }
ServiceDeclaration factoryDeclaration = registry.getServiceDiscovery().getServiceDeclaration(factoryInterface.getName()); if (factoryDeclaration != null) { Class<?> factoryClass = factoryDeclaration.loadClass();
ServiceDeclaration factoryDeclaration = registry.getServiceDiscovery().getServiceDeclaration(factoryInterface.getName()); if (factoryDeclaration != null) { Class<?> factoryClass = factoryDeclaration.loadClass();
Class<?> factoryClass = registry.getServiceDiscovery().getServiceDeclaration(bindingType).getClass(); if (factoryClass != null) { factory = (JavascriptProxyFactory) ServiceDiscovery.getInstance().getServiceDeclaration(bindingType); } catch (Exception e) { throw new IllegalArgumentException(e);
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); } }
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); } }
/** * Get the extension point by the interface that it implements * * @param extensionPointType The lookup key (extension point interface) * @return The instance of the extension point * * @throws IllegalArgumentException if extensionPointType is null */ public synchronized <T> T getExtensionPoint(Class<T> extensionPointType) { if (extensionPointType == null) { throw new IllegalArgumentException("Cannot lookup ExtensionPoint of type null"); } Object extensionPoint = findExtensionPoint(extensionPointType); if (extensionPoint == null) { // Dynamically load an extension point class declared under META-INF/services try { ServiceDeclaration extensionPointDeclaration = getServiceDiscovery().getServiceDeclaration(extensionPointType); if (extensionPointDeclaration != null) { extensionPoint = newInstance(this, extensionPointDeclaration); // Cache the loaded extension point addExtensionPoint(extensionPoint, extensionPointDeclaration); } } catch (Throwable e) { throw new IllegalArgumentException(e); } } return extensionPointType.cast(extensionPoint); }
registry.getServiceDiscovery().getServiceDeclaration(factoryInterface); if (factoryDeclaration != null) { try {
/** * Get the extension point by the interface that it implements * * @param extensionPointType The lookup key (extension point interface) * @return The instance of the extension point * * @throws IllegalArgumentException if extensionPointType is null */ public synchronized <T> T getExtensionPoint(Class<T> extensionPointType) { if (extensionPointType == null) { throw new IllegalArgumentException("Cannot lookup ExtensionPoint of type null"); } Object extensionPoint = findExtensionPoint(extensionPointType); if (extensionPoint == null) { // Dynamically load an extension point class declared under META-INF/services try { ServiceDeclaration extensionPointDeclaration = getServiceDiscovery().getServiceDeclaration(extensionPointType); if (extensionPointDeclaration != null) { extensionPoint = newInstance(this, extensionPointDeclaration); // Cache the loaded extension point addExtensionPoint(extensionPoint, extensionPointDeclaration); } } catch (Throwable e) { throw new IllegalArgumentException(e); } } return extensionPointType.cast(extensionPoint); }
private static ClassLoader getClassLoader(ServiceDiscovery discovery, String serviceProvider) { try { ServiceDeclaration sd = discovery.getServiceDeclaration(serviceProvider); if (sd != null) { try { if (sd.loadClass() != null) { return sd.loadClass().getClassLoader(); } else { return new ClassLoaderImpl(sd); } } catch (ClassNotFoundException e) { return new ClassLoaderImpl(sd); } } } catch (Exception e) { // Ignore } return null; }
registry.getServiceDiscovery().getServiceDeclaration(factoryInterface); if (factoryDeclaration != null) { try {
private static ClassLoader getClassLoader(ServiceDiscovery discovery, String serviceProvider) { try { ServiceDeclaration sd = discovery.getServiceDeclaration(serviceProvider); if (sd != null) { try { if (sd.loadClass() != null) { return sd.loadClass().getClassLoader(); } else { return new ClassLoaderImpl(sd); } } catch (ClassNotFoundException e) { return new ClassLoaderImpl(sd); } } } catch (Exception e) { // Ignore } return null; }
registry.getServiceDiscovery().getServiceDeclaration(utilityType.getName()); Class<?> utilityClass = null; if (utilityDeclaration != null) {
registry.getServiceDiscovery().getServiceDeclaration(utilityType.getName()); Class<?> utilityClass = null; if (utilityDeclaration != null) {