private static Class<?> lookupByServiceEntryURL(ClassLoader cl) throws ClassNotFoundException { // use the common lookup/parsing logic for the service files. return ProviderLocator.getServiceClass(ExpressionFactory.class.getName(), ExpressionFactory.class, cl); }
public Object run() throws ClassNotFoundException, InstantiationException, IllegalAccessException { return ProviderLocator.loadClass(finalClassName, this.getClass(), contextClassLoader).newInstance(); } });
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); } }
@Override public synchronized void stop(BundleContext context) throws Exception { bt.close(); lst.close(); super.stop(context); }
public void start(BundleContext arg0) throws Exception { super.start(arg0); // bundle context for later ServiceReference lookups ctx = arg0; // track providers as they register themselves ServiceTrackerCustomizer customizer = new PersistenceTracker(this); tracker = new ServiceTracker(ctx, PERSISTENCE_PROVIDER, customizer); tracker.open(); // configure JPA provider resolver for OSGi PersistenceProviderResolverHolder.setPersistenceProviderResolver(this); }
public Object run() throws ClassNotFoundException, InstantiationException, IllegalAccessException { return ProviderLocator.loadClass(finalClassName, this.getClass(), contextClassLoader).newInstance(); } });
@Override public synchronized void stop(BundleContext context) throws Exception { bt.close(); lst.close(); super.stop(context); }
public void start(BundleContext arg0) throws Exception { super.start(arg0); // bundle context for later ServiceReference lookups ctx = arg0; // track providers as they register themselves ServiceTrackerCustomizer customizer = new PersistenceTracker(this); tracker = new ServiceTracker(ctx, PERSISTENCE_PROVIDER, customizer); tracker.open(); // configure JPA provider resolver for OSGi PersistenceProviderResolverHolder.setPersistenceProviderResolver(this); }
public Object run() { try { return ProviderLocator.loadClass(iClassName, FactoryFinder.class, iClassLoader).newInstance(); } catch (ClassNotFoundException x) { throw new ConfigurationError( "Provider " + iClassName + " not found", x); } catch (Exception x) { throw new ConfigurationError( "Provider " + iClassName + " could not be instantiated: " + x, x); } } });
@Override public synchronized void stop(BundleContext context) throws Exception { bt.close(); lst.close(); super.stop(context); }
public void start(BundleContext arg0) throws Exception { super.start(arg0); // bundle context for later ServiceReference lookups ctx = arg0; // track providers as they register themselves ServiceTrackerCustomizer customizer = new PersistenceTracker(this); tracker = new ServiceTracker(ctx, PERSISTENCE_PROVIDER, customizer); tracker.open(); // configure JPA provider resolver for OSGi PersistenceProviderResolverHolder.setPersistenceProviderResolver(this); }
private static Object newInstance(String className, ClassLoader classLoader) throws FactoryConfigurationError { try { return ProviderLocator.loadClass(className, FactoryLocator.class, classLoader).newInstance(); } catch (ClassNotFoundException x) { throw new FactoryConfigurationError("Requested factory " + className + " cannot be located. Classloader =" + classLoader.toString(), x); } catch (Exception x) { throw new FactoryConfigurationError("Requested factory " + className + " could not be instantiated: " + x, x); } } }
@Override public synchronized void stop(BundleContext context) throws Exception { bt.close(); lst.close(); super.stop(context); }
public void start(final BundleContext bundleContext) throws Exception { locator.start(bundleContext); activation.start(bundleContext); persistence.start(bundleContext); }
public void stop(BundleContext arg0) throws Exception { // cleanup provider tracker tracker.close(); tracker = null; // cleanup providers and remove ourselves as a JPA provider resolver PersistenceProviderResolverHolder.setPersistenceProviderResolver(null); providers.clear(); // cleanup context ctx = null; super.stop(arg0); }
public void start(BundleContext arg0) throws Exception { super.start(arg0); // bundle context for later ServiceReference lookups ctx = arg0; // track providers as they register themselves ServiceTrackerCustomizer customizer = new PersistenceTracker(this); tracker = new ServiceTracker(ctx, PERSISTENCE_PROVIDER, customizer); tracker.open(); // configure JPA provider resolver for OSGi PersistenceProviderResolverHolder.setPersistenceProviderResolver(this); }
public void stop(BundleContext arg0) throws Exception { // cleanup provider tracker tracker.close(); tracker = null; // cleanup providers and remove ourselves as a JPA provider resolver PersistenceProviderResolverHolder.setPersistenceProviderResolver(null); providers.clear(); // cleanup context ctx = null; super.stop(arg0); }
public void stop(BundleContext arg0) throws Exception { // cleanup provider tracker tracker.close(); tracker = null; // cleanup providers and remove ourselves as a JPA provider resolver PersistenceProviderResolverHolder.setPersistenceProviderResolver(null); providers.clear(); // cleanup context ctx = null; super.stop(arg0); }
public void stop(BundleContext arg0) throws Exception { // cleanup provider tracker tracker.close(); tracker = null; // cleanup providers and remove ourselves as a JPA provider resolver PersistenceProviderResolverHolder.setPersistenceProviderResolver(null); providers.clear(); // cleanup context ctx = null; super.stop(arg0); }
public void stop(final BundleContext bundleContext) throws Exception { persistence.stop(bundleContext); activation.stop(bundleContext); locator.stop(bundleContext); } }