Index: ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java =================================================================== --- ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java (revision Local version) +++ ejb3/src/main/org/jboss/ejb3/deployers/Ejb3JBoss5Deployment.java (revision Shelved version) @@ -21,13 +21,8 @@ */ package org.jboss.ejb3.deployers; -import java.util.Map; - -import javax.management.MBeanServer; -import javax.management.ObjectName; -import javax.security.jacc.PolicyConfiguration; - import org.jboss.beans.metadata.plugins.AbstractSupplyMetaData; +import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit; import org.jboss.deployment.MappedReferenceMetaDataResolverDeployer; import org.jboss.deployment.dependency.ContainerDependencyMetaData; import org.jboss.ejb3.Container; @@ -35,10 +30,12 @@ import org.jboss.ejb3.DeploymentUnit; import org.jboss.ejb3.EJBContainer; import org.jboss.ejb3.Ejb3Deployment; +import org.jboss.ejb3.Ejb3HandlerFactory; import org.jboss.ejb3.MCDependencyPolicy; import org.jboss.ejb3.javaee.JavaEEApplication; import org.jboss.ejb3.javaee.JavaEEComponent; import org.jboss.ejb3.kernel.JNDIKernelRegistryPlugin; +import org.jboss.ejb3.vfs.spi.VirtualFile; import org.jboss.kernel.Kernel; import org.jboss.logging.Logger; import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData; @@ -46,6 +43,14 @@ import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData; import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary; +import javax.management.MBeanServer; +import javax.management.ObjectName; +import javax.naming.InitialContext; +import javax.security.jacc.PolicyConfiguration; +import java.io.InputStream; +import java.util.List; +import java.util.Map; + /** * JBoss 5.0 Microkernel specific implementation * @@ -56,10 +61,10 @@ public class Ejb3JBoss5Deployment extends Ejb3Deployment { private static Logger log = Logger.getLogger(Ejb3JBoss5Deployment.class); - private org.jboss.deployers.structure.spi.DeploymentUnit jbossUnit; + private VFSDeploymentUnit jbossUnit; private Map endpoints; - public Ejb3JBoss5Deployment(DeploymentUnit ejb3Unit, Kernel kernel, MBeanServer mbeanServer, org.jboss.deployers.structure.spi.DeploymentUnit jbossUnit, JBoss5DeploymentScope deploymentScope, JBossMetaData metaData) + public Ejb3JBoss5Deployment(DeploymentUnit ejb3Unit, Kernel kernel, MBeanServer mbeanServer, VFSDeploymentUnit jbossUnit, JBoss5DeploymentScope deploymentScope, JBossMetaData metaData) { // Either call the old constructor and do process persistence units //super(ejb3Unit, deploymentScope, metaData, persistenceUnitsMetaData); @@ -80,6 +85,29 @@ return null; } + @Override + protected void deployUrl(Ejb3HandlerFactory factory) throws Exception + { + // make sure we are not deploying ejbs from client jar + if (hasClientDescriptors()) + return; + + InitialContext ctx = initialContext; + // need to look into every entry in the archive to see if anybody has tags + // defined. + List classes = unit.getResources(new org.jboss.ejb3.ClassFileFilter()); + for (VirtualFile classFile : classes) + { + InputStream stream = classFile.openStream(); + deployElement(stream, factory, ctx); + } + } + + private boolean hasClientDescriptors() + { + return jbossUnit.getMetaDataFile("application-client.xml") != null || jbossUnit.getMetaDataFile("jboss-client.xml") != null; + } + protected void putJaccInService(PolicyConfiguration pc, DeploymentUnit ejb3Unit) { //Ignore