[webbeans-commits] Webbeans SVN: r2936 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bootstrap and 10 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-30 14:27:59 -0400 (Tue, 30 Jun 2009)
New Revision: 2936
Added:
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockDeployment.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java
Removed:
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java
ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java
Log:
switch to using Deployment
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -173,16 +173,27 @@
* Application scoped data structures
* ***********************************
*/
+
+ private transient final ConcurrentListMultiMap<Class<? extends Annotation>, Context> contexts;
+ private transient final ClientProxyProvider clientProxyProvider;
+ private final transient AtomicInteger ids;
+ private transient final Map<String, RIBean<?>> riBeans;
+ private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans;
+
+ /*
+ * Archive scoped services
+ * ***********************
+ */
+
+ /*
+ * Archive scoped data structures
+ * ******************************
+ */
private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
private transient List<Class<?>> enabledDecoratorClasses;
private transient List<Class<?>> enabledInterceptorClasses;
- private transient final ConcurrentListMultiMap<Class<? extends Annotation>, Context> contexts;
private final transient Set<CurrentActivity> currentActivities;
- private transient final ClientProxyProvider clientProxyProvider;
- private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans;
- private transient final Map<String, RIBean<?>> riBeans;
private final transient Map<Contextual<?>, Contextual<?>> specializedBeans;
- private final transient AtomicInteger ids;
/*
* Activity scoped services
@@ -251,8 +262,10 @@
return new BeanManagerImpl(
parentManager.getServices(),
- beans, parentManager.getDecorators(),
- registeredObservers, rootNamespace,
+ beans,
+ parentManager.getDecorators(),
+ registeredObservers,
+ rootNamespace,
parentManager.getNewEnterpriseBeanMap(),
parentManager.getRiBeans(),
parentManager.getClientProxyProvider(),
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -16,6 +16,10 @@
*/
package org.jboss.webbeans.bootstrap;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+
import javax.enterprise.inject.spi.BeforeShutdown;
import javax.enterprise.inject.spi.Extension;
@@ -32,7 +36,8 @@
import org.jboss.webbeans.bootstrap.api.Environments;
import org.jboss.webbeans.bootstrap.api.helpers.AbstractBootstrap;
import org.jboss.webbeans.bootstrap.api.helpers.ServiceRegistries;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.ContextLifecycle;
import org.jboss.webbeans.context.ConversationContext;
@@ -47,6 +52,8 @@
import org.jboss.webbeans.conversation.ServletConversationManager;
import org.jboss.webbeans.ejb.EJBApiAbstraction;
import org.jboss.webbeans.ejb.EjbDescriptorCache;
+import org.jboss.webbeans.ejb.spi.EJBModule;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.jsf.JsfApiAbstraction;
import org.jboss.webbeans.log.Log;
@@ -75,6 +82,73 @@
*/
public class WebBeansBootstrap extends AbstractBootstrap implements Bootstrap
{
+
+ // Temporary workaround for reading from a Deployment
+ private static class DeploymentVisitor
+ {
+
+ private final Collection<Class<?>> beanClasses;
+ private final Collection<URL> beansXmlUrls;
+ private final Collection<EjbDescriptor<?>> ejbDescriptors;
+ private final Deployment deployment;
+
+ public DeploymentVisitor(Deployment deployment)
+ {
+ this.deployment = deployment;
+ this.beanClasses = new ArrayList<Class<?>>();
+ this.beansXmlUrls = new ArrayList<URL>();
+ this.ejbDescriptors = new ArrayList<EjbDescriptor<?>>();
+ }
+
+ public DeploymentVisitor visit()
+ {
+ for (BeanDeploymentArchive archvive : deployment.getBeanDeploymentArchives())
+ {
+ visit(archvive);
+ }
+ return this;
+ }
+
+ private void visit(BeanDeploymentArchive beanDeploymentArchive)
+ {
+ for (Class<?> clazz : beanDeploymentArchive.getBeanClasses())
+ {
+ beanClasses.add(clazz);
+ }
+ for (URL url : beanDeploymentArchive.getBeansXml())
+ {
+ beansXmlUrls.add(url);
+ }
+ if (beanDeploymentArchive instanceof EJBModule)
+ {
+ EJBModule ejbModule = (EJBModule) beanDeploymentArchive;
+ for (EjbDescriptor<?> ejbDescriptor : ejbModule.getEjbs())
+ {
+ ejbDescriptors.add(ejbDescriptor);
+ }
+ }
+ for (BeanDeploymentArchive archive : beanDeploymentArchive.getBeanDeploymentArchives())
+ {
+ visit(archive);
+ }
+ }
+
+ public Iterable<Class<?>> getBeanClasses()
+ {
+ return beanClasses;
+ }
+
+ public Iterable<URL> getBeansXmlUrls()
+ {
+ return beansXmlUrls;
+ }
+
+ public Iterable<EjbDescriptor<?>> getEjbDescriptors()
+ {
+ return ejbDescriptors;
+ }
+
+ }
// The log provider
private static Log log = Logging.getLog(WebBeansBootstrap.class);
@@ -171,11 +245,6 @@
beanDeployer.createBeans().deploy();
}
- private void registerExtensionBeans(Iterable<Extension> instances, AbstractBeanDeployer beanDeployer)
- {
-
- }
-
public void boot()
{
synchronized (this)
@@ -189,8 +258,10 @@
throw new IllegalStateException("No application context BeanStore set");
}
- parseBeansXml();
+ DeploymentVisitor deploymentVisitor = new DeploymentVisitor(getServices().get(Deployment.class)).visit();
+ parseBeansXml(deploymentVisitor.getBeansXmlUrls());
+
beginApplication(getApplicationContext());
BeanStore requestBeanStore = new ConcurrentHashMapBeanStore();
beginDeploy(requestBeanStore);
@@ -200,7 +271,7 @@
{
// Must populate EJB cache first, as we need it to detect whether a
// bean is an EJB!
- ejbDescriptors.addAll(getServices().get(EjbServices.class).discoverEjbs());
+ ejbDescriptors.addAll(deploymentVisitor.getEjbDescriptors());
}
// TODO Should use a separate event manager for sending bootstrap events
@@ -211,7 +282,7 @@
BeanDeployer beanDeployer = new BeanDeployer(manager, ejbDescriptors);
fireBeforeBeanDiscoveryEvent(beanDeployer);
- registerBeans(getServices().get(WebBeanDiscovery.class).discoverWebBeanClasses(), beanDeployer);
+ registerBeans(deploymentVisitor.getBeanClasses(), beanDeployer);
fireAfterBeanDiscoveryEvent();
log.debug("Web Beans initialized. Validating beans.");
getServices().get(Validator.class).validateDeployment(manager, beanDeployer.getBeanDeployerEnvironment());
@@ -222,9 +293,9 @@
}
}
- private void parseBeansXml()
+ private void parseBeansXml(Iterable<URL> urls)
{
- BeansXmlParser parser = new BeansXmlParser(getServices().get(ResourceLoader.class), getServices().get(WebBeanDiscovery.class).discoverWebBeansXml());
+ BeansXmlParser parser = new BeansXmlParser(getServices().get(ResourceLoader.class), urls);
parser.parse();
if (parser.getEnabledDeploymentTypes() != null)
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/Environments.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -20,7 +20,7 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.messaging.spi.JmsServices;
import org.jboss.webbeans.persistence.spi.JpaServices;
@@ -41,22 +41,22 @@
/**
* Java EE5 or Java EE6
*/
- EE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, WebServices.class, JmsServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class),
+ EE(Deployment.class, EjbServices.class, JpaServices.class, WebServices.class, JmsServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class),
/**
* Java EE6 Web Profile
*/
- EE_WEB_PROFILE(WebBeanDiscovery.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class),
+ EE_WEB_PROFILE(Deployment.class, EjbServices.class, JpaServices.class, ResourceServices.class, TransactionServices.class, ResourceLoader.class),
/**
* Servlet container such as Tomcat
*/
- SERVLET(WebBeanDiscovery.class, ResourceLoader.class),
+ SERVLET(Deployment.class, ResourceLoader.class),
/**
* Java SE
*/
- SE(WebBeanDiscovery.class, ResourceLoader.class);
+ SE(Deployment.class, ResourceLoader.class);
private final Set<Class<? extends Service>> requiredServices;
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/api/helpers/BootstrapBean.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -3,7 +3,7 @@
import org.jboss.webbeans.bootstrap.api.Bootstrap;
import org.jboss.webbeans.bootstrap.api.Environment;
import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.manager.api.WebBeansManager;
@@ -59,17 +59,17 @@
{
bootstrap.getServices().add(ResourceServices.class, resourceServices);
}
-
- public void setWebBeanDiscovery(WebBeanDiscovery webBeanDiscovery)
+
+ public void setDeployment(Deployment deployment)
{
- bootstrap.getServices().add(WebBeanDiscovery.class, webBeanDiscovery);
+ bootstrap.getServices().add(Deployment.class, deployment);
}
-
- public WebBeanDiscovery getWebBeanDiscovery()
+
+ public Deployment getDeployment()
{
- return bootstrap.getServices().get(WebBeanDiscovery.class);
+ return bootstrap.getServices().get(Deployment.class);
}
-
+
public void setTransactionServices(TransactionServices transactionServices)
{
bootstrap.getServices().add(TransactionServices.class, transactionServices);
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -19,7 +19,6 @@
import java.net.URL;
import java.util.List;
-import org.jboss.webbeans.bootstrap.api.Service;
import org.jboss.webbeans.ejb.spi.EJBModule;
/**
@@ -46,12 +45,12 @@
* @author Pete Muir
*
*/
-public interface BeanDeploymentArchive extends Service
+public interface BeanDeploymentArchive
{
/**
* Get the ordered bean deployment archives which are accessible to this bean
- * deployment archive and adjacent to it in the deployment archive graph.
+ * deployment archive and adjacent to it i n the deployment archive graph.
*
* The bean deployment archives will be processed in the order specified.
*
@@ -69,11 +68,16 @@
public Iterable<Class<?>> getBeanClasses();
/**
- * Get the deployment descriptor
+ * Get any deployment descriptors in the bean deployment archive.
*
- * @return a URL pointing to the deployment descriptor, or null if it is not
- * present
+ * The container will normally return a single deployment descriptor per bean
+ * deployment archive (the physical META-INF/beans.xml or WEB-INF/beans.xml),
+ * however it is permitted to return other deployment descriptors defined
+ * using other methods.
+ *
+ * @return an iteration over the URLs pointing to the deployment descriptor,
+ * or an empty set if none are present
*/
- public URL getBeansXml();
+ public Iterable<URL> getBeansXml();
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -18,6 +18,7 @@
import java.util.List;
+import org.jboss.webbeans.bootstrap.api.Service;
import org.jboss.webbeans.ejb.spi.EJBModule;
/**
@@ -49,7 +50,7 @@
* @author Pete Muir
*
*/
-public interface Deployment
+public interface Deployment extends Service
{
/**
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EjbServices.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -71,13 +71,4 @@
*/
public Object resolveRemoteEjb(String jndiName, String mappedName, String ejbLink);
- /**
- * Gets a descriptor for each EJB in the application
- *
- * @deprecated an {@link EJBModule} should be used to represent all EJBs
- * @return the EJB descriptors
- */
- @Deprecated
- public Iterable<EjbDescriptor<?>> discoverEjbs();
-
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/helpers/ForwardingEjbServices.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -51,11 +51,6 @@
{
return delegate().resolveRemoteEjb(jndiName, mappedName, ejbLink);
}
-
- public Iterable<EjbDescriptor<?>> discoverEjbs()
- {
- return delegate().discoverEjbs();
- }
@Override
public boolean equals(Object obj)
Modified: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/BootstrapTest.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -2,7 +2,7 @@
import org.jboss.webbeans.bootstrap.api.Environments;
import org.jboss.webbeans.bootstrap.api.helpers.AbstractBootstrap;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.messaging.spi.JmsServices;
@@ -34,7 +34,7 @@
bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
- bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.getServices().add(WebServices.class, new MockWebServices());
@@ -50,7 +50,7 @@
bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
- bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.getServices().add(WebServices.class, new MockWebServices());
@@ -66,7 +66,7 @@
bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
- bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
@@ -82,7 +82,7 @@
bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
- bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
@@ -99,7 +99,7 @@
bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
- bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
@@ -116,7 +116,7 @@
bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
- bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
@@ -131,7 +131,7 @@
bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
- bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
bootstrap.getServices().add(ResourceServices.class, new MockResourceServices());
bootstrap.initialize();
@@ -145,7 +145,7 @@
bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
bootstrap.getServices().add(EjbServices.class, new MockEjbServices());
- bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.getServices().add(JpaServices.class, new MockJpaServices());
bootstrap.getServices().add(TransactionServices.class, new MockTransactionServices());
bootstrap.initialize();
@@ -158,7 +158,7 @@
bootstrap.setEnvironment(Environments.SE);
bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
- bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.initialize();
}
@@ -169,7 +169,7 @@
bootstrap.setEnvironment(Environments.SERVLET);
bootstrap.getServices().add(ResourceLoader.class, new MockResourceLoader());
bootstrap.setApplicationContext(new ConcurrentHashMapBeanStore());
- bootstrap.getServices().add(WebBeanDiscovery.class, new MockWebBeanDiscovery());
+ bootstrap.getServices().add(Deployment.class, new MockDeployment());
bootstrap.initialize();
}
Added: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockDeployment.java
===================================================================
--- ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockDeployment.java (rev 0)
+++ ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockDeployment.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.bootstrap.api.test;
+
+import java.util.List;
+
+import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockDeployment implements Deployment
+{
+
+ public List<BeanDeploymentArchive> getBeanDeploymentArchives()
+ {
+ return null;
+ }
+
+ public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
+ {
+ return null;
+ }
+
+}
Property changes on: ri/trunk/spi/src/test/java/org/jboss/webbeans/bootstrap/api/test/MockDeployment.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.mock;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+
+import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockBeanDeploymentArchive implements BeanDeploymentArchive
+{
+
+
+ private Iterable<Class<?>> beanClasses = new HashSet<Class<?>>();
+
+ private Iterable<URL> webBeansXmlFiles = new HashSet<URL>();
+
+ public Iterable<Class<?>> getBeanClasses()
+ {
+ return beanClasses;
+ }
+
+ public Iterable<URL> getBeansXml()
+ {
+ return webBeansXmlFiles;
+ }
+
+ public void setBeanClasses(Iterable<Class<?>> webBeanClasses)
+ {
+ this.beanClasses = webBeanClasses;
+ }
+
+ public void setWebBeansXmlFiles(Iterable<URL> webBeansXmlFiles)
+ {
+ this.webBeansXmlFiles = webBeansXmlFiles;
+ }
+
+ public List<BeanDeploymentArchive> getBeanDeploymentArchives()
+ {
+ return Collections.emptyList();
+ }
+
+}
Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java (from rev 2934, ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java)
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.mock;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
+
+public class MockDeployment implements Deployment
+{
+
+ private MockEjbModule ejbModule;
+
+ private List<BeanDeploymentArchive> beanDeploymentArchives;
+
+ public MockDeployment()
+ {
+ this.ejbModule = new MockEjbModule();
+ this.beanDeploymentArchives = new ArrayList<BeanDeploymentArchive>();
+ this.beanDeploymentArchives.add(ejbModule);
+ }
+
+ public List<BeanDeploymentArchive> getBeanDeploymentArchives()
+ {
+ return beanDeploymentArchives;
+ }
+
+ public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
+ {
+ return ejbModule;
+ }
+
+ public MockEjbModule getEjbModule()
+ {
+ return ejbModule;
+ }
+
+}
Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEELifecycle.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -33,8 +33,8 @@
{
super();
getBootstrap().getServices().add(TransactionServices.class, MOCK_TRANSACTION_SERVICES);
- getBootstrap().getServices().add(EjbServices.class, new MockEjBServices(getWebBeanDiscovery()));
- getBootstrap().getServices().add(JpaServices.class, new MockJpaServices(getWebBeanDiscovery()));
+ getBootstrap().getServices().add(EjbServices.class, new MockEjBServices());
+ getBootstrap().getServices().add(JpaServices.class, new MockJpaServices(getDeployment()));
getBootstrap().getServices().add(ResourceServices.class, new MockResourceServices());
getBootstrap().getServices().add(WebServices.class, new MockWebServices());
getBootstrap().getServices().add(JmsServices.class, new MockJmsServices());
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjBServices.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -8,7 +8,6 @@
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
import org.jboss.webbeans.ejb.api.SessionObjectReference;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.ejb.spi.EjbServices;
@@ -16,13 +15,6 @@
public class MockEjBServices implements EjbServices
{
- private final MockEjbDiscovery ejbDiscovery;
-
- public MockEjBServices(WebBeanDiscovery webBeanDiscovery)
- {
- this.ejbDiscovery = new MockEjbDiscovery(webBeanDiscovery);
- }
-
public Object resolveEjb(InjectionPoint injectionPoint)
{
return null;
@@ -37,11 +29,6 @@
{
return null;
}
-
- public Iterable<EjbDescriptor<?>> discoverEjbs()
- {
- return ejbDiscovery.discoverEjbs();
- }
public SessionObjectReference resolveEjb(EjbDescriptor<?> ejbDescriptor)
{
Deleted: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDiscovery.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.mock;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.ejb.MessageDriven;
-import javax.ejb.Singleton;
-import javax.ejb.Stateful;
-import javax.ejb.Stateless;
-
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-
-public class MockEjbDiscovery
-{
-
- private final WebBeanDiscovery webBeanDiscovery;
-
- public MockEjbDiscovery(WebBeanDiscovery webBeanDiscovery)
- {
- this.webBeanDiscovery = webBeanDiscovery;
- }
-
- public Iterable<EjbDescriptor<?>> discoverEjbs()
- {
- List<EjbDescriptor<?>> ejbs = new ArrayList<EjbDescriptor<?>>();
- for (Class<?> ejbClass : discoverEjbs(webBeanDiscovery.discoverWebBeanClasses()))
- {
- ejbs.add(MockEjbDescriptor.of(ejbClass));
- }
- return ejbs;
- }
-
- protected static Iterable<Class<?>> discoverEjbs(Iterable<Class<?>> webBeanClasses)
- {
- Set<Class<?>> ejbs = new HashSet<Class<?>>();
- for (Class<?> clazz : webBeanClasses)
- {
- if (clazz.isAnnotationPresent(Stateless.class) || clazz.isAnnotationPresent(Stateful.class) || clazz.isAnnotationPresent(MessageDriven.class) || clazz.isAnnotationPresent(Singleton.class))
- {
- ejbs.add(clazz);
- }
- }
- return ejbs;
- }
-
-
-
-}
Added: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java (rev 0)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.mock;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.ejb.MessageDriven;
+import javax.ejb.Singleton;
+import javax.ejb.Stateful;
+import javax.ejb.Stateless;
+
+import org.jboss.webbeans.ejb.spi.EJBModule;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+
+/**
+ * @author pmuir
+ *
+ */
+public class MockEjbModule extends MockBeanDeploymentArchive implements EJBModule
+{
+
+ private List<EjbDescriptor<?>> ejbs;
+
+ @Override
+ public void setBeanClasses(Iterable<Class<?>> webBeanClasses)
+ {
+ super.setBeanClasses(webBeanClasses);
+ ejbs = new ArrayList<EjbDescriptor<?>>();
+ for (Class<?> ejbClass : discoverEjbs(getBeanClasses()))
+ {
+ ejbs.add(MockEjbDescriptor.of(ejbClass));
+ }
+ }
+
+ public Iterable<EjbDescriptor<?>> getEjbs()
+ {
+ return ejbs;
+ }
+
+ protected static Iterable<Class<?>> discoverEjbs(Iterable<Class<?>> webBeanClasses)
+ {
+ Set<Class<?>> ejbs = new HashSet<Class<?>>();
+ for (Class<?> clazz : webBeanClasses)
+ {
+ if (clazz.isAnnotationPresent(Stateless.class) || clazz.isAnnotationPresent(Stateful.class) || clazz.isAnnotationPresent(MessageDriven.class) || clazz.isAnnotationPresent(Singleton.class))
+ {
+ ejbs.add(clazz);
+ }
+ }
+ return ejbs;
+ }
+
+}
Property changes on: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockJpaServices.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -12,17 +12,18 @@
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
import org.jboss.webbeans.persistence.spi.JpaServices;
public class MockJpaServices implements JpaServices
{
- private final WebBeanDiscovery webBeanDiscovery;
+ private final Deployment deployment;
- public MockJpaServices(WebBeanDiscovery webBeanDiscovery)
+ public MockJpaServices(Deployment deployment)
{
- this.webBeanDiscovery = webBeanDiscovery;
+ this.deployment = deployment;
}
public EntityManager resolvePersistenceContext(InjectionPoint injectionPoint)
@@ -43,14 +44,26 @@
public Collection<Class<?>> discoverEntities()
{
Set<Class<?>> classes = new HashSet<Class<?>>();
- for (Class<?> clazz : webBeanDiscovery.discoverWebBeanClasses())
+ for (BeanDeploymentArchive archive : deployment.getBeanDeploymentArchives())
{
+ discoverEntities(archive, classes);
+ }
+ return classes;
+ }
+
+ private void discoverEntities(BeanDeploymentArchive archive, Set<Class<?>> classes)
+ {
+ for (Class<?> clazz : archive.getBeanClasses())
+ {
if (clazz.isAnnotationPresent(Entity.class))
{
classes.add(clazz);
}
}
- return classes;
+ for (BeanDeploymentArchive child : archive.getBeanDeploymentArchives())
+ {
+ discoverEntities(child, classes);
+ }
}
}
\ No newline at end of file
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockServletLifecycle.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -2,7 +2,7 @@
import org.jboss.webbeans.bootstrap.WebBeansBootstrap;
import org.jboss.webbeans.bootstrap.api.Environments;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
import org.jboss.webbeans.context.ContextLifecycle;
import org.jboss.webbeans.context.api.BeanStore;
import org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore;
@@ -13,22 +13,22 @@
private static final ResourceLoader MOCK_RESOURCE_LOADER = new MockResourceLoader();
private final WebBeansBootstrap bootstrap;
- private final MockWebBeanDiscovery webBeanDiscovery;
+ private final MockDeployment deployment;
private final BeanStore applicationBeanStore = new ConcurrentHashMapBeanStore();
private final BeanStore sessionBeanStore = new ConcurrentHashMapBeanStore();
private final BeanStore requestBeanStore = new ConcurrentHashMapBeanStore();
public MockServletLifecycle()
{
- this.webBeanDiscovery = new MockWebBeanDiscovery();
- if (webBeanDiscovery == null)
+ this.deployment = new MockDeployment();
+ if (deployment == null)
{
throw new IllegalStateException("No WebBeanDiscovery is available");
}
bootstrap = new WebBeansBootstrap();
bootstrap.setEnvironment(Environments.SERVLET);
bootstrap.getServices().add(ResourceLoader.class, MOCK_RESOURCE_LOADER);
- bootstrap.getServices().add(WebBeanDiscovery.class, webBeanDiscovery);
+ bootstrap.getServices().add(Deployment.class, deployment);
bootstrap.setApplicationContext(applicationBeanStore);
}
@@ -37,9 +37,9 @@
bootstrap.initialize();
}
- public MockWebBeanDiscovery getWebBeanDiscovery()
+ public MockDeployment getDeployment()
{
- return webBeanDiscovery;
+ return deployment;
}
public WebBeansBootstrap getBootstrap()
Deleted: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockWebBeanDiscovery.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.mock;
-
-import java.net.URL;
-import java.util.HashSet;
-
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
-
-public class MockWebBeanDiscovery implements WebBeanDiscovery
-{
-
- private Iterable<Class<?>> webBeanClasses = new HashSet<Class<?>>();
-
- private Iterable<URL> webBeansXmlFiles = new HashSet<URL>();
-
- public Iterable<Class<?>> discoverWebBeanClasses()
- {
- return webBeanClasses;
- }
-
- public Iterable<URL> discoverWebBeansXml()
- {
- return webBeansXmlFiles;
- }
-
- public void setWebBeanClasses(Iterable<Class<?>> webBeanClasses)
- {
- this.webBeanClasses = webBeanClasses;
- }
-
- public void setWebBeansXmlFiles(Iterable<URL> webBeansXmlFiles)
- {
- this.webBeansXmlFiles = webBeansXmlFiles;
- }
-
-}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -4,8 +4,8 @@
import org.jboss.testharness.api.DeploymentException;
import org.jboss.testharness.spi.StandaloneContainers;
+import org.jboss.webbeans.mock.MockBeanDeploymentArchive;
import org.jboss.webbeans.mock.MockServletLifecycle;
-import org.jboss.webbeans.mock.MockWebBeanDiscovery;
public abstract class AbstractStandaloneContainersImpl implements StandaloneContainers
{
@@ -20,11 +20,11 @@
lifecycle.initialize();
try
{
- MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
- discovery.setWebBeanClasses(classes);
+ MockBeanDeploymentArchive archive = lifecycle.getDeployment().getEjbModule();
+ archive.setBeanClasses(classes);
if (beansXml != null)
{
- discovery.setWebBeansXmlFiles(beansXml);
+ archive.setWebBeansXmlFiles(beansXml);
}
lifecycle.beginApplication();
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/DiscoverFailsBootstrapTest.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -1,6 +1,6 @@
package org.jboss.webbeans.test.unit.bootstrap;
-import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
import org.jboss.webbeans.mock.MockEELifecycle;
import org.testng.annotations.Test;
@@ -11,7 +11,7 @@
public void testDiscoverFails()
{
MockEELifecycle lifecycle = new MockEELifecycle();
- lifecycle.getBootstrap().getServices().add(WebBeanDiscovery.class, null);
+ lifecycle.getBootstrap().getServices().add(Deployment.class, null);
lifecycle.initialize();
lifecycle.beginApplication();
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java 2009-06-30 18:26:45 UTC (rev 2935)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java 2009-06-30 18:27:59 UTC (rev 2936)
@@ -12,8 +12,8 @@
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.mock.MockBeanDeploymentArchive;
import org.jboss.webbeans.mock.MockServletLifecycle;
-import org.jboss.webbeans.mock.MockWebBeanDiscovery;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@@ -29,8 +29,8 @@
{
lifecycle = new MockServletLifecycle();
lifecycle.initialize();
- MockWebBeanDiscovery discovery = lifecycle.getWebBeanDiscovery();
- discovery.setWebBeanClasses(Arrays.asList(Animal.class, DeadlyAnimal.class, DeadlySpider.class, DeadlyAnimal.class, Hound.class, HoundLocal.class, Salmon.class, ScottishFish.class, SeaBass.class, Sole.class, Spider.class, Tarantula.class, TarantulaProducer.class, Tuna.class));
+ MockBeanDeploymentArchive archive = lifecycle.getDeployment().getEjbModule();
+ archive.setBeanClasses(Arrays.asList(Animal.class, DeadlyAnimal.class, DeadlySpider.class, DeadlyAnimal.class, Hound.class, HoundLocal.class, Salmon.class, ScottishFish.class, SeaBass.class, Sole.class, Spider.class, Tarantula.class, TarantulaProducer.class, Tuna.class));
lifecycle.beginApplication();
lifecycle.beginSession();
lifecycle.beginRequest();
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2935 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken: singletonWithSessionScope and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-30 14:26:45 -0400 (Tue, 30 Jun 2009)
New Revision: 2935
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java
Log:
switch to using Deployment
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java 2009-06-30 06:25:22 UTC (rev 2934)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithRequestScope/SingletonWithRequestScopeTest.java 2009-06-30 18:26:45 UTC (rev 2935)
@@ -21,7 +21,7 @@
{
- @Test(groups = { "enterpriseBeans" })
+ @Test(groups = { "incontainer-broken" })
@SpecAssertion(section = "3.3", id = "da")
public void testSingletonWithRequestScopeFails()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java 2009-06-30 06:25:22 UTC (rev 2934)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/broken/singletonWithSessionScope/SingletonWithSessionScopeTest.java 2009-06-30 18:26:45 UTC (rev 2935)
@@ -20,7 +20,7 @@
public class SingletonWithSessionScopeTest extends AbstractJSR299Test
{
- @Test(groups = { "enterpriseBeans" })
+ @Test(groups = { "incontainer-broken" })
@SpecAssertion(section = "3.3", id = "da")
public void testSingletonWithSessionScopeFails()
{
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2934 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: bean and 8 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-06-30 02:25:22 -0400 (Tue, 30 Jun 2009)
New Revision: 2934
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/InconsistentSpecializationException.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/NullableDependencyException.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/UnserializableDependencyException.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingDecorator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SerializableBeanInstance.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeforeBeanDiscoveryImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELResolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/FacesUrlTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/dom/NodeListIterable.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/dom/NodeListIterator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/BeansXmlParser.java
Log:
Minor. Some missing (C) blocks / WS
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/InconsistentSpecializationException.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/InconsistentSpecializationException.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/InconsistentSpecializationException.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -14,8 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-
package org.jboss.webbeans;
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/NullableDependencyException.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/NullableDependencyException.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/NullableDependencyException.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -14,8 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-
package org.jboss.webbeans;
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/UnserializableDependencyException.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/UnserializableDependencyException.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/UnserializableDependencyException.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -14,8 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
-
package org.jboss.webbeans;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.bean;
import java.io.Serializable;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingDecorator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingDecorator.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingDecorator.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.bean;
import java.lang.annotation.Annotation;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SerializableBeanInstance.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SerializableBeanInstance.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SerializableBeanInstance.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.bean;
import java.io.Serializable;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.bootstrap;
import java.util.ArrayList;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterDeploymentValidationImpl.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.bootstrap;
import java.util.ArrayList;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeforeBeanDiscoveryImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeforeBeanDiscoveryImpl.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeforeBeanDiscoveryImpl.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.bootstrap;
import java.lang.annotation.Annotation;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/BeanInstanceImpl.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.context;
import javax.enterprise.context.spi.Contextual;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELResolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELResolver.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/ForwardingELResolver.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.el;
import java.util.Iterator;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolver.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.el;
import javax.el.ELResolver;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.injection.resolution;
import java.lang.annotation.Annotation;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.injection.resolution;
import java.lang.annotation.Annotation;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.injection.resolution;
import java.lang.annotation.Annotation;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableTransformer.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableTransformer.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -16,8 +16,6 @@
*/
package org.jboss.webbeans.injection.resolution;
-
-
public interface ResolvableTransformer
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -16,9 +16,6 @@
*/
package org.jboss.webbeans.introspector;
-
-
-
/**
* AnnotatedParameter provides a uniform access to a method parameter defined
* either in Java or XML
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -16,8 +16,6 @@
*/
package org.jboss.webbeans.introspector;
-
-
/**
* AnnotatedType provides a uniform access to a type defined either in Java or
* XML
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/ConversationAwareViewHandler.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.jsf;
import javax.enterprise.context.Conversation;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/FacesUrlTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/FacesUrlTransformer.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/jsf/FacesUrlTransformer.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.jsf;
import javax.enterprise.inject.AnnotationLiteral;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/dom/NodeListIterable.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/dom/NodeListIterable.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/dom/NodeListIterable.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.util.dom;
import java.util.Iterator;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/dom/NodeListIterator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/dom/NodeListIterator.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/dom/NodeListIterator.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.util.dom;
import java.util.Iterator;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/BeansXmlParser.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/BeansXmlParser.java 2009-06-30 06:02:44 UTC (rev 2933)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/BeansXmlParser.java 2009-06-30 06:25:22 UTC (rev 2934)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.jboss.webbeans.xml;
import java.io.IOException;
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2933 - in ri/trunk: porting-package/src/main/java/org/jboss/webbeans/tck and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-06-30 02:02:44 -0400 (Tue, 30 Jun 2009)
New Revision: 2933
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentStorageRequest.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java
Log:
Remove obsolete DependentStorageRequest
Remove removal method from BeanStore and dependencies to that
Change tests to use creation contexts
Fix some broken tests
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java 2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractContext.java 2009-06-30 06:02:44 UTC (rev 2933)
@@ -19,7 +19,6 @@
import java.lang.annotation.Annotation;
import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.Contextual;
/**
* Common Context operation
@@ -94,7 +93,5 @@
{
return active.get();
}
-
- public abstract <T> void destroyAndRemove(Contextual<T> contextual, T instance);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/AbstractMapContext.java 2009-06-30 06:02:44 UTC (rev 2933)
@@ -120,18 +120,6 @@
{
return get(contextual, null);
}
-
- /**
- * Destroys and removes bean
- *
- * @param <T> The type of the bean
- * @param contextual The contextual type to destroy
- */
- public <T> void destroyAndRemove(Contextual<T> contextual, T instance)
- {
- destroy(contextual);
- getBeanStore().remove(contextual);
- }
private <T> void destroy(Contextual<T> contextual)
{
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentStorageRequest.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentStorageRequest.java 2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/context/DependentStorageRequest.java 2009-06-30 06:02:44 UTC (rev 2933)
@@ -1,97 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.context;
-
-/**
- * A dependent instance store and storage key combination for selecting the correct receiving
- * store and holding key for dependent instances in the dependent context
- *
- * @author Nicklas Karlsson
- */
-public class DependentStorageRequest
-{
- // The dependent instances store to target
- private final DependentInstancesStore dependentInstancesStore;
- // The key in the store
- private final Object key;
-
- /**
- * Create a new DependentStoreKey
- *
- * @param dependentInstancesStore The dependent instances store
- * @param key The storage key
- */
- protected DependentStorageRequest(DependentInstancesStore dependentInstancesStore, Object key)
- {
- this.dependentInstancesStore = dependentInstancesStore;
- this.key = key;
- }
-
- /**
- * Static factory method
- *
- * @param scopeType The scope type of the dependent instances store
- * @param key The storage key
- * @return A new DependentStoreKey
- */
- public static DependentStorageRequest of(DependentInstancesStore dependentInstancesStore, Object key)
- {
- return new DependentStorageRequest(dependentInstancesStore, key);
- }
-
- /**
- * Gets the store
- *
- * @return The store
- */
- public DependentInstancesStore getDependentInstancesStore()
- {
- return dependentInstancesStore;
- }
-
- /**
- * Gets the key
- *
- * @return The key
- */
- public Object getKey()
- {
- return key;
- }
-
- @Override
- public boolean equals(Object other)
- {
- if (other instanceof DependentStorageRequest)
- {
- DependentStorageRequest that = (DependentStorageRequest) other;
- if (this.getDependentInstancesStore().equals(that.getDependentInstancesStore()) && this.getKey().equals(that.getKey()))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- return false;
- }
- }
-
-}
Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java 2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java 2009-06-30 06:02:44 UTC (rev 2933)
@@ -1,11 +1,9 @@
package org.jboss.webbeans.tck;
-import javax.enterprise.context.spi.Context;
import javax.enterprise.inject.spi.Bean;
import org.jboss.jsr299.tck.spi.Beans;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.context.AbstractContext;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.ejb.spi.EjbServices;
import org.jboss.webbeans.util.Proxies;
@@ -86,19 +84,4 @@
return (T) CurrentManager.rootManager().getCurrent().getReference(bean, Object.class, CurrentManager.rootManager().getCurrent().createCreationalContext(bean));
}
- public <T> void destroyAndRemoveBeanInstance(Bean<T> bean, T instance)
- {
- Context context = CurrentManager.rootManager().getCurrent().getContext(bean.getScopeType());
- if (context instanceof AbstractContext)
- {
- ((AbstractContext) context).destroyAndRemove(bean, instance);
- }
- else
- {
- throw new IllegalStateException("Don't know how to destroy a bean from " + context);
- }
- }
-
-
-
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java 2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/BeanStore.java 2009-06-30 06:02:44 UTC (rev 2933)
@@ -38,14 +38,6 @@
public abstract <T> BeanInstance<T> get(Contextual<? extends T> bean);
/**
- * Removes an instance of a bean from the storage
- *
- * @param bean The bean whose instance to remove
- * @return The removed instance. Null if not found in storage.
- */
- public abstract <T extends Object> T remove(Contextual<? extends T> bean);
-
- /**
* Clears the storage of any bean instances
*/
public abstract void clear();
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java 2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/AbstractMapBackedBeanStore.java 2009-06-30 06:02:44 UTC (rev 2933)
@@ -34,21 +34,6 @@
}
/**
- * Removed a instance from the store
- *
- * @param bean the bean to remove
- * @return The instance removed
- *
- * @see org.jboss.webbeans.context.api.BeanStore#remove(BaseBean)
- */
- public <T extends Object> T remove(Contextual<? extends T> bean)
- {
- @SuppressWarnings("unchecked")
- T instance = (T) delegate().remove(bean);
- return instance;
- }
-
- /**
* Clears the store
*
* @see org.jboss.webbeans.context.api.BeanStore#clear()
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java 2009-06-30 06:02:12 UTC (rev 2932)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/context/api/helpers/ForwardingBeanStore.java 2009-06-30 06:02:44 UTC (rev 2933)
@@ -29,11 +29,6 @@
{
delegate().put(beanInstance);
}
-
- public <T> T remove(Contextual<? extends T> bean)
- {
- return delegate().remove(bean);
- }
@Override
public String toString()
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2932 - in tck/trunk: impl/src/main/java/org/jboss/jsr299/tck and 14 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-06-30 02:02:12 -0400 (Tue, 30 Jun 2009)
New Revision: 2932
Modified:
tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java
Log:
Remove obsolete DependentStorageRequest
Remove removal method from BeanStore and dependencies to that
Change tests to use creation contexts
Fix some broken tests
Modified: tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java
===================================================================
--- tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/api/src/main/java/org/jboss/jsr299/tck/spi/Beans.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -72,9 +72,4 @@
*/
public <T> T getEnterpriseBean(Class<? extends T> beanType, Class<T> localInterface);
- @Deprecated
- public <T> void destroyAndRemoveBeanInstance(Bean<T> bean, T instance);
-
- public <T> T createBeanInstance(Bean<T> bean);
-
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -19,6 +19,7 @@
import org.jboss.jsr299.tck.api.JSR299Configuration;
import org.jboss.jsr299.tck.impl.JSR299ConfigurationImpl;
import org.jboss.jsr299.tck.impl.OldSPIBridge;
+import org.jboss.testharness.api.DeploymentException;
public abstract class AbstractJSR299Test extends org.jboss.testharness.AbstractTest
{
@@ -170,43 +171,16 @@
return OldSPIBridge.getInstanceByName(getCurrentManager(), name);
}
- /**
- * Create a bean instance. This method abstracts the TCK
- * from having to manage the CreationalContext
- *
- * @param <T> the bean type
- * @param bean the bean
- * @return the created bean instance
- */
- public <T> T createBeanInstance(Bean<T> bean)
- {
- return getCurrentConfiguration().getBeans().createBeanInstance(bean);
- }
-
- /**
- * Destroy a bean instance. This method abstracts the TCK
- * from having to manage the CreationalContext
- *
- * @param <T> the bean type
- * @param bean the bean
- * @param instance the instance to destroy
- */
- @Deprecated
- public <T> void destroyAndRemoveBeanInstance(Bean<T> bean, T instance)
- {
- getCurrentConfiguration().getBeans().destroyAndRemoveBeanInstance(bean, instance);
- }
-
@Override
- protected org.jboss.testharness.api.DeploymentException handleDeploymentFailure(org.jboss.testharness.api.DeploymentException deploymentException)
+ protected DeploymentException handleDeploymentFailure(DeploymentException deploymentException)
{
if (getCurrentConfiguration().getManagers().isDefinitionError(deploymentException))
{
- return new org.jboss.testharness.api.DeploymentException(deploymentException, new DefinitionError(deploymentException.getCause()));
+ return new DeploymentException(deploymentException, new DefinitionError(deploymentException.getCause()));
}
else if (getCurrentConfiguration().getManagers().isDeploymentError(deploymentException))
{
- return new org.jboss.testharness.api.DeploymentException(deploymentException, new DeploymentError(deploymentException.getCause()));
+ return new DeploymentException(deploymentException, new DeploymentError(deploymentException.getCause()));
}
else
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/DestroyedInstanceReturnedByGetTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -2,6 +2,7 @@
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.SessionScoped;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -22,7 +23,8 @@
public void testDestroyedInstanceMustNotBeReturnedByGet()
{
Bean<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
- MySessionBean beanInstance = createBeanInstance(mySessionBean);
+ CreationalContext<MySessionBean> sessionCreationalContext = getCurrentManager().createCreationalContext(mySessionBean);
+ MySessionBean beanInstance = mySessionBean.create(sessionCreationalContext);
assert beanInstance != null;
destroyContext(getCurrentManager().getContext(SessionScoped.class));
setContextActive(getCurrentManager().getContext(SessionScoped.class));
@@ -30,7 +32,9 @@
assert beanInstance == null;
Bean<MyApplicationBean> myApplicationBean = getBeans(MyApplicationBean.class).iterator().next();
- MyApplicationBean myApplicationBeanInstance = createBeanInstance(myApplicationBean);
+ CreationalContext<MyApplicationBean> applicationCreationalContext = getCurrentManager().createCreationalContext(myApplicationBean);
+
+ MyApplicationBean myApplicationBeanInstance = myApplicationBean.create(applicationCreationalContext);
assert myApplicationBeanInstance != null;
destroyContext(getCurrentManager().getContext(ApplicationScoped.class));
setContextActive(getCurrentManager().getContext(ApplicationScoped.class));
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/NormalContextTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -9,6 +9,7 @@
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.jsr299.tck.impl.MockCreationalContext;
+import org.jboss.jsr299.tck.tests.context.dependent.ejb.FoxRunLocal;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -33,11 +34,11 @@
public void testGetReturnsExistingInstance()
{
Bean<MySessionBean> mySessionBean = getBeans(MySessionBean.class).iterator().next();
- MySessionBean beanInstance = createBeanInstance(mySessionBean);
- beanInstance.setId(10);
- assert beanInstance != null;
- MySessionBean beanInstanceFromGet = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean);
- assert beanInstanceFromGet.getId() == 10;
+ CreationalContext<MySessionBean> creationalContext = getCurrentManager().createCreationalContext(mySessionBean);
+ MySessionBean first = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean, creationalContext);
+ first.setId(10);
+ MySessionBean second = getCurrentManager().getContext(SessionScoped.class).get(mySessionBean, creationalContext);
+ assert second.getId() == 10;
}
@Test(groups = { "contexts" })
@@ -83,7 +84,8 @@
getCurrentManager().addBean(bean);
Context sessionContext = getCurrentManager().getContext(SessionScoped.class);
- MySessionBean instance = createBeanInstance(bean);
+ CreationalContext<MySessionBean> creationalContext = getCurrentManager().createCreationalContext(bean);
+ MySessionBean instance = sessionContext.get(bean, creationalContext);
instance.ping();
assert instance != null;
assert bean.isCreateCalled();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -37,7 +37,8 @@
Set<Bean<FoxRun>> foxRunBeans = getBeans(FoxRun.class);
assert foxRunBeans.size() == 1;
Bean<FoxRun> foxRunBean = foxRunBeans.iterator().next();
- FoxRun foxRun = createBeanInstance(foxRunBean);
+ CreationalContext<FoxRun> creationalContext = getCurrentManager().createCreationalContext(foxRunBean);
+ FoxRun foxRun = foxRunBean.create(creationalContext);
assert !foxRun.fox.equals(foxRun.anotherFox);
}
@@ -65,8 +66,10 @@
public void testInstanceUsedForProducerMethodNotShared() throws Exception
{
Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = createBeanInstance(tarantulaBean);
- Tarantula tarantula2 = createBeanInstance(tarantulaBean);
+
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
+ Tarantula tarantula = tarantulaBean.create(creationalContext);
+ Tarantula tarantula2 = tarantulaBean.create(creationalContext);
assert tarantula != null;
assert tarantula2 != null;
assert tarantula != tarantula2;
@@ -77,8 +80,9 @@
public void testInstanceUsedForProducerFieldNotShared() throws Exception
{
Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class, TAME_LITERAL).iterator().next();
- Tarantula tarantula = createBeanInstance(tarantulaBean);
- Tarantula tarantula2 = createBeanInstance(tarantulaBean);
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
+ Tarantula tarantula = tarantulaBean.create(creationalContext);
+ Tarantula tarantula2 = tarantulaBean.create(creationalContext);
assert tarantula != null;
assert tarantula2 != null;
assert tarantula != tarantula2;
@@ -96,9 +100,10 @@
{
SpiderProducer spiderProducer = getInstanceByType(SpiderProducer.class);
Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = createBeanInstance(tarantulaBean);
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
+ Tarantula tarantula = tarantulaBean.create(creationalContext);
assert tarantula != null;
- destroyAndRemoveBeanInstance(tarantulaBean, tarantula);
+ tarantulaBean.destroy(tarantula, creationalContext);
assert SpiderProducer.getInstanceUsedForDisposal() != null;
assert SpiderProducer.getInstanceUsedForDisposal() != spiderProducer;
}
@@ -185,7 +190,8 @@
public void testContextIsActiveWhenInvokingProducerMethod()
{
Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = createBeanInstance(tarantulaBean);
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
+ Tarantula tarantula = tarantulaBean.create(creationalContext);
assert tarantula != null;
assert SpiderProducer.isDependentContextActive();
}
@@ -207,10 +213,11 @@
public void testContextIsActiveWhenInvokingDisposalMethod()
{
Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = createBeanInstance(tarantulaBean);
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
+ Tarantula tarantula = tarantulaBean.create(creationalContext);
assert tarantula != null;
SpiderProducer.setDependentContextActive(false);
- destroyAndRemoveBeanInstance(tarantulaBean, tarantula);
+ tarantulaBean.destroy(tarantula, creationalContext);
assert SpiderProducer.isDependentContextActive();
}
@@ -401,14 +408,14 @@
protected void execute() throws Exception
{
Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
-
- Tarantula tarantula = createBeanInstance(tarantulaBean);
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
+ Tarantula tarantula = tarantulaBean.create(creationalContext);
assert tarantula != null;
// Reset test class state
SpiderProducer.setDestroyed(false);
- destroyAndRemoveBeanInstance(tarantulaBean, tarantula);
+ tarantulaBean.destroy(tarantula, creationalContext);
assert SpiderProducer.isDestroyed();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ejb/DependentContextEjbTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -17,6 +17,7 @@
package org.jboss.jsr299.tck.tests.context.dependent.ejb;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -41,7 +42,8 @@
public void testContextIsActiveDuringEJBDependencyInjection()
{
Bean<FoxRunLocal> foxRunBean = getBeans(FoxRunLocal.class).iterator().next();
- FoxRunLocal foxRun = createBeanInstance(foxRunBean);
+ CreationalContext<FoxRunLocal> creationalContext = getCurrentManager().createCreationalContext(foxRunBean);
+ FoxRunLocal foxRun = foxRunBean.create(creationalContext);
assert foxRun.getFox() != null;
}
@@ -66,10 +68,11 @@
{
assert getBeans(HouseLocal.class).size() == 1;
Bean<HouseLocal> bean = getBeans(HouseLocal.class).iterator().next();
- HouseLocal instance = createBeanInstance(bean);
+ CreationalContext<HouseLocal> creationalContext = getCurrentManager().createCreationalContext(bean);
+ HouseLocal instance = bean.create(creationalContext);
Room.destroyed = false;
Table.destroyed = false;
- destroyAndRemoveBeanInstance(bean, instance);
+ bean.destroy(instance, creationalContext);
assert Room.destroyed;
assert Table.destroyed;
}
@@ -89,10 +92,11 @@
{
assert getBeans(FarmLocal.class).size() == 1;
Bean<FarmLocal> farmBean = getBeans(FarmLocal.class).iterator().next();
- FarmLocal farm = createBeanInstance(farmBean);
+ CreationalContext<FarmLocal> creationalContext = getCurrentManager().createCreationalContext(farmBean);
+ FarmLocal farm = farmBean.create(creationalContext);
Horse.destroyed = false;
Stable.destroyed = false;
- destroyAndRemoveBeanInstance(farmBean, farm);
+ farmBean.destroy(farm, creationalContext);
assert Horse.destroyed;
assert Stable.destroyed;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/binding/BindingDefinitionTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -6,6 +6,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
+import org.apache.commons.httpclient.methods.GetMethod;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -83,7 +84,8 @@
@SpecAssertion(section = "2.3.5", id = "a")
public void testFieldInjectedFromProducerMethod() throws Exception
{
- Barn barn = createBeanInstance(getBeans(Barn.class).iterator().next());
+ Bean<Barn> barnBean = getBeans(Barn.class).iterator().next();
+ Barn barn = barnBean.create(getCurrentManager().createCreationalContext(barnBean));
assert barn.petSpider != null;
assert barn.petSpider instanceof DefangedTarantula;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/DisposalMethodDefinitionTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -2,6 +2,7 @@
import java.lang.annotation.Annotation;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
@@ -40,8 +41,9 @@
protected void execute() throws Exception
{
Bean<Tarantula> tarantula = getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
- Tarantula instance = createBeanInstance(tarantula);
- destroyAndRemoveBeanInstance(tarantula, instance);
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantula);
+ Tarantula instance = tarantula.create(creationalContext);
+ tarantula.destroy(instance, creationalContext);
}
}.run();
@@ -63,8 +65,9 @@
protected void execute() throws Exception
{
Bean<Tarantula> tarantula = getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantula);
Tarantula instance = getCurrentManager().getContext(tarantula.getScopeType()).get(tarantula);
- destroyAndRemoveBeanInstance(tarantula, instance);
+ tarantula.destroy(instance, creationalContext);
}
}.run();
@@ -90,8 +93,9 @@
protected void execute() throws Exception
{
Bean<Tarantula> tarantula = getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantula);
Tarantula instance = getCurrentManager().getContext(tarantula.getScopeType()).get(tarantula);
- destroyAndRemoveBeanInstance(tarantula, instance);
+ tarantula.destroy(instance, creationalContext);
}
}.run();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -6,6 +6,7 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
@@ -93,9 +94,10 @@
Bean<KleinStadt> stadtBean = getBeans(KleinStadt.class).iterator().next();
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
Context requestContext = getCurrentManager().getContext(RequestScoped.class);
- KleinStadt kassel = createBeanInstance(stadtBean);
+ CreationalContext<KleinStadt> creationalContext = getCurrentManager().createCreationalContext(stadtBean);
+ KleinStadt kassel = stadtBean.create(creationalContext);
kassel.ping();
- destroyAndRemoveBeanInstance(stadtBean, kassel);
+ stadtBean.destroy(kassel, creationalContext);
assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be destroyed";
kassel = requestContext.get(stadtBean);
@@ -127,7 +129,8 @@
{
Bean<NeueStadt> stadtBean = getBeans(NeueStadt.class).iterator().next();
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
- NeueStadt stadtInstance = createBeanInstance(stadtBean);
+ CreationalContext<NeueStadt> creationalContext = getCurrentManager().createCreationalContext(stadtBean);
+ NeueStadt stadtInstance = stadtBean.create(creationalContext);
assert stadtInstance != null : "Expected instance to be created by container";
// Verify that the instance returned is a proxy by checking for all local interfaces
@@ -145,6 +148,19 @@
assert alteStadt.getAnotherPlaceOfInterest() != null;
}
+ @Test(groups = { "enterpriseBeans", "lifecycle", "ri-broken" })
+ @SpecAssertion(section = "6.11", id = "f")
+ public void testDependentObjectsDestroyed()
+ {
+ UniStadt marburg = getInstanceByType(UniStadt.class);
+ assert marburg != null : "Couldn't find the main SFSB";
+ Bean<UniStadt> uniStadtBean = getBeans(UniStadt.class).iterator().next();
+ CreationalContext<UniStadt> creationalContext = getCurrentManager().createCreationalContext(uniStadtBean);
+ uniStadtBean.destroy(marburg, creationalContext);
+ GrossStadt frankfurt = getInstanceByType(GrossStadt.class);
+ assert frankfurt.isSchlossDestroyed();
+ }
+
@Test
@SpecAssertion(section = "4.2", id = "bab")
public void testDirectSubClassInheritsPostConstructOnSuperclass() throws Exception
@@ -191,8 +207,9 @@
protected void execute() throws Exception
{
Bean<DirectOrderProcessorLocal> bean = getBeans(DirectOrderProcessorLocal.class).iterator().next();
+ CreationalContext<DirectOrderProcessorLocal> creationalContext = getCurrentManager().createCreationalContext(bean);
DirectOrderProcessorLocal instance = getInstanceByType(DirectOrderProcessorLocal.class);
- destroyAndRemoveBeanInstance(bean, instance);
+ bean.destroy(instance, creationalContext);
}
}.run();
assert OrderProcessor.preDestroyCalled;
@@ -210,8 +227,9 @@
protected void execute() throws Exception
{
Bean<IndirectOrderProcessor> bean = getBeans(IndirectOrderProcessor.class).iterator().next();
+ CreationalContext<IndirectOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
IndirectOrderProcessor instance = getInstanceByType(IndirectOrderProcessor.class);
- destroyAndRemoveBeanInstance(bean, instance);
+ bean.destroy(instance, creationalContext);
}
}.run();
assert OrderProcessor.preDestroyCalled;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/newBean/NewEnterpriseBeanICTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.newBean;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
@@ -97,8 +98,9 @@
FoxLocal fox = getInstanceByType(FoxLocal.class);
FoxLocal newFox = getInstanceByType(FoxLocal.class,new NewLiteral());
Bean<Litter> litterBean = getBeans(Litter.class).iterator().next();
+ CreationalContext<Litter> creationalContext = getCurrentManager().createCreationalContext(litterBean);
Litter litter = getInstanceByType(Litter.class);
- destroyAndRemoveBeanInstance(litterBean, litter);
+ litterBean.destroy(litter, creationalContext);
assert fox.isLitterDisposed();
assert !newFox.isLitterDisposed();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/definition/ProducerMethodDefinitionTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -3,6 +3,7 @@
import java.lang.annotation.Annotation;
import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.TypeLiteral;
@@ -70,7 +71,8 @@
assert getBeans(String.class).size() == 1;
String aString = getInstanceByType(String.class);
Bean<String> stringBean = getBeans(String.class).iterator().next();
- destroyAndRemoveBeanInstance(stringBean, aString);
+ CreationalContext<String> creationalContext = getCurrentManager().createCreationalContext(stringBean);
+ stringBean.destroy(aString, creationalContext);
assert BeanWithStaticProducerMethod.stringDestroyed;
}
@@ -255,7 +257,8 @@
public void testBindingTypesAppliedToProducerMethodParameters()
{
Bean<Tarantula> tarantula = getBeans(Tarantula.class, DEADLIEST_LITERAL).iterator().next();
- Tarantula instance = createBeanInstance(tarantula);
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantula);
+ Tarantula instance = tarantula.create(creationalContext);
assert instance.getDeathsCaused() == 1;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/lifecycle/ProducerMethodLifecycleTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.producer.method.lifecycle;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.IllegalProductException;
import javax.enterprise.inject.spi.Bean;
@@ -36,7 +37,8 @@
SpiderProducer.setTarantulaDestroyed(false);
Tarantula tarantula = getInstanceByType(Tarantula.class);
Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
- destroyAndRemoveBeanInstance(tarantulaBean, tarantula);
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(tarantulaBean);
+ tarantulaBean.destroy(tarantula, creationalContext);
assert SpiderProducer.isTarantulaDestroyed();
assert SpiderProducer.isDestroyArgumentsSet();
assert !SpiderProducerNotUsed.isTarantulaDestroyed();
@@ -77,7 +79,8 @@
protected void execute() throws Exception
{
Bean<SpiderEgg> eggBean = getBeans(SpiderEgg.class).iterator().next();
- assert createBeanInstance(eggBean) != null;
+ CreationalContext<SpiderEgg> creationalContext = getCurrentManager().createCreationalContext(eggBean);
+ assert eggBean.create(creationalContext) != null;
}
}.run();
@@ -97,7 +100,8 @@
{
Tarantula.setNumberCreated(0);
Bean<Tarantula> spiderBean = getBeans(Tarantula.class).iterator().next();
- Tarantula tarantula = createBeanInstance(spiderBean);
+ CreationalContext<Tarantula> creationalContext = getCurrentManager().createCreationalContext(spiderBean);
+ Tarantula tarantula = spiderBean.create(creationalContext);
assert tarantula.getValue().equals("Pete");
assert Tarantula.getNumberCreated() == 1;
}
@@ -111,7 +115,8 @@
public void testCreateReturnsNullIfProducerDoesAndDependent() throws Exception
{
Bean<Bread> breadBean = getBeans(Bread.class).iterator().next();
- assert createBeanInstance(breadBean) == null;
+ CreationalContext<Bread> creationalContext = getCurrentManager().createCreationalContext(breadBean);
+ assert breadBean.create(creationalContext) == null;
}
@Test(groups = { "producerMethod", "broken" }, expectedExceptions = IllegalProductException.class )
@@ -122,6 +127,7 @@
public void testCreateFailsIfProducerReturnsNullAndNotDependent() throws Exception
{
Bean<PotatoChip> chipBean = getBeans(PotatoChip.class).iterator().next();
- assert createBeanInstance(chipBean) == null;
+ CreationalContext<PotatoChip> creationalContext = getCurrentManager().createCreationalContext(chipBean);
+ assert chipBean.create(creationalContext) == null;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -11,6 +11,7 @@
import javax.enterprise.inject.CreationException;
import javax.enterprise.inject.spi.Bean;
+import org.apache.commons.httpclient.methods.GetMethod;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -152,11 +153,12 @@
{
assert getBeans(Farm.class).size() == 1;
Bean<Farm> farmBean = getBeans(Farm.class).iterator().next();
+ CreationalContext<Farm> creationalContext = getCurrentManager().createCreationalContext(farmBean);
Farm farm = getInstanceByType(Farm.class);
assert farm.founded != null;
assert farm.initialStaff == 20;
assert farm.closed == null;
- destroyAndRemoveBeanInstance(farmBean, farm);
+ farmBean.destroy(farm, creationalContext);
assert farm.closed != null;
}
@@ -183,9 +185,10 @@
public void testContextualDestroyCatchesException()
{
Bean<Cod> codBean = getBeans(Cod.class).iterator().next();
+ CreationalContext<Cod> creationalContext = getCurrentManager().createCreationalContext(codBean);
Cod codInstance = getInstanceByType(Cod.class);
codInstance.ping();
- destroyAndRemoveBeanInstance(codBean, codInstance);
+ codBean.destroy(codInstance, creationalContext);
}
@Test(groups = "beanLifecycle")
@@ -248,8 +251,9 @@
protected void execute() throws Exception
{
Bean<CdOrderProcessor> bean = getBeans(CdOrderProcessor.class).iterator().next();
+ CreationalContext<CdOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
CdOrderProcessor instance = getInstanceByType(CdOrderProcessor.class);
- destroyAndRemoveBeanInstance(bean, instance);
+ bean.destroy(instance, creationalContext);
}
}.run();
assert OrderProcessor.preDestroyCalled;
@@ -267,8 +271,9 @@
protected void execute() throws Exception
{
Bean<IndirectOrderProcessor> bean = getBeans(IndirectOrderProcessor.class).iterator().next();
+ CreationalContext<IndirectOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
IndirectOrderProcessor instance = getInstanceByType(IndirectOrderProcessor.class);
- destroyAndRemoveBeanInstance(bean, instance);
+ bean.destroy(instance, creationalContext);
}
}.run();
assert OrderProcessor.preDestroyCalled;
@@ -303,8 +308,9 @@
protected void execute() throws Exception
{
Bean<NovelOrderProcessor> bean = getBeans(NovelOrderProcessor.class).iterator().next();
+ CreationalContext<NovelOrderProcessor> creationalContext = getCurrentManager().createCreationalContext(bean);
NovelOrderProcessor instance = getInstanceByType(NovelOrderProcessor.class);
- destroyAndRemoveBeanInstance(bean, instance);
+ bean.destroy(instance, creationalContext);
}
}.run();
assert !OrderProcessor.preDestroyCalled;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/newSimpleBean/NewSimpleBeanTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -7,6 +7,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.context.RequestScoped;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.New;
import javax.enterprise.inject.deployment.Standard;
@@ -152,8 +153,9 @@
Fox fox = getInstanceByType(Fox.class);
Fox newFox = getInstanceByType(Fox.class,new NewLiteral());
Bean<Litter> litterBean = getBeans(Litter.class).iterator().next();
+ CreationalContext<Litter> creationalContext = getCurrentManager().createCreationalContext(litterBean);
Litter litter = getInstanceByType(Litter.class);
- destroyAndRemoveBeanInstance(litterBean, litter);
+ litterBean.destroy(litter, creationalContext);
assert fox.isLitterDisposed();
assert !newFox.isLitterDisposed();
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/ejb/EjbInjectionTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -17,6 +17,7 @@
package org.jboss.jsr299.tck.tests.implementation.simple.resource.ejb;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import org.hibernate.tck.annotations.SpecAssertion;
@@ -52,7 +53,8 @@
public void testInjectionOfEjbs()
{
Bean<SimpleBean> simpleBeanBean = getBeans(SimpleBean.class).iterator().next();
- SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
+ CreationalContext<SimpleBean> creationalContext = getCurrentManager().createCreationalContext(simpleBeanBean);
+ SimpleBean simpleBean = simpleBeanBean.create(creationalContext);
assert !simpleBean.isMyEjbExists() : "Ejb was injected too early";
assert simpleBean.getMyEjb() != null : "Ejb was not injected into bean";
assert simpleBean.getMyEjb().hello().equals("hi!");
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/persistenceContext/PersistenceContextInjectionTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.simple.resource.persistenceContext;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
@@ -40,7 +41,8 @@
public void testInjectionOfPersistenceContext()
{
Bean<SimpleBean> simpleBeanBean = getBeans(SimpleBean.class).iterator().next();
- SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
+ CreationalContext<SimpleBean> creationalContext = getCurrentManager().createCreationalContext(simpleBeanBean);
+ SimpleBean simpleBean = simpleBeanBean.create(creationalContext);
EntityManager entityManager = simpleBean.getPersistenceContext();
assert !simpleBean.isPersistenceContextExistsDuringConstruction() : "Persistence context injected too early";
assert entityManager != null : "Persistence context was not injected into bean";
@@ -54,7 +56,8 @@
public void testInjectionOfPersistenceUnit()
{
Bean<SimpleBean> simpleBeanBean = getBeans(SimpleBean.class).iterator().next();
- SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
+ CreationalContext<SimpleBean> creationalContext = getCurrentManager().createCreationalContext(simpleBeanBean);
+ SimpleBean simpleBean = simpleBeanBean.create(creationalContext);
EntityManagerFactory entityManagerFactory = simpleBean.getPersistenceUnit();
assert !simpleBean.isPersistenceUnitExistsDuringConstruction() : "Persistence unit injected too early";
assert entityManagerFactory != null : "Persistence unit was not injected into bean";
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java 2009-06-29 21:42:01 UTC (rev 2931)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/resource/resource/InjectionOfResourceTest.java 2009-06-30 06:02:12 UTC (rev 2932)
@@ -1,5 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.simple.resource.resource;
+import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
@@ -28,7 +29,8 @@
public void testInjectionOfResource()
{
Bean<SimpleBean> simpleBeanBean = getBeans(SimpleBean.class).iterator().next();
- SimpleBean simpleBean = createBeanInstance(simpleBeanBean);
+ CreationalContext<SimpleBean> creationalContext = getCurrentManager().createCreationalContext(simpleBeanBean);
+ SimpleBean simpleBean = simpleBeanBean.create(creationalContext);
BeanManager beanManager = simpleBean.getManager();
assert !simpleBean.isManagerInjected() : "Manager injected too early";
assert beanManager != null : "@Another Manager not found";
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2931 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/context/dependent and 8 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-06-29 17:42:01 -0400 (Mon, 29 Jun 2009)
New Revision: 2931
Added:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/beans.xml
Removed:
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/beans.xml
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ApplicationHorseStable.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HorseStable.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SensitiveFox.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
Log:
Fixed some problems with XML files not being relocated
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java 2009-06-29 17:07:32 UTC (rev 2930)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/application/standalone/TcasDisplay.java 2009-06-29 21:42:01 UTC (rev 2931)
@@ -15,14 +15,7 @@
public void drawTarget(@Observes(notifyObserver = Notify.ASYNCHRONOUSLY) TargetEvent targetEvent)
{
- if (beanManager.getContext(ApplicationScoped.class).isActive())
- {
- applicationScopeActive = true;
- }
- else
- {
- applicationScopeActive = false;
- }
+ applicationScopeActive = beanManager.getContext(ApplicationScoped.class).isActive();
}
public void drawNearMiss(@Observes(notifyObserver = Notify.ASYNCHRONOUSLY) NearMiss event)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ApplicationHorseStable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ApplicationHorseStable.java 2009-06-29 17:07:32 UTC (rev 2930)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/ApplicationHorseStable.java 2009-06-29 21:42:01 UTC (rev 2931)
@@ -15,10 +15,7 @@
public void horseEntered(@Observes HorseInStableEvent horseEvent)
{
- if (beanManager.getContext(Dependent.class).isActive())
- {
- dependentContextActive = true;
- }
+ dependentContextActive = beanManager.getContext(Dependent.class).isActive();
}
public static boolean isDependentContextActive()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-06-29 17:07:32 UTC (rev 2930)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-06-29 21:42:01 UTC (rev 2931)
@@ -167,7 +167,10 @@
}
@Test(groups = { "contexts", "ri-broken" }, expectedExceptions = ContextNotActiveException.class)
- @SpecAssertion(section = "6.4.1", id = "ga")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.2", id = "ha"),
+ @SpecAssertion(section = "6.4.1", id = "ga")
+ })
public void testContextIsInactive()
{
// The RI test harness is broken here, it just enables the dependent context blindly
@@ -175,7 +178,10 @@
}
@Test(groups = { "contexts", "producerMethod" })
- @SpecAssertion(section = "6.4.1", id = "gb")
+ @SpecAssertions({
+ @SpecAssertion(section = "6.2", id = "ha"),
+ @SpecAssertion(section = "6.4.1", id = "gb")
+ })
public void testContextIsActiveWhenInvokingProducerMethod()
{
Bean<Tarantula> tarantulaBean = getBeans(Tarantula.class).iterator().next();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HorseStable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HorseStable.java 2009-06-29 17:07:32 UTC (rev 2930)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/HorseStable.java 2009-06-29 21:42:01 UTC (rev 2931)
@@ -17,10 +17,7 @@
@Initializer
public HorseStable(@Current BeanManager beanManager)
{
- if (beanManager.getContext(Dependent.class).isActive())
- {
- dependentContextActive = true;
- }
+ dependentContextActive = beanManager.getContext(Dependent.class).isActive();
}
public void horseEntered(@Observes HorseInStableEvent horseEvent)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SensitiveFox.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SensitiveFox.java 2009-06-29 17:07:32 UTC (rev 2930)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SensitiveFox.java 2009-06-29 21:42:01 UTC (rev 2931)
@@ -16,10 +16,7 @@
public SensitiveFox()
{
- if (beanManager.getContext(Dependent.class).isActive())
- {
- dependentContextActiveDuringCreate = true;
- }
+ dependentContextActiveDuringCreate = beanManager.getContext(Dependent.class).isActive();
}
public String getName()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java 2009-06-29 17:07:32 UTC (rev 2930)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/SpiderProducer.java 2009-06-29 21:42:01 UTC (rev 2931)
@@ -20,19 +20,13 @@
@Produces public Tarantula produceTarantula()
{
- if (beanManager.getContext(Dependent.class).isActive())
- {
- dependentContextActive = true;
- }
+ dependentContextActive = beanManager.getContext(Dependent.class).isActive();
return new Tarantula();
}
public void disposeTarantula(@Disposes Tarantula tarantula)
{
- if (beanManager.getContext(Dependent.class).isActive())
- {
- dependentContextActive = true;
- }
+ dependentContextActive = beanManager.getContext(Dependent.class).isActive();
instanceUsedForDisposal = this;
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-06-29 17:07:32 UTC (rev 2930)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/lifecycle/SimpleBeanLifecycleTest.java 2009-06-29 21:42:01 UTC (rev 2931)
@@ -79,8 +79,9 @@
@Test(groups = "beanLifecycle")
@SpecAssertions({
- @SpecAssertion(section = "6.1", id = "d"),
- @SpecAssertion(section = "6.1", id = "e")
+ @SpecAssertion(section = "6.1.1", id = "c"),
+ @SpecAssertion(section = "6.1.1", id = "d"),
+ @SpecAssertion(section = "6.1.1", id = "e")
})
public void testCreateReturnsSameBeanPushed() throws Exception
{
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed (from rev 2927, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3)
Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml 2009-06-29 14:10:44 UTC (rev 2927)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/beans.xml 2009-06-29 21:42:01 UTC (rev 2931)
@@ -1,7 +0,0 @@
-<beans>
- <deploy>
- <type>javax.enterprise.inject.deployment.Standard</type>
- <type>javax.enterprise.inject.deployment.Production</type>
- <type>org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken3.AnotherDeploymentType</type>
- </deploy>
-</beans>
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/beans.xml (from rev 2930, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken3/beans.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/initializerUnallowed/beans.xml 2009-06-29 21:42:01 UTC (rev 2931)
@@ -0,0 +1,7 @@
+<beans>
+ <deploy>
+ <type>javax.enterprise.inject.deployment.Standard</type>
+ <type>javax.enterprise.inject.deployment.Production</type>
+ <type>org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken.initializerUnallowed.AnotherDeploymentType</type>
+ </deploy>
+</beans>
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams (from rev 2927, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1)
Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml 2009-06-29 14:10:44 UTC (rev 2927)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/beans.xml 2009-06-29 21:42:01 UTC (rev 2931)
@@ -1,7 +0,0 @@
-<beans>
- <deploy>
- <type>javax.enterprise.inject.deployment.Standard</type>
- <type>javax.enterprise.inject.deployment.Production</type>
- <type>org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken1.AnotherDeploymentType</type>
- </deploy>
-</beans>
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/beans.xml (from rev 2930, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken1/beans.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/multiParams/beans.xml 2009-06-29 21:42:01 UTC (rev 2931)
@@ -0,0 +1,7 @@
+<beans>
+ <deploy>
+ <type>javax.enterprise.inject.deployment.Standard</type>
+ <type>javax.enterprise.inject.deployment.Production</type>
+ <type>org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken.multiParams.AnotherDeploymentType</type>
+ </deploy>
+</beans>
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed (from rev 2927, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4)
Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml 2009-06-29 14:10:44 UTC (rev 2927)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/beans.xml 2009-06-29 21:42:01 UTC (rev 2931)
@@ -1,7 +0,0 @@
-<beans>
- <deploy>
- <type>javax.enterprise.inject.deployment.Standard</type>
- <type>javax.enterprise.inject.deployment.Production</type>
- <type>org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken4.AnotherDeploymentType</type>
- </deploy>
-</beans>
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/beans.xml (from rev 2930, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken4/beans.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/observesUnallowed/beans.xml 2009-06-29 21:42:01 UTC (rev 2931)
@@ -0,0 +1,7 @@
+<beans>
+ <deploy>
+ <type>javax.enterprise.inject.deployment.Standard</type>
+ <type>javax.enterprise.inject.deployment.Production</type>
+ <type>org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken.observesUnallowed.AnotherDeploymentType</type>
+ </deploy>
+</beans>
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed (from rev 2927, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2)
Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml 2009-06-29 14:10:44 UTC (rev 2927)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/beans.xml 2009-06-29 21:42:01 UTC (rev 2931)
@@ -1,7 +0,0 @@
-<beans>
- <deploy>
- <type>javax.enterprise.inject.deployment.Standard</type>
- <type>javax.enterprise.inject.deployment.Production</type>
- <type>org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken2.AnotherDeploymentType</type>
- </deploy>
-</beans>
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/beans.xml (from rev 2930, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken2/beans.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/producesUnallowed/beans.xml 2009-06-29 21:42:01 UTC (rev 2931)
@@ -0,0 +1,7 @@
+<beans>
+ <deploy>
+ <type>javax.enterprise.inject.deployment.Standard</type>
+ <type>javax.enterprise.inject.deployment.Production</type>
+ <type>org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken.producesUnallowed.AnotherDeploymentType</type>
+ </deploy>
+</beans>
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod (from rev 2927, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5)
Deleted: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml 2009-06-29 14:10:44 UTC (rev 2927)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/beans.xml 2009-06-29 21:42:01 UTC (rev 2931)
@@ -1,7 +0,0 @@
-<beans>
- <deploy>
- <type>javax.enterprise.inject.deployment.Standard</type>
- <type>javax.enterprise.inject.deployment.Production</type>
- <type>org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken5.AnotherDeploymentType</type>
- </deploy>
-</beans>
Copied: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/beans.xml (from rev 2930, tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken5/beans.xml)
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/beans.xml (rev 0)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/implementation/disposal/method/definition/broken/unresolvedMethod/beans.xml 2009-06-29 21:42:01 UTC (rev 2931)
@@ -0,0 +1,7 @@
+<beans>
+ <deploy>
+ <type>javax.enterprise.inject.deployment.Standard</type>
+ <type>javax.enterprise.inject.deployment.Production</type>
+ <type>org.jboss.jsr299.tck.tests.implementation.disposal.method.definition.broken.unresolvedMethod.AnotherDeploymentType</type>
+ </deploy>
+</beans>
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2930 - in ri/trunk/spi/src/main/java/org/jboss/webbeans: ejb/spi and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-29 13:07:32 -0400 (Mon, 29 Jun 2009)
New Revision: 2930
Added:
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
Modified:
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java
Log:
Better semantics for BeanDeploymentArchive, add a top level deployment concept
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-06-29 14:26:05 UTC (rev 2929)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-06-29 17:07:32 UTC (rev 2930)
@@ -19,42 +19,47 @@
import java.net.URL;
import java.util.List;
+import org.jboss.webbeans.bootstrap.api.Service;
import org.jboss.webbeans.ejb.spi.EJBModule;
/**
* Represents a CDI bean deployment archive.
*
- * A bean deployment archive is any library jar, EJB jar or rar archive with a
- * META-INF/beans.xml file, any WEB-INF/classes directory in war with a
- * WEB-INF/beans.xml, or any directory in the classpath with a
- * META-INF/beans.xml.
+ * A deployment archive is any library jar, library directory, EJB jar, rar
+ * archive or any war WEB-INF/classes directory contained in the Java EE
+ * deployment (as defined in the Java Platform, Enterprise Edition (Java EE)
+ * Specification, v6, Section 8.1.2).
*
- * For an application deployed as an ear, all library jars, EJB jars, rars and
- * war WEB-INF/classes directories should be searched.
+ * TODO Java SE definition of a deployment archive
*
- * For an application deployed as a war, all library jars and the
- * WEB-INF/classes directory should be searched.
+ * A bean deployment archive is any deployment archive with a META-INF/beans.xml
+ * file, or for a war, with a WEB-INF/beans.xml.
*
- * The container is allowed to specify archives as {@link BeanDeploymentArchive}
- * even if no beans.xml is present.
+ * The container is allowed to specify a deployment archive as
+ * {@link BeanDeploymentArchive} even if no beans.xml is present (for example, a
+ * container could define a deployment archive with container specific metadata
+ * to be a bean deployment archive).
*
* @see EJBModule
+ * @see Deployment
*
* @author Pete Muir
*
*/
-public interface BeanDeploymentArchive
+public interface BeanDeploymentArchive extends Service
{
/**
- * Get the ordered transitive closure of modules which are accessible to this
- * module. The order will be used both in bean discovery and resolution.
+ * Get the ordered bean deployment archives which are accessible to this bean
+ * deployment archive and adjacent to it in the deployment archive graph.
*
+ * The bean deployment archives will be processed in the order specified.
+ *
* Circular dependencies will be detected and ignored by the container
*
- * @return the ordered transitive closure
+ * @return the ordered accessible bean deployment archives
*/
- public List<BeanDeploymentArchive> getBeanDeploymentArchiveClosure();
+ public List<BeanDeploymentArchive> getBeanDeploymentArchives();
/**
* Gets all classes in the bean deployment archive
Added: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java (rev 0)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java 2009-06-29 17:07:32 UTC (rev 2930)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.bootstrap.spi;
+
+import java.util.List;
+
+import org.jboss.webbeans.ejb.spi.EJBModule;
+
+/**
+ * Represents a deployment of a CDI application.
+ *
+ * Web Beans will request the bean archive deployment structure during the bean
+ * discovery initialization step. After this step, CDI allows users to define
+ * bean's programmatically, possibly with bean classes from a deployment archive
+ * which is currently not a bean deployment archive. Web Beans will request the
+ * {@link BeanDeploymentArchive} for each programmatically using
+ * {@link #loadBeanDeploymentArchive(Class)}. If any unknown
+ * {@link BeanDeploymentArchive}s are loaded, before Web Beans proceeds to
+ * validating the deployment, the bean archive deployment structure will
+ * re-requested.
+ *
+ * For an application deployed as an ear to a Java EE container, all library
+ * jars, EJB jars, rars and war WEB-INF/classes directories should be searched,
+ * and the bean deployment archive structure built.
+ *
+ * For an application deployed as a war to a Java EE or Servlet container, all
+ * library jars and the WEB-INF/classes directory should be searched, and the
+ * bean deployment archive structure built.
+ *
+ * TODO Java SE structure
+ *
+ * @see BeanDeploymentArchive
+ * @see EJBModule
+ *
+ * @author Pete Muir
+ *
+ */
+public interface Deployment
+{
+
+ /**
+ * Get the bean deployment archives which are accessible by this deployment
+ * and adjacent to it in the deployment archive graph.
+ *
+ * The bean deployment archives will be processed in the order specified.
+ *
+ * Circular dependencies will be detected and ignored by the container
+ *
+ * @return the ordered accessible bean deployment archives
+ *
+ */
+ public List<BeanDeploymentArchive> getBeanDeploymentArchives();
+
+ /**
+ * Load the {@link BeanDeploymentArchive} containing the given class.
+ *
+ * If the deployment archive containing the given class is not currently a
+ * bean deployment archive, it should be added to the bean deployment archive
+ * graph and returned. If the deployment archive is currently a bean
+ * deployment archive it should be returned.
+ *
+ * @param beanClass the bean class to load
+ * @return the {@link BeanDeploymentArchive} containing the bean class
+ */
+ public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass);
+
+}
Property changes on: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java 2009-06-29 14:26:05 UTC (rev 2929)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java 2009-06-29 17:07:32 UTC (rev 2930)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.ejb.spi;
import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.webbeans.bootstrap.spi.Deployment;
/**
* Represents an EJB bean deployment archive.
@@ -26,6 +27,9 @@
* {@link BeanDeploymentArchive}; the Java EE container is responsible for
* identifying EJB bean deployment archives.
*
+ * @see BeanDeploymentArchive
+ * @see Deployment
+ *
* @author Pete Muir
*
*/
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2929 - in ri/trunk/spi/src/main/java/org/jboss/webbeans: ejb/spi and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-29 10:26:05 -0400 (Mon, 29 Jun 2009)
New Revision: 2929
Modified:
ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java
Log:
Javadoc
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-06-29 14:16:46 UTC (rev 2928)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-06-29 14:26:05 UTC (rev 2929)
@@ -19,6 +19,8 @@
import java.net.URL;
import java.util.List;
+import org.jboss.webbeans.ejb.spi.EJBModule;
+
/**
* Represents a CDI bean deployment archive.
*
@@ -33,8 +35,11 @@
* For an application deployed as a war, all library jars and the
* WEB-INF/classes directory should be searched.
*
- * @see
+ * The container is allowed to specify archives as {@link BeanDeploymentArchive}
+ * even if no beans.xml is present.
*
+ * @see EJBModule
+ *
* @author Pete Muir
*
*/
@@ -54,14 +59,15 @@
/**
* Gets all classes in the bean deployment archive
*
- * @return an iteration over the classes
+ * @return an iteration over the classes, empty if no classes are present
*/
public Iterable<Class<?>> getBeanClasses();
/**
* Get the deployment descriptor
*
- * @return a URL pointing to the deployment descriptor
+ * @return a URL pointing to the deployment descriptor, or null if it is not
+ * present
*/
public URL getBeansXml();
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java 2009-06-29 14:16:46 UTC (rev 2928)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java 2009-06-29 14:26:05 UTC (rev 2929)
@@ -35,7 +35,7 @@
/**
* Get all the EJBs in the deployment archive
*
- * @return
+ * @return an iteration of the EJBs, or empty if no EJBs are present
*/
public Iterable<EjbDescriptor<?>> getEjbs();
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2927 - in ri/trunk: tests/src/main/java/org/jboss/webbeans/mock and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-29 10:10:44 -0400 (Mon, 29 Jun 2009)
New Revision: 2927
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/ForwardingEjbDescriptor.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EjbDescriptorCache.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java
Log:
Add BeanDeploymentArchive SPI
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EjbDescriptorCache.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EjbDescriptorCache.java 2009-06-29 14:09:05 UTC (rev 2926)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/EjbDescriptorCache.java 2009-06-29 14:10:44 UTC (rev 2927)
@@ -31,9 +31,6 @@
*/
public class EjbDescriptorCache
{
-
- // EJB name -> EJB descriptor map
- private Map<String, InternalEjbDescriptor<?>> ejbsByName;
// EJB implementation class -> EJB descriptors map
private Map<Class<?>, Set<InternalEjbDescriptor<?>>> ejbsByBeanClass;
@@ -42,22 +39,10 @@
*/
public EjbDescriptorCache()
{
- this.ejbsByName = new HashMap<String, InternalEjbDescriptor<?>>();
this.ejbsByBeanClass = new HashMap<Class<?>, Set<InternalEjbDescriptor<?>>>();
}
/**
- * Gets the EJB descriptor for a given name
- *
- * @param ejbName The EJB name
- * @return The EJB descriptor
- */
- public InternalEjbDescriptor<?> get(String ejbName)
- {
- return ejbsByName.get(ejbName);
- }
-
- /**
* Gets an iterator to the EJB descriptors for an EJB implementation class
*
* @param beanClass The EJB class
@@ -77,26 +62,14 @@
public <T> void add(EjbDescriptor<T> ejbDescriptor)
{
InternalEjbDescriptor<T> internalEjbDescriptor = new InternalEjbDescriptor<T>(ejbDescriptor);
- ejbsByName.put(ejbDescriptor.getEjbName(), internalEjbDescriptor);
- if (!ejbsByBeanClass.containsKey(ejbDescriptor.getType()))
+ if (!ejbsByBeanClass.containsKey(ejbDescriptor.getBeanClass()))
{
- ejbsByBeanClass.put(ejbDescriptor.getType(), new CopyOnWriteArraySet<InternalEjbDescriptor<?>>());
+ ejbsByBeanClass.put(ejbDescriptor.getBeanClass(), new CopyOnWriteArraySet<InternalEjbDescriptor<?>>());
}
- ejbsByBeanClass.get(ejbDescriptor.getType()).add(internalEjbDescriptor);
+ ejbsByBeanClass.get(ejbDescriptor.getBeanClass()).add(internalEjbDescriptor);
}
/**
- * Indicates if there are EJB descriptors available for an EJB name
- *
- * @param ejbName The EJB name to match
- * @return True if present, otherwise false
- */
- public boolean containsKey(String ejbName)
- {
- return ejbsByName.containsKey(ejbName);
- }
-
- /**
* Indicates if there are EJB descriptors available for an EJB implementation
* class
*
@@ -127,13 +100,12 @@
public void clear()
{
ejbsByBeanClass.clear();
- ejbsByName.clear();
}
@Override
public String toString()
{
- return "EJB Descriptor cache has indexed " + ejbsByBeanClass.size() + " EJBs by class and " + ejbsByName + " by name";
+ return "EJB Descriptor cache has indexed " + ejbsByBeanClass.size() + " EJBs by class";
}
}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/ForwardingEjbDescriptor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/ForwardingEjbDescriptor.java 2009-06-29 14:09:05 UTC (rev 2926)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/ForwardingEjbDescriptor.java 2009-06-29 14:10:44 UTC (rev 2927)
@@ -1,99 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.ejb;
-
-import java.lang.reflect.Method;
-
-import org.jboss.webbeans.ejb.spi.BusinessInterfaceDescriptor;
-import org.jboss.webbeans.ejb.spi.EjbDescriptor;
-
-/**
- * Forwarding helper class for {@link EjbDescriptor} to support the decorator
- * pattern
- *
- * @author Pete Muir
- *
- */
-public abstract class ForwardingEjbDescriptor<T> implements EjbDescriptor<T>
-{
-
- protected abstract EjbDescriptor<T> delegate();
-
- public String getEjbName()
- {
- return delegate().getEjbName();
- }
-
- public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces()
- {
- return delegate().getLocalBusinessInterfaces();
- }
-
- public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces()
- {
- return delegate().getRemoteBusinessInterfaces();
- }
-
- public Iterable<Method> getRemoveMethods()
- {
- return delegate().getRemoveMethods();
- }
-
- public Class<T> getType()
- {
- return delegate().getType();
- }
-
- public boolean isMessageDriven()
- {
- return delegate().isMessageDriven();
- }
-
- public boolean isSingleton()
- {
- return delegate().isSingleton();
- }
-
- public boolean isStateful()
- {
- return delegate().isStateful();
- }
-
- public boolean isStateless()
- {
- return delegate().isStateless();
- }
-
- @Override
- public String toString()
- {
- return delegate().toString();
- }
-
- @Override
- public int hashCode()
- {
- return delegate().hashCode();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- return delegate().equals(obj);
- }
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java 2009-06-29 14:09:05 UTC (rev 2926)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ejb/InternalEjbDescriptor.java 2009-06-29 14:10:44 UTC (rev 2927)
@@ -23,6 +23,7 @@
import org.jboss.webbeans.ejb.spi.BusinessInterfaceDescriptor;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
+import org.jboss.webbeans.ejb.spi.helpers.ForwardingEjbDescriptor;
import org.jboss.webbeans.introspector.MethodSignature;
import org.jboss.webbeans.introspector.jlr.MethodSignatureImpl;
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java 2009-06-29 14:09:05 UTC (rev 2926)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbDescriptor.java 2009-06-29 14:10:44 UTC (rev 2927)
@@ -34,7 +34,7 @@
public class MockEjbDescriptor<T> implements EjbDescriptor<T>
{
- private final Class<T> type;
+ private final Class<T> beanClass;
private final String ejbName;
private final List<BusinessInterfaceDescriptor<?>> localInterfaces;
private final HashSet<Method> removeMethods;
@@ -46,7 +46,7 @@
private MockEjbDescriptor(final Class<T> type)
{
- this.type = type;
+ this.beanClass = type;
this.ejbName = type.getSimpleName();
this.localInterfaces = new ArrayList<BusinessInterfaceDescriptor<?>>();
@@ -121,34 +121,34 @@
return removeMethods;
}
- public Class<T> getType()
+ public Class<T> getBeanClass()
{
- return type;
+ return beanClass;
}
public boolean isMessageDriven()
{
- return type.isAnnotationPresent(MessageDriven.class);
+ return beanClass.isAnnotationPresent(MessageDriven.class);
}
public boolean isSingleton()
{
- return type.isAnnotationPresent(Singleton.class);
+ return beanClass.isAnnotationPresent(Singleton.class);
}
public boolean isStateful()
{
- return type.isAnnotationPresent(Stateful.class);
+ return beanClass.isAnnotationPresent(Stateful.class);
}
public boolean isStateless()
{
- return type.isAnnotationPresent(Stateless.class);
+ return beanClass.isAnnotationPresent(Stateless.class);
}
public String getLocalJndiName()
{
- return type.getSimpleName() + "/local";
+ return beanClass.getSimpleName() + "/local";
}
@Override
@@ -173,7 +173,7 @@
builder.append(" (MDB)");
}
builder.append("remove methods; " + removeMethods + "; ");
- builder.append("; BeanClass: " + getType() + "; Local Business Interfaces: " + getLocalBusinessInterfaces());
+ builder.append("; BeanClass: " + getBeanClass() + "; Local Business Interfaces: " + getLocalBusinessInterfaces());
return builder.toString();
}
@@ -183,7 +183,7 @@
if (other instanceof EjbDescriptor)
{
EjbDescriptor<T> that = (EjbDescriptor<T>) other;
- return this.getEjbName().equals(that.getEjbName());
+ return this.getBeanClass().equals(that.getBeanClass());
}
else
{
15 years, 6 months