public Object run() throws ClassNotFoundException, InstantiationException, IllegalAccessException { return ProviderLocator.loadClass(finalClassName, this.getClass(), contextClassLoader).newInstance(); } });
Object service = ProviderLocator.getService(RuntimeDelegate.class.getName(), RuntimeDelegate.class, classLoader); if (service != null) { delegate = (RuntimeDelegate)service; className = ProviderLocator.lookupByJREPropertyFile("lib" + File.separator + "jaxrpc.properties", RuntimeDelegate.class.getName()); if (className != null) { Class<?> delegateClass = ProviderLocator.loadClass(className, RuntimeDelegate.class, classLoader); delegate = (RuntimeDelegate)delegateClass.newInstance(); Class<?> delegateClass = ProviderLocator.loadClass(className, RuntimeDelegate.class, classLoader); delegate = (RuntimeDelegate)delegateClass.newInstance();
Object service = ProviderLocator.getService(iFactoryId, FactoryFinder.class, classLoader); if (service != null) { return service; String factoryClassName = ProviderLocator.lookupByJREPropertyFile("lib" + File.separator + "jaxrpc.properties", iFactoryId); if (factoryClassName != null) { debugPrintln("found java.home property " + factoryClassName);
public static EJBContainer createEJBContainer(java.util.Map<?, ?> properties) { if (properties == null) { properties = Collections.EMPTY_MAP; } try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); // go check the loader files. List<Object> providers = ProviderLocator.getServices(EJBContainerProvider.class.getName(), EJBContainer.class, loader); for (Object o : providers) { EJBContainer container = ((EJBContainerProvider) o).createEJBContainer(properties); if (container != null) { return container; } } throw new EJBException("Provider error. No provider definition found"); } catch (EJBException e) { // if the container provider throws an EJBException, don't wrap another one // around the original. throw e; } catch (Exception e) { throw new EJBException("Provider error. No provider found", e); } }
final Object delegate = ProviderLocator.getService(FACTORY_ID, RuntimeDelegateFinder.class, classLoader); if (delegate != null) { return delegate;
private static String lookupByJREPropertyFile() { try { return ProviderLocator.lookupByJREPropertyFile(JAVA_RUNTIME_PROPERTY_FILE_LOCATION, SYSTEM_PROPERTY_NAME); } catch (IOException e) { throw new ELException("Fail to read configuration file", e); } }
public static EJBContainer createEJBContainer(java.util.Map<?, ?> properties) { if (properties == null) { properties = Collections.EMPTY_MAP; } try { ClassLoader loader = Thread.currentThread().getContextClassLoader(); // go check the loader files. List<Object> providers = ProviderLocator.getServices(EJBContainerProvider.class.getName(), EJBContainer.class, loader); for (Object o : providers) { EJBContainer container = ((EJBContainerProvider) o).createEJBContainer(properties); if (container != null) { return container; } } throw new EJBException("Provider error. No provider definition found"); } catch (EJBException e) { // if the container provider throws an EJBException, don't wrap another one // around the original. throw e; } catch (Exception e) { throw new EJBException("Provider error. No provider found", e); } }
Object service = ProviderLocator.getService(factoryPropertyName, FactoryFinder.class, classLoader); if (service != null) { return service; String factoryClassName = ProviderLocator.lookupByJREPropertyFile("lib" + File.separator + "jaxm.properties", factoryPropertyName); if (factoryClassName != null) { return newInstance(factoryClassName, classLoader);
final Object delegate = ProviderLocator.getService(FACTORY_ID, ClientBuilder.class, classLoader); if (delegate != null) { return delegate;
public Object run() throws ClassNotFoundException, InstantiationException, IllegalAccessException { return ProviderLocator.loadClass(finalClassName, this.getClass(), contextClassLoader).newInstance(); } });
try { List<Object> serviceProviders = ProviderLocator.getServices(PersistenceProvider.class.getName(), this.getClass(), cl); for (Object o : serviceProviders) { providers.add((PersistenceProvider)o);
String factoryClassName = ProviderLocator.lookupByJREPropertyFile("lib" + File.separator + "stax.properties", factoryId); if (factoryClassName != null) { return newInstance(factoryClassName, classLoader); Object service = ProviderLocator.getService(factoryId, FactoryLocator.class, classLoader); if (service != null) { return service;
final Object delegate = ProviderLocator.getService(FACTORY_ID, ClientBuilder.class, classLoader); if (delegate != null) { return delegate;
public Object run() throws Exception { factoryClassName[0] = System.getProperty(FACTORY_NAME); if (factoryClassName[0] == null) throw new ClassNotFoundException("Property " + FACTORY_NAME + " not set"); Thread currentThread = Thread.currentThread(); ClassLoader tccl = currentThread.getContextClassLoader(); return ProviderLocator.loadClass(factoryClassName[0], PolicyConfigurationFactory.class, tccl).newInstance(); } });
try { List<Object> serviceProviders = ProviderLocator.getServices(PersistenceProvider.class.getName(), this.getClass(), cl); for (Object o : serviceProviders) { providers.add((PersistenceProvider)o);
String factoryClassName = ProviderLocator.lookupByJREPropertyFile("lib" + File.separator + "stax.properties", factoryId); if (factoryClassName != null) { return newInstance(factoryClassName, classLoader); Object service = ProviderLocator.getService(factoryId, FactoryLocator.class, classLoader); if (service != null) { return service;
final Object delegate = ProviderLocator.getService(FACTORY_ID, ClientBuilder.class, classLoader); if (delegate != null) { return delegate;
public Object run() throws Exception { factoryClassName[0] = System.getProperty(FACTORY_NAME); if (factoryClassName[0] == null) throw new ClassNotFoundException("Property " + FACTORY_NAME + " not set"); Thread currentThread = Thread.currentThread(); ClassLoader tccl = currentThread.getContextClassLoader(); return ProviderLocator.loadClass(factoryClassName[0], PolicyConfigurationFactory.class, tccl).newInstance(); } });
try { List<Object> serviceProviders = ProviderLocator.getServices(PersistenceProvider.class.getName(), this.getClass(), cl); for (Object o : serviceProviders) { providers.add((PersistenceProvider)o);
String factoryClassName = ProviderLocator.lookupByJREPropertyFile("lib" + File.separator + "jaxrpc.properties", factoryId); if (factoryClassName != null) { debugPrintln("found java.home property " + factoryClassName); Object service = ProviderLocator.getService(factoryId, FactoryFinder.class, classLoader); if (service != null) { return service;