Package org.jboss.ejb3.entity

Examples of org.jboss.ejb3.entity.PersistenceUnitDeployment


/*     */   }
/*     */
/*     */   public static ManagedEntityManagerFactory getManagedEntityManagerFactory(InjectionContainer container, String unitName)
/*     */     throws NameNotFoundException
/*     */   {
/* 139 */     PersistenceUnitDeployment deployment = container.getPersistenceUnitDeployment(unitName);
/*     */     ManagedEntityManagerFactory factory;
/* 140 */     if (deployment != null)
/*     */     {
/* 142 */       factory = deployment.getManagedFactory();
/*     */     }
/*     */     else
/*     */     {
/* 146 */       throw new NameNotFoundException("Unable to find persistence unit: " + unitName + " for deployment: " + container.getIdentifier());
/*     */     }
View Full Code Here


/*     */   }
/*     */
/*     */   public static EntityManagerFactory getEntityManagerFactory(String unitName, InjectionContainer container)
/*     */     throws NameNotFoundException
/*     */   {
/* 167 */     PersistenceUnitDeployment deployment = container.getPersistenceUnitDeployment(unitName);
/*     */     ManagedEntityManagerFactory managedFactory;
/* 168 */     if (deployment != null)
/*     */     {
/* 170 */       managedFactory = deployment.getManagedFactory();
/*     */     }
/*     */     else
/*     */     {
/* 174 */       return null;
/*     */     }
View Full Code Here

/*     */   }
/*     */
/*     */   private static SessionFactory getSessionFactory(String ref, InjectionContainer container)
/*     */     throws NameNotFoundException
/*     */   {
/* 183 */     PersistenceUnitDeployment deployment = container.getPersistenceUnitDeployment(ref);
/*     */     ManagedEntityManagerFactory managedFactory;
/* 184 */     if (deployment != null)
/*     */     {
/* 186 */       managedFactory = deployment.getManagedFactory();
/*     */     }
/*     */     else
/*     */     {
/* 190 */       return null;
/*     */     }
View Full Code Here

/*     */   }
/*     */
/*     */   public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
/*     */   {
/*  84 */     String kernelName = in.readUTF();
/*  85 */     PersistenceUnitDeployment deployment = PersistenceUnitRegistry.getPersistenceUnit(kernelName);
/*  86 */     if (deployment == null) throw new IOException("Unable to find persistence unit in registry: " + kernelName);
/*  87 */     this.factory = deployment.getManagedFactory();
/*     */   }
View Full Code Here

/* 114 */       Ejb3Deployment dep = this.deploymentScope.findRelativeDeployment(relativePath);
/* 115 */       if (dep == null)
/*     */       {
/* 117 */         return null;
/*     */       }
/* 119 */       PersistenceUnitDeployment rtn = dep.getPersistenceUnitDeploymentInternal(name);
/* 120 */       return rtn;
/*     */     }
/* 122 */     PersistenceUnitDeployment rtn = getPersistenceUnitDeploymentInternal(unitName);
/* 123 */     if (rtn != null) return rtn;
/*     */
/* 125 */     for (PersistenceUnitDeployment deployment : PersistenceUnitRegistry.getPersistenceUnits())
/*     */     {
/* 127 */       if (!deployment.isScoped())
View Full Code Here

/*     */       {
/* 580 */         String jarName = isScoped ? this.unit.getShortName() : null;
/* 581 */         cache_prefix = SecondLevelCacheUtil.createCacheRegionPrefix(earShortName, jarName, metadata.getName());
/* 582 */         metadata.getProps().setProperty("hibernate.cache.region_prefix", cache_prefix);
/*     */       }
/* 584 */       PersistenceUnitDeployment deployment = new PersistenceUnitDeployment(this.initialContext, this, this.explicitEntityClasses, persistenceUnitMetaData, earShortName, this.unit.getShortName(), isScoped);
/*     */
/* 586 */       PersistenceUnitRegistry.register(deployment);
/* 587 */       this.persistenceUnitDeployments.add(deployment);
/*     */     }
/*     */   }
View Full Code Here

            // deployments are segregated
            String jarName = isScoped ? unit.getShortName() : null;
            cache_prefix = SecondLevelCacheUtil.createCacheRegionPrefix(earShortName, jarName, metaData.getName());
            properties.put(SecondLevelCacheUtil.HIBERNATE_CACHE_REGION_PREFIX, cache_prefix);
         }
         PersistenceUnitDeployment deployment = new PersistenceUnitDeployment(initialContext, this, explicitEntityClasses, metaData, earShortName, unit.getShortName(), isScoped);
         PersistenceUnitRegistry.register(deployment);
         persistenceUnitDeployments.add(deployment);
      }
   }
View Full Code Here

            // deployments are segregated
            String jarName = isScoped ? unit.getShortName() : null;
            cache_prefix = SecondLevelCacheUtil.createCacheRegionPrefix(earShortName, jarName, metadata.getName());
            metadata.getProps().setProperty(SecondLevelCacheUtil.HIBERNATE_CACHE_REGION_PREFIX, cache_prefix);
         }
         PersistenceUnitDeployment deployment = new PersistenceUnitDeployment(initialContext, this,
               explicitEntityClasses, persistenceUnitMetaData, earShortName, unit.getShortName(), isScoped);
         PersistenceUnitRegistry.register(deployment);
         persistenceUnitDeployments.add(deployment);
      }
   }
View Full Code Here

         if(service instanceof StatelessContainer)
         {
            ((StatelessContainer) service).setBusinessObjectFactory(new EJB31StatelessBusinessObjectFactory());
         }
         if(service instanceof StatefulContainer)
            ((StatefulContainer) service).setBusinessObjectFactory(new EJB31StatefulBusinessObjectFactory(kernel));
      }

      if(unit != null)
      {
         // Just add the mc bean metadata to the unit
View Full Code Here

         builder.addPropertyMetaData("beanInstantiator", new AbstractInjectionValueMetaData(beanInstantiatorMcName));

         // ahem
         if(service instanceof StatelessContainer)
         {
            ((StatelessContainer) service).setBusinessObjectFactory(new EJB31StatelessBusinessObjectFactory());
         }
         if(service instanceof StatefulContainer)
            ((StatefulContainer) service).setBusinessObjectFactory(new EJB31StatefulBusinessObjectFactory(kernel));
      }
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.entity.PersistenceUnitDeployment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.