[jboss-cvs] JBossAS SVN: r66677 - in trunk/ejb3/src: main/org/jboss/ejb3/deployers and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Nov 2 08:17:46 EDT 2007
Author: wolfc
Date: 2007-11-02 08:17:46 -0400 (Fri, 02 Nov 2007)
New Revision: 66677
Modified:
trunk/ejb3/src/main/org/jboss/ejb3/Ejb3Deployment.java
trunk/ejb3/src/main/org/jboss/ejb3/Ejb3HandlerFactory.java
trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java
trunk/ejb3/src/test/org/jboss/ejb3/test/cachepassivation/MockEjb3Deployment.java
Log:
EJBTHREE-1067: store metaData in deployment
Modified: trunk/ejb3/src/main/org/jboss/ejb3/Ejb3Deployment.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/Ejb3Deployment.java 2007-11-02 12:17:15 UTC (rev 66676)
+++ trunk/ejb3/src/main/org/jboss/ejb3/Ejb3Deployment.java 2007-11-02 12:17:46 UTC (rev 66677)
@@ -63,6 +63,7 @@
import org.jboss.ejb3.metamodel.MessageDestination;
import org.jboss.logging.Logger;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.javaee.spec.MessageDestinationsMetaData;
import org.jboss.virtual.VirtualFile;
import org.jboss.xb.binding.JBossXBException;
@@ -79,6 +80,8 @@
public static final String ACTUAL_ENTITY_MANAGER_FACTORY_CONTEXT = "java:/ActualEntityManagerFactories";
public static final String MANAGED_ENTITY_FACTORY_CONTEXT = "java:/managedEntityFactories";
+ private JBossMetaData metaData;
+
protected DeploymentUnit unit;
protected LinkedHashMap<ObjectName, Container> ejbContainers = new LinkedHashMap<ObjectName, Container>();
@@ -108,12 +111,13 @@
//The JACC PolicyConfiguration
PolicyConfiguration pc;
- public Ejb3Deployment(DeploymentUnit unit, DeploymentScope deploymentScope)
+ public Ejb3Deployment(DeploymentUnit unit, DeploymentScope deploymentScope, JBossMetaData metaData)
{
assert unit != null : "unit is null";
this.unit = unit;
this.deploymentScope = deploymentScope;
+ this.metaData = metaData;
try
{
initialContext = InitialContextFactory.getInitialContext(unit.getJndiProperties());
@@ -124,24 +128,9 @@
}
ejbRefResolver = new EjbModuleEjbResolver(deploymentScope, unit.getShortName(), ejbContainers, this);
persistenceUnitResolver = new EjbModulePersistenceUnitResolver(persistenceUnitDeployments, deploymentScope, ejbContainers);
- Collection<MessageDestination> destinations = null;
- EjbJarDD dd;
- // FIXME: Why isn't dd stored somewhere?
- try
- {
- dd = EjbJarDDObjectFactory.parse(getDeploymentUnit().getEjbJarXml());
- dd = JBossDDObjectFactory.parse(getDeploymentUnit().getJbossXml(), dd);
- }
- catch(IOException e)
- {
- throw new RuntimeException(e);
- }
- catch(JBossXBException e)
- {
- throw new RuntimeException(e);
- }
- if(dd != null && dd.getAssemblyDescriptor() != null)
- destinations = dd.getAssemblyDescriptor().getMessageDestinations();
+ MessageDestinationsMetaData destinations = null;
+ if(metaData != null && metaData.getAssemblyDescriptor() != null)
+ destinations = metaData.getAssemblyDescriptor().getMessageDestinations();
messageDestinationResolver = new MessageDestinationResolver(deploymentScope, destinations);
}
@@ -463,7 +452,7 @@
protected void deployBeansFromLib(InitialContext ctx) throws Exception
{
- JBossMetaData dd = getMetaDataFomLib();
+ JBossMetaData dd = getMetaData();
if (dd != null)
{
Ejb3DescriptorHandler handler = new Ejb3DescriptorHandler(this, dd);
@@ -490,16 +479,6 @@
}
}
- protected JBossMetaData getMetaDataFomLib() throws JBossXBException, IOException
- {
- /*
- EjbJarDD dd = EjbJarDDObjectFactory.parse(getDeploymentUnit().getEjbJarXml());
- dd = JBossDDObjectFactory.parse(this.getDeploymentUnit().getJbossXml(), dd);
- return dd;
- */
- throw new RuntimeException("NYI");
- }
-
protected void deployElement(Ejb3HandlerFactory factory, ClassFile cf, InitialContext ctx) throws Exception
{
Ejb3Handler handler = factory.createHandler(cf);
@@ -708,6 +687,16 @@
return messageDestinationResolver;
}
+ /**
+ * Get the meta data associated with this deployment or null if none.
+ *
+ * @return meta data or null
+ */
+ public JBossMetaData getMetaData()
+ {
+ return metaData;
+ }
+
public String getName()
{
return unit.getShortName();
Modified: trunk/ejb3/src/main/org/jboss/ejb3/Ejb3HandlerFactory.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/Ejb3HandlerFactory.java 2007-11-02 12:17:15 UTC (rev 66676)
+++ trunk/ejb3/src/main/org/jboss/ejb3/Ejb3HandlerFactory.java 2007-11-02 12:17:46 UTC (rev 66677)
@@ -42,14 +42,10 @@
public DDFactory(Ejb3Deployment di) throws Exception
{
this.di = di;
- if(true) throw new RuntimeException("NYI");
- /*
- this.dd = EjbJarDDObjectFactory.parse(di.getDeploymentUnit().getEjbJarXml());
- this.dd = JBossDDObjectFactory.parse(di.getDeploymentUnit().getJbossXml(), dd);
+ this.dd = di.getMetaData();
InterceptorInfoRepository repository = this.di.getDeploymentUnit().getInterceptorInfoRepository();
repository.initialise(dd);
- */
}
Modified: trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java 2007-11-02 12:17:15 UTC (rev 66676)
+++ trunk/ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java 2007-11-02 12:17:46 UTC (rev 66677)
@@ -50,24 +50,17 @@
private static final Logger log = Logger.getLogger(Ejb3JBoss5Deployment.class);
private org.jboss.deployers.structure.spi.DeploymentUnit jbossUnit;
- private JBossMetaData metaData;
public Ejb3JBoss5Deployment(DeploymentUnit ejb3Unit, Kernel kernel, MBeanServer mbeanServer, org.jboss.deployers.structure.spi.DeploymentUnit jbossUnit, DeploymentScope deploymentScope, JBossMetaData metaData)
{
- super(ejb3Unit, deploymentScope);
+ super(ejb3Unit, deploymentScope, metaData);
this.jbossUnit = jbossUnit;
kernelAbstraction = new MCKernelAbstraction(kernel, mbeanServer);
// todo maybe mbeanServer should be injected?
this.mbeanServer = mbeanServer;
- this.metaData = metaData;
}
- protected JBossMetaData getMetaDataFomLib() throws JBossXBException, IOException
- {
- return metaData;
- }
-
protected PolicyConfiguration createPolicyConfiguration() throws Exception
{
return JaccHelper.initialiseJacc(getJaccContextId());
Modified: trunk/ejb3/src/test/org/jboss/ejb3/test/cachepassivation/MockEjb3Deployment.java
===================================================================
--- trunk/ejb3/src/test/org/jboss/ejb3/test/cachepassivation/MockEjb3Deployment.java 2007-11-02 12:17:15 UTC (rev 66676)
+++ trunk/ejb3/src/test/org/jboss/ejb3/test/cachepassivation/MockEjb3Deployment.java 2007-11-02 12:17:46 UTC (rev 66677)
@@ -41,7 +41,7 @@
public MockEjb3Deployment(DeploymentUnit unit, DeploymentScope deploymentScope)
{
- super(unit, deploymentScope);
+ super(unit, deploymentScope, null);
}
@Override
More information about the jboss-cvs-commits
mailing list