[webbeans-commits] Webbeans SVN: r3042 - examples/trunk/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-07-09 14:36:17 -0400 (Thu, 09 Jul 2009)
New Revision: 3042
Modified:
examples/trunk/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java
Log:
Remove obsolete @Obtains from numberguess example
Modified: examples/trunk/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java
===================================================================
--- examples/trunk/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java 2009-07-08 10:08:16 UTC (rev 3041)
+++ examples/trunk/numberguess/src/main/java/org/jboss/webbeans/examples/numberguess/Game.java 2009-07-09 18:36:17 UTC (rev 3042)
@@ -1,6 +1,5 @@
package org.jboss.webbeans.examples.numberguess;
-
import java.io.Serializable;
import javax.annotation.PostConstruct;
@@ -11,7 +10,6 @@
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
-import javax.inject.Obtains;
@Named
@SessionScoped
@@ -28,7 +26,7 @@
private int biggest;
private int remainingGuesses;
- @Obtains @Random Instance<Integer> randomNumber;
+ @Random Instance<Integer> randomNumber;
public Game()
{
14 years, 11 months
[webbeans-commits] Webbeans SVN: r3041 - in ri/branches/1.0.0.PREVIEW2-PATCH2: spi/src/main/java/org/jboss/webbeans/bootstrap/spi and 4 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-08 06:08:16 -0400 (Wed, 08 Jul 2009)
New Revision: 3041
Removed:
ri/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java
ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java
Modified:
ri/branches/1.0.0.PREVIEW2-PATCH2/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
ri/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java
ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java
ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java
Log:
Backport deployment api changes
Modified: ri/branches/1.0.0.PREVIEW2-PATCH2/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/branches/1.0.0.PREVIEW2-PATCH2/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-07-08 09:32:50 UTC (rev 3040)
+++ ri/branches/1.0.0.PREVIEW2-PATCH2/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-07-08 10:08:16 UTC (rev 3041)
@@ -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/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java
===================================================================
--- ri/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-07-08 09:32:50 UTC (rev 3040)
+++ ri/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/BeanDeploymentArchive.java 2009-07-08 10:08:16 UTC (rev 3041)
@@ -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/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java
===================================================================
--- ri/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java 2009-07-08 09:32:50 UTC (rev 3040)
+++ ri/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/bootstrap/spi/Deployment.java 2009-07-08 10:08:16 UTC (rev 3041)
@@ -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/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java
===================================================================
--- ri/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java 2009-07-08 09:32:50 UTC (rev 3040)
+++ ri/branches/1.0.0.PREVIEW2-PATCH2/spi/src/main/java/org/jboss/webbeans/ejb/spi/EJBModule.java 2009-07-08 10:08:16 UTC (rev 3041)
@@ -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/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java
===================================================================
--- ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java 2009-07-08 09:32:50 UTC (rev 3040)
+++ ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockBeanDeploymentArchive.java 2009-07-08 10:08:16 UTC (rev 3041)
@@ -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/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java
===================================================================
--- ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java 2009-07-08 09:32:50 UTC (rev 3040)
+++ ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockDeployment.java 2009-07-08 10:08:16 UTC (rev 3041)
@@ -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/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java
===================================================================
--- ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java 2009-07-08 09:32:50 UTC (rev 3040)
+++ ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/mock/MockEjbModule.java 2009-07-08 10:08:16 UTC (rev 3041)
@@ -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/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java
===================================================================
--- ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java 2009-07-08 09:32:50 UTC (rev 3040)
+++ ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/main/java/org/jboss/webbeans/test/harness/AbstractStandaloneContainersImpl.java 2009-07-08 10:08:16 UTC (rev 3041)
@@ -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/branches/1.0.0.PREVIEW2-PATCH2/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java
===================================================================
--- ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java 2009-07-08 09:32:50 UTC (rev 3040)
+++ ri/branches/1.0.0.PREVIEW2-PATCH2/tests/src/test/java/org/jboss/webbeans/test/unit/environments/servlet/ServletEnvironmentTest.java 2009-07-08 10:08:16 UTC (rev 3041)
@@ -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();
14 years, 11 months
[webbeans-commits] Webbeans SVN: r3040 - /.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-08 05:32:50 -0400 (Wed, 08 Jul 2009)
New Revision: 3040
Removed:
jsr299-api/
webbeans-api/
webbeans-build-aggregator/
webbeans-core-test/
webbeans-core/
webbeans-jboss-tck-runner/
webbeans-logging/
webbeans-osgi-bundle/
webbeans-parent/
webbeans-porting-package/
webbeans-spi/
webbeans-version-matrix/
Log:
bad commits
14 years, 11 months
[webbeans-commits] Webbeans SVN: r3039 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bootstrap and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-07-08 05:31:00 -0400 (Wed, 08 Jul 2009)
New Revision: 3039
Added:
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java
Log:
PFD2 changes for observer methods and events from ch. 11
Added: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java (rev 0)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java 2009-07-08 09:31:00 UTC (rev 3039)
@@ -0,0 +1,52 @@
+/*
+ * 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 javax.enterprise.inject.spi;
+
+/**
+ * The container fires an event of this type for each observer method
+ * that is registered.
+ *
+ * @author Gavin King
+ * @author David Allen
+ *
+ * @param <X> The bean type containing the observer method
+ * @param <T> The type of the event being observed
+ */
+public interface ProcessObserverMethod<X, T>
+{
+ /**
+ * The AnnotatedMethod representing the observer method
+ * @return the AnnotatedMethod representing the observer method
+ */
+ public AnnotatedMethod<X> getAnnotatedMethod();
+
+ /**
+ * The ObserverMethod object that will be used by the container
+ * to invoke the observer when a matching event is fired.
+ * @return the ObserverMethod object that will be used by the container to call the observer method
+ */
+ public ObserverMethod<X, T> getObserverMethod();
+
+ /**
+ * Registers a definition error with the container, causing the container to
+ * abort deployment after bean discovery is complete.
+ *
+ * @param t A throwable representing the definition error
+ */
+ public void addDefinitionError(Throwable t);
+}
Property changes on: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/ProcessObserverMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-07-08 09:28:32 UTC (rev 3038)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java 2009-07-08 09:31:00 UTC (rev 3039)
@@ -60,7 +60,7 @@
public void addObserverMethod(ObserverMethod<?, ?> observerMethod)
{
- throw new UnsupportedOperationException();
+ beanManager.addObserver(observerMethod);
}
}
14 years, 11 months
[webbeans-commits] Webbeans SVN: r3037 - /.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-08 05:28:28 -0400 (Wed, 08 Jul 2009)
New Revision: 3037
Added:
webbeans-version-matrix/
Log:
14 years, 11 months
[webbeans-commits] Webbeans SVN: r3034 - /.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-07-08 05:28:20 -0400 (Wed, 08 Jul 2009)
New Revision: 3034
Added:
webbeans-porting-package/
Log:
14 years, 11 months