Exemplo n.º 1
0
 /** Store a reference to a bundle as it is started so the bundle can be accessed later. */
 private void registerBundle(Bundle bundle) {
   if ((bundle.getState() & (Bundle.STARTING | Bundle.RESOLVED | Bundle.ACTIVE)) != 0) {
     AbstractSessionLog.getLog()
         .finest(
             "EclipseLink OSGi - examining bundle: "
                 + bundle.getSymbolicName()
                 + "_"
                 + bundle.getBundleId());
     if (!PersistenceProvider.includesBundle(bundle)) {
       try {
         String[] persistenceUnitNames = getPersistenceUnitNames(bundle);
         if (persistenceUnitNames != null) {
           // Bundle contains persistence unit(s)
           PersistenceProvider.addBundle(bundle, persistenceUnitNames);
           registerEMFServices(persistenceUnitNames);
         }
       } catch (Exception e) {
         AbstractSessionLog.getLog().logThrowable(SessionLog.WARNING, e);
       }
     }
   }
 }
Exemplo n.º 2
0
 private void deregisterBundle(Bundle bundle) {
   PersistenceProvider.removeBundle(bundle);
 }
Exemplo n.º 3
0
 public Object getDelegate() {
   return PersistenceProvider.instance().proxyDelegate(delegate.getDelegate());
 }