[jboss-cvs] JBossAS SVN: r80668 - in trunk/ejb3/src/main/org/jboss/ejb3: deployers and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Nov 7 11:46:32 EST 2008


Author: wolfc
Date: 2008-11-07 11:46:32 -0500 (Fri, 07 Nov 2008)
New Revision: 80668

Modified:
   trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java
   trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3ClientDeployer.java
Log:
JBAS-6176: reverted the injection of persistence unit dependency resolver

Modified: trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java	2008-11-07 16:13:47 UTC (rev 80667)
+++ trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java	2008-11-07 16:46:32 UTC (rev 80668)
@@ -38,8 +38,6 @@
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingException;
 
-import org.jboss.beans.metadata.api.annotations.Create;
-import org.jboss.beans.metadata.api.annotations.Inject;
 import org.jboss.beans.metadata.api.annotations.Start;
 import org.jboss.beans.metadata.api.annotations.Stop;
 import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
@@ -108,7 +106,7 @@
    private PersistenceUnitDependencyResolver persistenceUnitDependencyResolver;
 
    public ClientENCInjectionContainer(VFSDeploymentUnit unit, JBossClientMetaData xml, Class<?> mainClass, String applicationClientName, ClassLoader classLoader,
-         Context encCtx) throws NamingException
+         Context encCtx, PersistenceUnitDependencyResolver persistenceUnitDependencyResolver) throws NamingException
    {
       super(new SimpleJavaEEModule((unit.getParent() != null ? unit.getParent().getSimpleName() : null), unit.getSimpleName()));
       if (mainClass == null)
@@ -168,15 +166,15 @@
          throw new RuntimeException("Malformed object name " + on, e);
       }
       
-      // Do not do any processing yet, because we need stuff to be injected by MC
-   }
-
-   @Create
-   public void create()
-   {
+      this.persistenceUnitDependencyResolver = persistenceUnitDependencyResolver;
+      
+      // The resolvers must be set by here.
+      assert this.persistenceUnitDependencyResolver != null : "no persistenceUnitDependencyResolver specified";
+      
+      // Process meta data, so we have the right dependencies.
       processMetaData();
    }
-   
+
    private String createScopeKernelName(VFSDeploymentUnit unit, DeploymentScope ear)
    {
       String scopedKernelName = "";
@@ -422,12 +420,6 @@
       return persistenceUnitDependencyResolver.resolvePersistenceUnitSupplier(deploymentUnit, persistenceUnitName);
    }
    
-   @Inject
-   public void setPersistenceUnitDependencyResolver(PersistenceUnitDependencyResolver resolver)
-   {
-      this.persistenceUnitDependencyResolver = resolver;
-   }
-   
    @Start
    public void start()
    {

Modified: trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3ClientDeployer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3ClientDeployer.java	2008-11-07 16:13:47 UTC (rev 80667)
+++ trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3ClientDeployer.java	2008-11-07 16:46:32 UTC (rev 80668)
@@ -32,6 +32,7 @@
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingException;
 
+import org.jboss.beans.metadata.api.annotations.Inject;
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.structure.ClassPathEntry;
 import org.jboss.deployers.spi.structure.StructureMetaData;
@@ -41,7 +42,7 @@
 import org.jboss.ejb3.InitialContextFactory;
 import org.jboss.ejb3.KernelAbstraction;
 import org.jboss.ejb3.clientmodule.ClientENCInjectionContainer;
-import org.jboss.iiop.CorbaORBService;
+import org.jboss.jpa.resolvers.PersistenceUnitDependencyResolver;
 import org.jboss.kernel.Kernel;
 import org.jboss.kernel.spi.deployment.KernelDeployment;
 import org.jboss.metadata.client.jboss.JBossClientMetaData;
@@ -63,6 +64,8 @@
    private MBeanServer server;
    /** A flag indicating if a deployment based jndi should be linked to the JBossClientMetaData.jndiName */
    private boolean linkDeploymentJndiName = true;
+   
+   private PersistenceUnitDependencyResolver persistenceUnitDependencyResolver;
 
    /**
     * Create a new Ejb3ClientDeployer.
@@ -156,7 +159,7 @@
 
          Class<?> mainClass = loadClass(unit, mainClassName);
 
-         ClientENCInjectionContainer container = new ClientENCInjectionContainer(unit, metaData, mainClass, appClientName, unit.getClassLoader(), encCtx);
+         ClientENCInjectionContainer container = new ClientENCInjectionContainer(unit, metaData, mainClass, appClientName, unit.getClassLoader(), encCtx, persistenceUnitDependencyResolver);
 
          //di.deployedObject = container.getObjectName();
          unit.addAttachment(ClientENCInjectionContainer.class, container);
@@ -275,6 +278,12 @@
       this.server = server;
    }
 
+   @Inject
+   public void setPersistenceUnitDependencyResolver(PersistenceUnitDependencyResolver resolver)
+   {
+      this.persistenceUnitDependencyResolver = resolver;
+   }
+   
    @Override
    public void undeploy(VFSDeploymentUnit unit, JBossClientMetaData metaData)
    {




More information about the jboss-cvs-commits mailing list