[webbeans-commits] Webbeans SVN: r3023 - in ri/trunk: spi/src/main/java/org/jboss/webbeans/bootstrap/spi and 4 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Tue Jul 7 17:51:03 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-07-07 17:51:03 -0400 (Tue, 07 Jul 2009)
New Revision: 3023
Removed:
ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.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/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/test/harness/AbstractStandaloneContainersImpl.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java
Log:
Merge EjbModule -> BeanDeploymentArchive
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-07-07 21:25:05 UTC (rev 3022)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-07-07 21:51:03 UTC (rev 3023)
@@ -23,8 +23,8 @@
import javax.enterprise.inject.spi.BeforeShutdown;
import javax.enterprise.inject.spi.Extension;
-import org.jboss.webbeans.ContextualIdStore;
import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.ContextualIdStore;
import org.jboss.webbeans.CurrentManager;
import org.jboss.webbeans.DefinitionException;
import org.jboss.webbeans.DeploymentException;
@@ -53,7 +53,6 @@
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;
@@ -120,13 +119,9 @@
{
beansXmlUrls.add(url);
}
- if (beanDeploymentArchive instanceof EJBModule)
+ for (EjbDescriptor<?> ejbDescriptor : beanDeploymentArchive.getEjbs())
{
- EJBModule ejbModule = (EJBModule) beanDeploymentArchive;
- for (EjbDescriptor<?> ejbDescriptor : ejbModule.getEjbs())
- {
- ejbDescriptors.add(ejbDescriptor);
- }
+ ejbDescriptors.add(ejbDescriptor);
}
for (BeanDeploymentArchive archive : beanDeploymentArchive.getBeanDeploymentArchives())
{
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-07-07 21:25:05 UTC (rev 3022)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-07-07 21:51:03 UTC (rev 3023)
@@ -19,7 +19,7 @@
import java.net.URL;
import java.util.List;
-import org.jboss.webbeans.ejb.spi.EJBModule;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
/**
* Represents a CDI bean deployment archive.
@@ -39,7 +39,6 @@
* container could define a deployment archive with container specific metadata
* to be a bean deployment archive).
*
- * @see EJBModule
* @see Deployment
*
* @author Pete Muir
@@ -80,4 +79,12 @@
*/
public Iterable<URL> getBeansXml();
+ /**
+ * Get all the EJBs in the deployment archive
+ *
+ * @return an iteration of the EJBs, or empty if no EJBs are present or if
+ * this is not an EJB archive
+ */
+ public Iterable<EjbDescriptor<?>> getEjbs();
+
}
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-07-07 21:25:05 UTC (rev 3022)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java 2009-07-07 21:51:03 UTC (rev 3023)
@@ -19,7 +19,6 @@
import java.util.List;
import org.jboss.webbeans.bootstrap.api.Service;
-import org.jboss.webbeans.ejb.spi.EJBModule;
/**
* Represents a deployment of a CDI application.
@@ -45,7 +44,6 @@
* TODO Java SE structure
*
* @see BeanDeploymentArchive
- * @see EJBModule
*
* @author Pete Muir
*
Deleted: 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-07-07 21:25:05 UTC (rev 3022)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java 2009-07-07 21:51:03 UTC (rev 3023)
@@ -1,46 +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.spi;
-
-import org.jboss.webbeans.bootstrap.spi.BeanDeploymentArchive;
-import org.jboss.webbeans.bootstrap.spi.Deployment;
-
-/**
- * Represents an EJB bean deployment archive.
- *
- * If a bean deployment archive is identified as an EJB bean deployment, an
- * instance of {@link EJBModule} should be returned instead of
- * {@link BeanDeploymentArchive}; the Java EE container is responsible for
- * identifying EJB bean deployment archives.
- *
- * @see BeanDeploymentArchive
- * @see Deployment
- *
- * @author Pete Muir
- *
- */
-public interface EJBModule extends BeanDeploymentArchive
-{
-
- /**
- * Get all the EJBs in the deployment archive
- *
- * @return an iteration of the EJBs, or empty if no EJBs are present
- */
- public Iterable<EjbDescriptor<?>> getEjbs();
-
-}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java 2009-07-07 21:25:05 UTC (rev 3022)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java 2009-07-07 21:51:03 UTC (rev 3023)
@@ -17,11 +17,19 @@
package org.jboss.webbeans.mock;
import java.net.URL;
+import java.util.ArrayList;
import java.util.Collections;
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.BeanDeploymentArchive;
+import org.jboss.webbeans.ejb.spi.EjbDescriptor;
/**
* @author pmuir
@@ -45,11 +53,6 @@
return webBeansXmlFiles;
}
- public void setBeanClasses(Iterable<Class<?>> webBeanClasses)
- {
- this.beanClasses = webBeanClasses;
- }
-
public void setWebBeansXmlFiles(Iterable<URL> webBeansXmlFiles)
{
this.webBeansXmlFiles = webBeansXmlFiles;
@@ -59,5 +62,35 @@
{
return Collections.emptyList();
}
+
+ private List<EjbDescriptor<?>> ejbs;
+ public void setBeanClasses(Iterable<Class<?>> beanClasses)
+ {
+ this.beanClasses = beanClasses;
+ 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;
+ }
+
}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java 2009-07-07 21:25:05 UTC (rev 3022)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java 2009-07-07 21:51:03 UTC (rev 3023)
@@ -25,15 +25,15 @@
public class MockDeployment implements Deployment
{
- private MockEjbModule ejbModule;
+ private MockBeanDeploymentArchive archive;
private List<BeanDeploymentArchive> beanDeploymentArchives;
public MockDeployment()
{
- this.ejbModule = new MockEjbModule();
+ this.archive = new MockBeanDeploymentArchive();
this.beanDeploymentArchives = new ArrayList<BeanDeploymentArchive>();
- this.beanDeploymentArchives.add(ejbModule);
+ this.beanDeploymentArchives.add(archive);
}
public List<BeanDeploymentArchive> getBeanDeploymentArchives()
@@ -43,12 +43,12 @@
public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass)
{
- return ejbModule;
+ return archive;
}
- public MockEjbModule getEjbModule()
+ public MockBeanDeploymentArchive getArchive()
{
- return ejbModule;
+ return archive;
}
}
Deleted: ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java 2009-07-07 21:25:05 UTC (rev 3022)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java 2009-07-07 21:51:03 UTC (rev 3023)
@@ -1,70 +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.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;
- }
-
-}
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-07-07 21:25:05 UTC (rev 3022)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java 2009-07-07 21:51:03 UTC (rev 3023)
@@ -20,7 +20,7 @@
lifecycle.initialize();
try
{
- MockBeanDeploymentArchive archive = lifecycle.getDeployment().getEjbModule();
+ MockBeanDeploymentArchive archive = lifecycle.getDeployment().getArchive();
archive.setBeanClasses(classes);
if (beansXml != null)
{
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-07-07 21:25:05 UTC (rev 3022)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java 2009-07-07 21:51:03 UTC (rev 3023)
@@ -28,7 +28,7 @@
{
lifecycle = new MockServletLifecycle();
lifecycle.initialize();
- MockBeanDeploymentArchive archive = lifecycle.getDeployment().getEjbModule();
+ MockBeanDeploymentArchive archive = lifecycle.getDeployment().getArchive();
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();
More information about the weld-commits
mailing list