You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by xu...@apache.org on 2010/09/09 04:50:17 UTC
svn commit: r995297 - in /openejb/trunk/openejb3/container/openejb-core:
pom.xml src/main/java/org/apache/openejb/assembler/classic/Assembler.java
src/test/java/org/apache/openejb/cdi/tck/ServiceProviders.java
Author: xuhaihong
Date: Thu Sep 9 02:50:17 2010
New Revision: 995297
URL: http://svn.apache.org/viewvc?rev=995297&view=rev
Log:
OPENEJB-1337 first step to use a different profile to run the CDI TCK case
Modified:
openejb/trunk/openejb3/container/openejb-core/pom.xml
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/cdi/tck/ServiceProviders.java
Modified: openejb/trunk/openejb3/container/openejb-core/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/pom.xml?rev=995297&r1=995296&r2=995297&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/pom.xml (original)
+++ openejb/trunk/openejb3/container/openejb-core/pom.xml Thu Sep 9 02:50:17 2010
@@ -465,7 +465,7 @@
<artifactId>geronimo-atinject_1.0_spec</artifactId>
</exclusion>
</exclusions>
- </dependency>
+ </dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject-tck</artifactId>
@@ -485,6 +485,10 @@
<scope>test</scope>
<exclusions>
<exclusion>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ </exclusion>
+ <exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
@@ -543,7 +547,7 @@
<artifactId>jboss-test-harness</artifactId>
<version>1.1.0-CR5</version>
<scope>test</scope>
- </dependency>
+ </dependency>
</dependencies>
<profiles>
<profile>
@@ -572,6 +576,213 @@
</plugins>
</build>
</profile>
+ <profile>
+ <id>tck</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-tck</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.jsr299.tck</groupId>
+ <artifactId>jsr299-tck-impl</artifactId>
+ <version>1.0.2.CR1</version>
+ <type>xml</type>
+ <classifier>suite</classifier>
+ <overWrite>true</overWrite>
+ </artifactItem>
+ <!-- OWB Implementation Package -->
+ <artifactItem>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-impl</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.0.0-SNAPSHOT</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- OWB JSF 1.2 Plugin Package -->
+ <artifactItem>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-jsf12</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.0.0-SNAPSHOT</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- OWB EL 1.0 Plugin Package -->
+ <artifactItem>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-el10</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.0.0-SNAPSHOT</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- OWB Web Plugin Package -->
+ <artifactItem>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-web</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.0.0-SNAPSHOT</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- JavaEE API -->
+ <artifactItem>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>javaee-api</artifactId>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- OWB EE Common Package -->
+ <artifactItem>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-ee-common</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.0.0-SNAPSHOT</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- MyFaces API Package -->
+ <artifactItem>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.2.8</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- MyFaces Impl Package -->
+ <artifactItem>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.2.8</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- OWB Resource Plugin Package -->
+ <artifactItem>
+ <groupId>org.apache.openwebbeans</groupId>
+ <artifactId>openwebbeans-resource</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.0.0-SNAPSHOT</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- Dom4j -->
+ <artifactItem>
+ <groupId>dom4j</groupId>
+ <artifactId>dom4j</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.6.1</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- javassist -->
+ <artifactItem>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <overWrite>true</overWrite>
+ <version>3.12.0.GA</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- scannotation -->
+ <artifactItem>
+ <groupId>net.sf.scannotation</groupId>
+ <artifactId>scannotation</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.0.2</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- commons-logging -->
+ <artifactItem>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.1.1</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- commons-digester -->
+ <artifactItem>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.6</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- commons-codec -->
+ <artifactItem>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.3</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- commons-validator -->
+ <artifactItem>
+ <groupId>commons-validator</groupId>
+ <artifactId>commons-validator</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.3.1</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- commons-collections -->
+ <artifactItem>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <overWrite>true</overWrite>
+ <version>2.1</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- commons-beanutils -->
+ <artifactItem>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.7.0</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- commons-discovery -->
+ <artifactItem>
+ <groupId>commons-discovery</groupId>
+ <artifactId>commons-discovery</artifactId>
+ <overWrite>true</overWrite>
+ <version>0.4</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ <!-- xml-apis -->
+ <artifactItem>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ <overWrite>true</overWrite>
+ <version>1.0.b2</version>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <testNGArtifactName>org.testng:testng</testNGArtifactName>
+ <suiteXmlFiles>
+ <suiteXmlFile>src/test/resources/cdi-suite.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ <systemProperties>
+ <property>
+ <name>org.jboss.testharness.libraryDirectory</name>
+ <value>target/dependency/lib</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
</project>
Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java?rev=995297&r1=995296&r2=995297&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java Thu Sep 9 02:50:17 2010
@@ -31,6 +31,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
@@ -384,76 +385,76 @@ public class Assembler extends Assembler
return new ArrayList<AppInfo>(deployedApplications.values());
}
- public void createApplication(EjbJarInfo ejbJar) throws NamingException, IOException, OpenEJBException {
- createEjbJar(ejbJar);
+ public AppContext createApplication(EjbJarInfo ejbJar) throws NamingException, IOException, OpenEJBException {
+ return createEjbJar(ejbJar);
}
- public void createEjbJar(EjbJarInfo ejbJar) throws NamingException, IOException, OpenEJBException {
+ public AppContext createEjbJar(EjbJarInfo ejbJar) throws NamingException, IOException, OpenEJBException {
AppInfo appInfo = new AppInfo();
appInfo.path = ejbJar.path;
appInfo.appId = ejbJar.moduleId;
appInfo.ejbJars.add(ejbJar);
- createApplication(appInfo);
+ return createApplication(appInfo);
}
- public void createApplication(EjbJarInfo ejbJar, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
- createEjbJar(ejbJar, classLoader);
+ public AppContext createApplication(EjbJarInfo ejbJar, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
+ return createEjbJar(ejbJar, classLoader);
}
- public void createEjbJar(EjbJarInfo ejbJar, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
+ public AppContext createEjbJar(EjbJarInfo ejbJar, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
AppInfo appInfo = new AppInfo();
appInfo.path = ejbJar.path;
appInfo.appId = ejbJar.moduleId;
appInfo.ejbJars.add(ejbJar);
- createApplication(appInfo, classLoader);
+ return createApplication(appInfo, classLoader);
}
- public void createClient(ClientInfo clientInfo) throws NamingException, IOException, OpenEJBException {
+ public AppContext createClient(ClientInfo clientInfo) throws NamingException, IOException, OpenEJBException {
AppInfo appInfo = new AppInfo();
appInfo.path = clientInfo.path;
appInfo.appId = clientInfo.moduleId;
appInfo.clients.add(clientInfo);
- createApplication(appInfo);
+ return createApplication(appInfo);
}
- public void createClient(ClientInfo clientInfo, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
+ public AppContext createClient(ClientInfo clientInfo, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
AppInfo appInfo = new AppInfo();
appInfo.path = clientInfo.path;
appInfo.appId = clientInfo.moduleId;
appInfo.clients.add(clientInfo);
- createApplication(appInfo, classLoader);
+ return createApplication(appInfo, classLoader);
}
- public void createConnector(ConnectorInfo connectorInfo) throws NamingException, IOException, OpenEJBException {
+ public AppContext createConnector(ConnectorInfo connectorInfo) throws NamingException, IOException, OpenEJBException {
AppInfo appInfo = new AppInfo();
appInfo.path = connectorInfo.path;
appInfo.appId = connectorInfo.moduleId;
appInfo.connectors.add(connectorInfo);
- createApplication(appInfo);
+ return createApplication(appInfo);
}
- public void createConnector(ConnectorInfo connectorInfo, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
+ public AppContext createConnector(ConnectorInfo connectorInfo, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
AppInfo appInfo = new AppInfo();
appInfo.path = connectorInfo.path;
appInfo.appId = connectorInfo.moduleId;
appInfo.connectors.add(connectorInfo);
- createApplication(appInfo, classLoader);
+ return createApplication(appInfo, classLoader);
}
- public void createWebApp(WebAppInfo webAppInfo) throws NamingException, IOException, OpenEJBException {
+ public AppContext createWebApp(WebAppInfo webAppInfo) throws NamingException, IOException, OpenEJBException {
AppInfo appInfo = new AppInfo();
appInfo.path = webAppInfo.path;
appInfo.appId = webAppInfo.moduleId;
appInfo.webApps.add(webAppInfo);
- createApplication(appInfo);
+ return createApplication(appInfo);
}
- public void createWebApp(WebAppInfo webAppInfo, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
+ public AppContext createWebApp(WebAppInfo webAppInfo, ClassLoader classLoader) throws NamingException, IOException, OpenEJBException {
AppInfo appInfo = new AppInfo();
appInfo.path = webAppInfo.path;
appInfo.appId = webAppInfo.moduleId;
appInfo.webApps.add(webAppInfo);
- createApplication(appInfo, classLoader);
+ return createApplication(appInfo, classLoader);
}
public AppContext createApplication(AppInfo appInfo) throws OpenEJBException, IOException, NamingException {
@@ -465,7 +466,7 @@ public class Assembler extends Assembler
}
public AppContext createApplication(AppInfo appInfo, ClassLoader classLoader, boolean start) throws OpenEJBException, IOException, NamingException {
- // The path is used in the UrlCache, command line deployer, JNDI name templates, tomcat integration and a few other places
+ // The path is used in the UrlCache, command line deployer, JNDI name templates, tomcat integration and a few other places
if (appInfo.path == null) throw new IllegalArgumentException("AppInfo.path cannot be null");
if (appInfo.appId == null) throw new IllegalArgumentException("AppInfo.appId cannot be null");
@@ -514,7 +515,7 @@ public class Assembler extends Assembler
}
AppContext appContext = new AppContext(appInfo.appId, SystemInstance.get(), classLoader, globalJndiContext, appJndiContext, false);
-
+
// JPA - Persistence Units MUST be processed first since they will add ClassFileTransformers
// to the class loader which must be added before any classes are loaded
PersistenceBuilder persistenceBuilder = new PersistenceBuilder(persistenceClassLoaderHandler);
@@ -654,7 +655,7 @@ public class Assembler extends Assembler
CdiBuilder cdiBuilder = new CdiBuilder(appInfo, appContext);
cdiBuilder.build(allDeployments);
-
+
// now that everything is configured, deploy to the container
if (start) {
// deploy
@@ -667,13 +668,13 @@ public class Assembler extends Assembler
throw new OpenEJBException("Error deploying '"+deployment.getEjbName()+"'. Exception: "+t.getClass()+": "+t.getMessage(), t);
}
}
-
+
// start
for (DeploymentInfo deployment : allDeployments) {
try {
Container container = deployment.getContainer();
container.start(deployment);
- logger.info("createApplication.startedEjb", deployment.getDeploymentID(), deployment.getEjbName(), container.getContainerID());
+ logger.info("createApplication.startedEjb", deployment.getDeploymentID(), deployment.getEjbName(), container.getContainerID());
} catch (Throwable t) {
throw new OpenEJBException("Error starting '"+deployment.getEjbName()+"'. Exception: "+t.getClass()+": "+t.getMessage(), t);
}
@@ -695,10 +696,10 @@ public class Assembler extends Assembler
}
jndiEncBuilder.setUseCrossClassLoaderRef(false);
- Context context = (Context) jndiEncBuilder.build(JndiEncBuilder.JndiScope.comp);
+ Context context = jndiEncBuilder.build(JndiEncBuilder.JndiScope.comp);
Debug.printContext(context);
-
+
containerSystem.getJNDIContext().bind("openejb/client/" + clientInfo.moduleId, context);
if (clientInfo.path != null) {
@@ -933,7 +934,7 @@ public class Assembler extends Assembler
undeployException.getCauses().add(new Exception("bean: " + deploymentID + ": " + t.getMessage(), t));
}
}
-
+
// undeploy
for (DeploymentInfo deployment : deployments) {
String deploymentID = deployment.getDeploymentID() + "";
Modified: openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/cdi/tck/ServiceProviders.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/cdi/tck/ServiceProviders.java?rev=995297&r1=995296&r2=995297&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/cdi/tck/ServiceProviders.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/test/java/org/apache/openejb/cdi/tck/ServiceProviders.java Thu Sep 9 02:50:17 2010
@@ -16,48 +16,35 @@
*/
package org.apache.openejb.cdi.tck;
-import org.apache.openejb.DeploymentInfo;
+import java.io.File;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javax.el.ELContext;
+import javax.enterprise.context.RequestScoped;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.apache.openejb.assembler.classic.Assembler;
import org.apache.openejb.assembler.classic.EjbJarInfo;
+import org.apache.openejb.assembler.classic.SecurityServiceInfo;
+import org.apache.openejb.assembler.classic.TransactionServiceInfo;
+import org.apache.openejb.config.ConfigurationFactory;
+import org.apache.openejb.config.EjbModule;
import org.apache.openejb.core.AppContext;
import org.apache.openejb.core.CoreDeploymentInfo;
-import org.apache.openejb.core.ThreadContext;
+import org.apache.openejb.jee.EjbJar;
import org.apache.openejb.loader.SystemInstance;
import org.apache.openejb.spi.ContainerSystem;
-import org.apache.webbeans.container.BeanManagerImpl;
-import org.jboss.testharness.api.DeploymentException;
-import org.apache.openejb.config.EjbModule;
-import org.apache.openejb.config.ConfigurationFactory;
-import org.apache.openejb.assembler.classic.Assembler;
-import org.apache.openejb.assembler.classic.SecurityServiceInfo;
-import org.apache.openejb.assembler.classic.TransactionServiceInfo;
-import org.apache.openejb.jee.EjbJar;
+import org.apache.webbeans.context.AbstractContext;
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.context.RequestContext;
+import org.apache.webbeans.context.type.ContextTypes;
import org.apache.xbean.finder.ClassFinder;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-import javax.el.ExpressionFactory;
-import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.InterceptionType;
-import javax.enterprise.inject.spi.AnnotatedType;
-import javax.enterprise.inject.spi.InjectionTarget;
-import javax.enterprise.inject.spi.ObserverMethod;
-import javax.enterprise.inject.spi.Decorator;
-import javax.enterprise.inject.spi.Interceptor;
-import java.io.File;
-import java.net.URL;
-import java.util.Collection;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-import java.util.List;
-import java.lang.reflect.Type;
-import java.lang.annotation.Annotation;
+import org.jboss.testharness.api.DeploymentException;
/**
* @version $Rev$ $Date$
@@ -76,33 +63,39 @@ public class ServiceProviders {
}
public static class BeansProvider implements org.jboss.jsr299.tck.spi.Beans {
+
public boolean isProxy(Object instance) {
- System.out.println("ServiceProviders$BeansProvider.isProxy");
- return false;
+ return instance.getClass().getName().contains("$$");
}
}
- public static class ContextsProvider implements org.jboss.jsr299.tck.spi.Contexts {
- public void setActive(Context context) {
- System.out.println("ServiceProviders$ContextsProvider.setActive");
+ public static class ContextsProvider implements org.jboss.jsr299.tck.spi.Contexts<AbstractContext> {
+
+ public AbstractContext getRequestContext() {
+ RequestContext ctx = (RequestContext) ContextFactory.getStandardContext(RequestScoped.class);
+
+ if (ctx == null) {
+ ContextFactory.initRequestContext(null);
+ }
+
+ return (AbstractContext) ContextFactory.getStandardContext(ContextTypes.REQUEST);
}
- public void setInactive(Context context) {
- System.out.println("ServiceProviders$ContextsProvider.setInactive");
+ public void setActive(AbstractContext context) {
+ context.setActive(true);
+
}
- public Context getRequestContext() {
- System.out.println("ServiceProviders$ContextsProvider.getRequestContext");
- return null;
+ public void setInactive(AbstractContext context) {
+ context.setActive(false);
}
- public Context getDependentContext() {
- System.out.println("ServiceProviders$ContextsProvider.getDependentContext");
- return null;
+ public AbstractContext getDependentContext() {
+ return (AbstractContext) ContextFactory.getStandardContext(ContextTypes.DEPENDENT);
}
- public void destroyContext(Context context) {
- System.out.println("ServiceProviders$ContextsProvider.destroyContext");
+ public void destroyContext(AbstractContext context) {
+ context.destroy();
}
}
@@ -111,18 +104,15 @@ public class ServiceProviders {
private DeploymentException deploymentException;
public void deploy(Collection<Class<?>> classes) throws DeploymentException {
- System.out.println("ServiceProviders$StandaloneContainersProvider.deploy");
- System.out.println("StandaloneContainersImpl.deploy(classes)");
- for (Class<?> clazz : classes) {
- System.out.println("clazz = " + clazz);
- }
+ deploy(classes, Collections.<URL> emptyList());
}
public boolean deploy(Collection<Class<?>> classes, Collection<URL> urls) {
System.out.println("ServiceProviders$StandaloneContainersProvider.deploy");
List<String> classNames = new ArrayList<String>();
- for (Class<?> clazz : classes) classNames.add(clazz.getName());
+ for (Class<?> clazz : classes)
+ classNames.add(clazz.getName());
Collections.sort(classNames);
for (String clazz : classNames) {
@@ -136,7 +126,7 @@ public class ServiceProviders {
EjbModule ejbModule = new EjbModule(new EjbJar("beans"));
ejbModule.setFinder(new ClassFinder(new ArrayList(classes)));
- Map<String,Object> dds = ejbModule.getAltDDs();
+ Map<String, Object> dds = ejbModule.getAltDDs();
for (URL url : urls) {
final File file = new File(url.getFile());
@@ -151,13 +141,7 @@ public class ServiceProviders {
final EjbJarInfo ejbJar = config.configureApplication(ejbModule);
ejbJar.beans.managedClasses.addAll(classNames);
-
- assembler.createApplication(ejbJar);
-
- final ContainerSystem component = SystemInstance.get().getComponent(ContainerSystem.class);
-
- final CoreDeploymentInfo deploymentInfo = (CoreDeploymentInfo) component.deployments()[0];
- appContext = deploymentInfo.getModuleContext().getAppContext();
+ appContext = assembler.createApplication(ejbJar);
// This must be set or the OWB static lookup code won't work and everything will fall apart
Thread.currentThread().setContextClassLoader(appContext.getClassLoader());
@@ -167,13 +151,13 @@ public class ServiceProviders {
deploymentException = new DeploymentException("Deploy failed", e);
return false;
}
-// System.out.println("StandaloneContainersImpl.deploy(classes, urls)");
-// for (Class<?> clazz : classes) {
-// System.out.println("clazz = " + clazz);
-// }
-// for (URL url : urls) {
-// System.out.println("url = " + url);
-// }
+ // System.out.println("StandaloneContainersImpl.deploy(classes, urls)");
+ // for (Class<?> clazz : classes) {
+ // System.out.println("clazz = " + clazz);
+ // }
+ // for (URL url : urls) {
+ // System.out.println("url = " + url);
+ // }
return true;
}