[webbeans-commits] Webbeans SVN: r2776 - in ri/trunk/tests/src: test/debug-resources/META-INF and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-08 07:25:31 -0400 (Mon, 08 Jun 2009)
New Revision: 2776
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/BowlerHatException.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Fedora.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/FedoraImpl.java
Modified:
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
Log:
WBRI-275
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-08 10:34:46 UTC (rev 2775)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-08 11:25:31 UTC (rev 2776)
@@ -138,4 +138,17 @@
return manager;
}
+ public boolean isExceptionInHierarchy(Throwable exception, Class<? extends Throwable> expectedException )
+ {
+ while (exception != null)
+ {
+ if (exception.getClass().equals(expectedException))
+ {
+ return true;
+ }
+ exception = exception.getCause();
+ }
+ return false;
+ }
+
}
Modified: ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties
===================================================================
--- ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-06-08 10:34:46 UTC (rev 2775)
+++ ri/trunk/tests/src/test/debug-resources/META-INF/jboss-test-harness.properties 2009-06-08 11:25:31 UTC (rev 2776)
@@ -3,5 +3,5 @@
org.jboss.testharness.standalone=false
org.jboss.testharness.container.extraConfigurationDir=../../webbeans/jboss-as
org.jboss.testharness.container.forceRestart=false
-org.jboss.testharness.libraryDirectory=../../webbeans/impl/target/dependency/lib
+org.jboss.testharness.libraryDirectory=../../webbeans/tests/target/dependency/lib
org.jboss.testharness.runIntegrationTests=true
\ No newline at end of file
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/BowlerHatException.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/BowlerHatException.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/BowlerHatException.java 2009-06-08 11:25:31 UTC (rev 2776)
@@ -0,0 +1,26 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise;
+
+public class BowlerHatException extends RuntimeException
+{
+
+ public BowlerHatException()
+ {
+ super();
+ }
+
+ public BowlerHatException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public BowlerHatException(String message)
+ {
+ super(message);
+ }
+
+ public BowlerHatException(Throwable cause)
+ {
+ super(cause);
+ }
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/BowlerHatException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-06-08 10:34:46 UTC (rev 2775)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/EnterpriseBeanTest.java 2009-06-08 11:25:31 UTC (rev 2776)
@@ -19,6 +19,22 @@
}
+ @Test(description="WBRI-275")
+ public void testSLSBBusinessMethodThrowsRuntimeException()
+ {
+ try
+ {
+ getCurrentManager().getInstanceByType(Fedora.class).causeRuntimeException();
+ }
+ catch (Throwable t)
+ {
+ if (isExceptionInHierarchy(t, BowlerHatException.class))
+ {
+ return;
+ }
+ }
+ assert false : "Expected a BowlerHatException to be in the cause stack";
+ }
}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Fedora.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Fedora.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Fedora.java 2009-06-08 11:25:31 UTC (rev 2776)
@@ -0,0 +1,12 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface Fedora
+{
+
+ public void causeRuntimeException();
+
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/Fedora.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/FedoraImpl.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/FedoraImpl.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/FedoraImpl.java 2009-06-08 11:25:31 UTC (rev 2776)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.unit.implementation.enterprise;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class FedoraImpl implements Fedora
+{
+
+ public void causeRuntimeException()
+ {
+ throw new BowlerHatException();
+ }
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/enterprise/FedoraImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2775 - ri/trunk/api/src/main/java/javax/enterprise/inject/spi.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-08 06:34:46 -0400 (Mon, 08 Jun 2009)
New Revision: 2775
Modified:
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
Log:
minor
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-06-06 21:24:44 UTC (rev 2774)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-06-08 10:34:46 UTC (rev 2775)
@@ -39,6 +39,7 @@
*
* @author Gavin King
* @author Pete Muir
+ * @author Clint Popetz
*
*/
public interface BeanManager
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2774 - in ri/trunk/impl/src/main/java/org/jboss/webbeans: xml/checker/beanchildren/ext and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-06 17:24:44 -0400 (Sat, 06 Jun 2009)
New Revision: 2774
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/ext/AbstractBeanChildrenChecker.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/registrator/bean/ext/ResourceElementRegistrator.java
Log:
remove java6 deps
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-06 15:35:20 UTC (rev 2773)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-06 21:24:44 UTC (rev 2774)
@@ -25,20 +25,15 @@
import java.lang.reflect.WildcardType;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.NavigableMap;
-import java.util.NavigableSet;
import java.util.Set;
-import java.util.SortedMap;
+import java.util.SortedSet;
import java.util.Stack;
-import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -99,7 +94,6 @@
import org.jboss.webbeans.metadata.MetaDataCache;
import org.jboss.webbeans.metadata.StereotypeModel;
import org.jboss.webbeans.util.Beans;
-import org.jboss.webbeans.util.ListComparator;
import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.collections.multi.ConcurrentListHashMultiMap;
@@ -1273,16 +1267,20 @@
return null;
}
- //make a copy so that the sort is stable with respect to new deployment types addded through the SPI
+ // make a copy so that the sort is stable with respect to new deployment types added through the SPI
+ // TODO This code needs to be in Resolver
+ // TODO This needs caching
final List<Class<? extends Annotation>> enabledDeploymentTypes = getEnabledDeploymentTypes();
- NavigableSet<Bean<? extends X>> sortedBeans = new TreeSet<Bean<? extends X>>(new Comparator<Bean<? extends X>>()
- {
+ SortedSet<Bean<? extends X>> sortedBeans = new TreeSet<Bean<? extends X>>(new Comparator<Bean<? extends X>>()
+ {
public int compare(Bean<? extends X> o1, Bean<? extends X> o2)
{
int diff = enabledDeploymentTypes.indexOf(o1) - enabledDeploymentTypes.indexOf(o2);
if (diff == 0)
+ {
throw new AmbiguousResolutionException();
+ }
return diff;
}
});
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/ext/AbstractBeanChildrenChecker.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/ext/AbstractBeanChildrenChecker.java 2009-06-06 15:35:20 UTC (rev 2773)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/beanchildren/ext/AbstractBeanChildrenChecker.java 2009-06-06 21:24:44 UTC (rev 2774)
@@ -38,7 +38,6 @@
import javax.interceptor.InterceptorBindingType;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceUnit;
-import javax.xml.ws.WebServiceRef;
import org.dom4j.Element;
import org.dom4j.Namespace;
@@ -193,11 +192,13 @@
beanChildClass.getRawType().equals(Stereotype.class) || beanChildClass.getRawType().equals(Named.class) ||
beanChildClass.getRawType().equals(Specializes.class) || beanChildClass.getRawType().equals(Realizes.class) ||
beanChildClass.isAnnotationPresent(Resource.class) || beanChildClass.isAnnotationPresent(EJB.class)||
- beanChildClass.isAnnotationPresent(WebServiceRef.class) || beanChildClass.isAnnotationPresent(PersistenceContext.class) ||
+ //beanChildClass.isAnnotationPresent(WebServiceRef.class) ||
+ beanChildClass.isAnnotationPresent(PersistenceContext.class) ||
beanChildClass.isAnnotationPresent(PersistenceUnit.class))
return;
if (beanChildClass.getRawType().equals(Resource.class) || beanChildClass.getRawType().equals(EJB.class) ||
- beanChildClass.getRawType().equals(WebServiceRef.class) || beanChildClass.getRawType().equals(PersistenceContext.class) ||
+ //beanChildClass.getRawType().equals(WebServiceRef.class) ||
+ beanChildClass.getRawType().equals(PersistenceContext.class) ||
beanChildClass.getRawType().equals(PersistenceUnit.class))
{
checkRIBean(beanChildElement.getParent(), beanClass);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/registrator/bean/ext/ResourceElementRegistrator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/registrator/bean/ext/ResourceElementRegistrator.java 2009-06-06 15:35:20 UTC (rev 2773)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/registrator/bean/ext/ResourceElementRegistrator.java 2009-06-06 21:24:44 UTC (rev 2774)
@@ -29,7 +29,6 @@
import javax.enterprise.inject.deployment.DeploymentType;
import javax.persistence.PersistenceContext;
import javax.persistence.PersistenceUnit;
-import javax.xml.ws.WebServiceRef;
import org.dom4j.Element;
import org.jboss.webbeans.bean.RIBean;
@@ -218,7 +217,9 @@
{
Element childElement = (Element) elIterator.next();
AnnotatedClass<?> childClass = ParseXmlHelper.loadElementClass(childElement, Object.class, environment, packagesMap);
- if (childClass.getRawType().isAnnotation() && !childClass.isAnnotationPresent(DeploymentType.class) && !childClass.getRawType().equals(Resource.class) && !childClass.getRawType().equals(PersistenceContext.class) && !childClass.getRawType().equals(PersistenceUnit.class) && !childClass.getRawType().equals(EJB.class) && !childClass.getRawType().equals(WebServiceRef.class))
+ if (childClass.getRawType().isAnnotation() && !childClass.isAnnotationPresent(DeploymentType.class) && !childClass.getRawType().equals(Resource.class) && !childClass.getRawType().equals(PersistenceContext.class) && !childClass.getRawType().equals(PersistenceUnit.class) && !childClass.getRawType().equals(EJB.class)
+ // && !childClass.getRawType().equals(WebServiceRef.class)
+ )
{
Class<?> annotationClass = childClass.getRawType();
Method[] annotationMethods = annotationClass.getDeclaredMethods();
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2773 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: activities/current and 9 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-06-06 11:35:20 -0400 (Sat, 06 Jun 2009)
New Revision: 2773
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToRemoveObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/NonBindingTypesToRemoveObserverTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OwlFinch_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/BlueFacedParrotFinch.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ConsumerNotifiedForEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToAddObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToRemoveObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ManagerAddObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToAddObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ObserverExceptionAbortsTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/DuplicateBindingsToRemoveObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/ManagerRemoveObserverTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksEventTypeWhenResolvingTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksTypeParametersWhenResolvingTest.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/lifecycle/Kassel.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java
Log:
Changed signature of notify() to return boolean for event notification
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -285,9 +285,10 @@
Observer<NightTime> observer = new Observer<NightTime>()
{
- public void notify(NightTime event)
+ public boolean notify(NightTime event)
{
assert false;
+ return false;
}
};
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -72,9 +72,10 @@
boolean observed = false;
- public void notify(NightTime event)
+ public boolean notify(NightTime event)
{
observed = true;
+ return false;
}
public boolean isObserved()
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/passivating/PassivatingContextTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -84,7 +84,7 @@
* @throws ClassNotFoundException
* @throws IOException
*/
- @Test(groups = { "contexts", "passivation", "incontainer-ri-broken" })
+ @Test(groups = { "contexts", "passivation", "ri-broken" })
@SpecAssertion(section = "8.4", id = "j")
public void testDependentEJBsAreSerializable() throws IOException, ClassNotFoundException
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/EventTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -49,9 +49,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
@@ -59,9 +60,10 @@
{
public boolean wasNotified = false;
- public void notify(ArrayList<String> event)
+ public boolean notify(ArrayList<String> event)
{
wasNotified = true;
+ return false;
}
}
@@ -69,9 +71,10 @@
{
public boolean wasNotified = false;
- public void notify(ArrayList<Integer> event)
+ public boolean notify(ArrayList<Integer> event)
{
wasNotified = true;
+ return false;
}
}
@@ -80,7 +83,7 @@
public boolean wasNotified = false;
public RuntimeException theException = new RuntimeException("RE1");
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
throw theException;
@@ -190,8 +193,9 @@
{
Observer<String> observer = new Observer<String>()
{
- public void notify(String event)
+ public boolean notify(String event)
{
+ return false;
}
};
assert observer != null;
@@ -208,8 +212,9 @@
{
Observer<ArrayList<E>> observer = new Observer<ArrayList<E>>() {
- public void notify(ArrayList<E> event)
+ public boolean notify(ArrayList<E> event)
{
+ return false;
}
};
@@ -222,8 +227,9 @@
{
Observer<ArrayList<?>> observer = new Observer<ArrayList<?>>() {
- public void notify(ArrayList<?> event)
+ public boolean notify(ArrayList<?> event)
{
+ return false;
}
};
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OwlFinch_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OwlFinch_Broken.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/OwlFinch_Broken.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -19,8 +19,9 @@
{
simpleEvent.observe(new Observer<String>()
{
- public void notify(String event)
+ public boolean notify(String event)
{
+ return false;
}
}, new AnimalStereotypeAnnotationLiteral());
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/SweeWaxbill.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -20,8 +20,9 @@
simpleEvent.observe(new Observer<String>()
{
- public void notify(String event)
+ public boolean notify(String event)
{
+ return false;
}
}, new RoleBinding("Admin"));
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/BlueFacedParrotFinch.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/BlueFacedParrotFinch.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/fires1/BlueFacedParrotFinch.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -23,8 +23,9 @@
{
simpleEvent.observe(new Observer<Integer>()
{
- public void notify(Integer event)
+ public boolean notify(Integer event)
{
+ return false;
}
});
}
@@ -38,9 +39,10 @@
{
simpleStringEvent.observe(new Observer<String>()
{
- public void notify(String event)
+ public boolean notify(String event)
{
BlueFacedParrotFinch.simpleStringEventObserved = true;
+ return false;
}
});
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ConsumerNotifiedForEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ConsumerNotifiedForEventTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ConsumerNotifiedForEventTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -21,9 +21,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToAddObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToAddObserverTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToAddObserverTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -19,9 +19,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToRemoveObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToRemoveObserverTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/DuplicateBindingsToRemoveObserverTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -16,9 +16,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
/*
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ManagerAddObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ManagerAddObserverTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ManagerAddObserverTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -45,9 +45,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToAddObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToAddObserverTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToAddObserverTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -18,9 +18,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToRemoveObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToRemoveObserverTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/NonBindingTypesToRemoveObserverTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -1,34 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.register.observer1;
-
-import javax.event.Observer;
-
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-
-@Artifact
-public class NonBindingTypesToRemoveObserverTest extends AbstractJSR299Test
-{
- public static class AnEventType
- {
- }
-
- public static class AnObserver implements Observer<AnEventType>
- {
- public boolean wasNotified = false;
-
- public void notify(AnEventType event)
- {
- wasNotified = true;
- }
- }
-/*
- * No longer valid under new SPI
- @Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "7.3", id = "m")
- public void testNonBindingTypePassedToRemoveObserverFails()
- {
- Observer<AnEventType> observer = new AnObserver();
- getCurrentManager().removeObserver(observer);
- }
-*/
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ObserverExceptionAbortsTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ObserverExceptionAbortsTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer1/ObserverExceptionAbortsTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -18,9 +18,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
@@ -29,7 +30,7 @@
public boolean wasNotified = false;
public RuntimeException theException = new RuntimeException("RE1");
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
throw theException;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/DuplicateBindingsToRemoveObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/DuplicateBindingsToRemoveObserverTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/DuplicateBindingsToRemoveObserverTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -16,9 +16,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
/*
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/ManagerRemoveObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/ManagerRemoveObserverTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/ManagerRemoveObserverTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -44,9 +44,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/NonBindingTypesToRemoveObserverTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/NonBindingTypesToRemoveObserverTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/register/observer2/NonBindingTypesToRemoveObserverTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -1,37 +0,0 @@
-package org.jboss.jsr299.tck.tests.event.register.observer2;
-
-import javax.event.Observer;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
-
-@Artifact
-public class NonBindingTypesToRemoveObserverTest extends AbstractJSR299Test
-{
- public static class AnEventType
- {
- }
-
- public static class AnObserver implements Observer<AnEventType>
- {
- public boolean wasNotified = false;
-
- public void notify(AnEventType event)
- {
- wasNotified = true;
- }
- }
-
- /* No longer valid under new SPI
- @Test(groups = { "events" }, expectedExceptions = { IllegalArgumentException.class })
- @SpecAssertion(section = "7.3", id = "h")
- public void testNonBindingTypePassedToRemoveObserverFails()
- {
- Observer<AnEventType> observer = new AnObserver();
- getCurrentManager().addObserver(observer);
- getCurrentManager().removeObserver(observer);
- }
- */
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/DuplicateBindingTypesWhenResolvingTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -19,9 +19,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeMembersTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -20,9 +20,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/binding/ResolvingChecksBindingTypeTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -20,9 +20,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/nonbinding/NonBindingTypesWhenResolvingTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -20,9 +20,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksEventTypeWhenResolvingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksEventTypeWhenResolvingTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksEventTypeWhenResolvingTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -20,9 +20,10 @@
{
public boolean wasNotified = false;
- public void notify(AnEventType event)
+ public boolean notify(AnEventType event)
{
wasNotified = true;
+ return false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksTypeParametersWhenResolvingTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksTypeParametersWhenResolvingTest.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/resolve/type/ChecksTypeParametersWhenResolvingTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -29,9 +29,10 @@
{
public boolean wasNotified = false;
- public void notify(ArrayList<String> event)
+ public boolean notify(ArrayList<String> event)
{
wasNotified = true;
+ return false;
}
}
@@ -39,9 +40,10 @@
{
public boolean wasNotified = false;
- public void notify(ArrayList<Integer> event)
+ public boolean notify(ArrayList<Integer> event)
{
wasNotified = true;
+ return false;
}
}
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-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -107,12 +107,13 @@
{
KleinStadt stadtInstance = getInstanceByType(KleinStadt.class);
assert stadtInstance != null : "Expected instance to be created by container";
+ stadtInstance.setName("Kassel-Wilhelmshoehe");
stadtInstance.zustandVergessen();
// Now make sure that the container does not return this instance again
KleinStadt newStadtInstance = getInstanceByType(KleinStadt.class);
assert newStadtInstance != null : "Failed to get SFSB instance the second time";
- assert !newStadtInstance.equals(stadtInstance) : "The destroyed SFSB was not ignored";
+ assert !"Kassel-Wilhelmshoehe".equals(newStadtInstance.getName()) : "The destroyed SFSB was not ignored";
}
@Test(groups = { "enterpriseBeans", "lifecycle", "integration" })
@@ -123,7 +124,7 @@
assert stadtBean != null : "Expected a bean for stateful session bean Kassel";
NeueStadt stadtInstance = createBeanInstance(stadtBean);
assert stadtInstance != null : "Expected instance to be created by container";
-
+
// Verify that the instance returned is a proxy by checking for all local interfaces
Set<Class<?>> interfaces = new HashSet<Class<?>>(Arrays.asList(stadtInstance.getClass().getInterfaces()));
assert interfaces.contains(NeueStadt.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Kassel.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -2,22 +2,25 @@
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
+import javax.ejb.EJB;
import javax.ejb.Remove;
import javax.ejb.Stateful;
import javax.enterprise.context.RequestScoped;
-import javax.enterprise.inject.Current;
@Stateful
@RequestScoped
public class Kassel implements KleinStadt, SchoeneStadt
{
- @Current
+ private String name;
+
+ @EJB
private GrossStadt grossStadt;
@PostConstruct
public void begruendet()
{
grossStadt.kleinStadtCreated();
+ name = "Kassel";
}
@Remove
@@ -33,4 +36,14 @@
public void ping() {}
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java 2009-06-06 15:33:07 UTC (rev 2772)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/KleinStadt.java 2009-06-06 15:35:20 UTC (rev 2773)
@@ -11,6 +11,7 @@
public void zustandVerloren();
- public void ping();
+ public String getName();
+ public void setName(String name);
}
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2772 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/event and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-06-06 11:33:07 -0400 (Sat, 06 Jun 2009)
New Revision: 2772
Modified:
ri/trunk/api/src/main/java/javax/event/Observer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
Log:
Changed signature of notify() to return boolean for event notification
Modified: ri/trunk/api/src/main/java/javax/event/Observer.java
===================================================================
--- ri/trunk/api/src/main/java/javax/event/Observer.java 2009-06-05 14:58:54 UTC (rev 2771)
+++ ri/trunk/api/src/main/java/javax/event/Observer.java 2009-06-06 15:33:07 UTC (rev 2772)
@@ -9,5 +9,5 @@
*/
public interface Observer<T>
{
- public void notify(T event);
+ public boolean notify(T event);
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-05 14:58:54 UTC (rev 2771)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-06 15:33:07 UTC (rev 2772)
@@ -80,7 +80,7 @@
*/
public void observe(Observer<T> observer, Annotation... bindings)
{
- getManager().addObserver(observer, type, mergeInBindings(bindings));
+ getManager().addObserver(observer, mergeInBindings(bindings));
}
@Override
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-06-05 14:58:54 UTC (rev 2771)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-06-06 15:33:07 UTC (rev 2772)
@@ -19,6 +19,8 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.lang.reflect.WildcardType;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
@@ -29,6 +31,7 @@
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Reflections.HierarchyDiscovery;
/**
@@ -77,6 +80,7 @@
*/
public <T> Set<Observer<T>> getObservers(T event, Annotation... bindings)
{
+// checkEventType(event.getClass());
Set<Observer<T>> interestedObservers = new HashSet<Observer<T>>();
Set<Type> types = new HierarchyDiscovery(event.getClass()).getFlattenedTypes();
for (Type type : types)
@@ -111,7 +115,11 @@
DependentContext.instance().setActive(true);
for (Observer<T> observer : observers)
{
- observer.notify(event);
+ if (observer.notify(event))
+ {
+ // We can remove the once-only observer
+ removeObserver(observer);
+ }
}
}
finally
@@ -126,7 +134,6 @@
*
* @param observer The observer to remove
* @param eventType The event type of the observer to remove
- * @param bindings The bindings of the observer to remove
*/
public void removeObserver(Observer<?> observer)
{
@@ -144,16 +151,15 @@
buffer.append(manager.getRegisteredObservers().toString());
return buffer.toString();
}
-
- public Type getTypeOfObserver(Observer<?> observer)
- {
- for (Type type : observer.getClass().getGenericInterfaces())
- {
- if (type instanceof ParameterizedType)
- {
+ public Type getTypeOfObserver(Observer<?> observer)
+ {
+ for (Type type : observer.getClass().getGenericInterfaces())
+ {
+ if (type instanceof ParameterizedType)
+ {
ParameterizedType ptype = (ParameterizedType) type;
- if (Observer.class.isAssignableFrom((Class)ptype.getRawType()))
+ if (Observer.class.isAssignableFrom((Class<?>) ptype.getRawType()))
{
return ptype.getActualTypeArguments()[0];
}
@@ -161,5 +167,4 @@
}
throw new RuntimeException("Cannot find observer's event type: " + observer);
}
-
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-05 14:58:54 UTC (rev 2771)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-06 15:33:07 UTC (rev 2772)
@@ -149,7 +149,7 @@
}
}
- public void notify(final T event)
+ public boolean notify(final T event)
{
if (this.asynchronous)
{
@@ -159,6 +159,7 @@
{
sendEvent(event);
}
+ return false;
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-06-05 14:58:54 UTC (rev 2771)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-06-06 15:33:07 UTC (rev 2772)
@@ -85,7 +85,7 @@
}
@Override
- public void notify(T event)
+ public boolean notify(T event)
{
if ((manager.getServices().get(TransactionServices.class) != null) && (manager.getServices().get(TransactionServices.class).isTransactionActive()))
{
@@ -95,6 +95,7 @@
{
sendEvent(event);
}
+ return false;
}
private void initTransactionObservationPhase()
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2771 - examples/trunk/se/numberguess.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-05 10:58:54 -0400 (Fri, 05 Jun 2009)
New Revision: 2771
Modified:
examples/trunk/se/numberguess/pom.xml
Log:
fix dependencies
Modified: examples/trunk/se/numberguess/pom.xml
===================================================================
--- examples/trunk/se/numberguess/pom.xml 2009-06-05 12:38:32 UTC (rev 2770)
+++ examples/trunk/se/numberguess/pom.xml 2009-06-05 14:58:54 UTC (rev 2771)
@@ -22,6 +22,10 @@
<artifactId>webbeans-core</artifactId>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
</dependencies>
<build>
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2770 - ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-05 08:38:32 -0400 (Fri, 05 Jun 2009)
New Revision: 2770
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java
Log:
WBRI-253
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2009-06-05 12:36:07 UTC (rev 2769)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2009-06-05 12:38:32 UTC (rev 2770)
@@ -155,6 +155,10 @@
businessInterface = objectInterface;
}
Object proxiedInstance = reference.getBusinessObject(businessInterface);
+ if (proxiedInstance == null)
+ {
+ throw new IllegalStateException("No EJB can be found in the EJB container for " + reference + ". Make sure you are running an EJB container.");
+ }
Method proxiedMethod = Reflections.lookupMethod(method, proxiedInstance);
Object returnValue = Reflections.invokeAndWrap(proxiedMethod, proxiedInstance, args);
log.trace("Executed " + method + " on " + proxiedInstance + " with parameters " + args + " and got return value " + returnValue);
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2769 - in ri/trunk: tests/src/test/java/org/jboss/webbeans/test/unit/lookup and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-05 08:36:07 -0400 (Fri, 05 Jun 2009)
New Revision: 2769
Added:
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Bar.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Baz.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Foo.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooBase.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooProducer.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/LookupFoo.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Special.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Wbri256Test.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
Log:
WBRI-256
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-06-05 09:42:47 UTC (rev 2768)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-06-05 12:36:07 UTC (rev 2769)
@@ -189,7 +189,7 @@
if (type instanceof Class)
{
Class<?> clazz = (Class<?>) type;
- if (isAssignableFrom(clazz, Reflections.getActualTypeArguments(clazz)))
+ if (isAssignableFrom(clazz, new Type[0]))
{
return true;
}
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Bar.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Bar.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Bar.java 2009-06-05 12:36:07 UTC (rev 2769)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.lookup;
+
+public class Bar
+{
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Bar.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Baz.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Baz.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Baz.java 2009-06-05 12:36:07 UTC (rev 2769)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.lookup;
+
+public class Baz
+{
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Baz.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Foo.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Foo.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Foo.java 2009-06-05 12:36:07 UTC (rev 2769)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.lookup;
+
+public class Foo extends FooBase<Bar>
+{
+
+ public String getName()
+ {
+ return "foo";
+ }
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Foo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooBase.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooBase.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooBase.java 2009-06-05 12:36:07 UTC (rev 2769)
@@ -0,0 +1,11 @@
+package org.jboss.webbeans.test.unit.lookup;
+
+public class FooBase<T>
+{
+
+ public String getName()
+ {
+ return "foobase";
+ }
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooProducer.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooProducer.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooProducer.java 2009-06-05 12:36:07 UTC (rev 2769)
@@ -0,0 +1,14 @@
+package org.jboss.webbeans.test.unit.lookup;
+
+import javax.enterprise.inject.Produces;
+
+public class FooProducer
+{
+
+ @Produces @Special
+ public FooBase<Baz> produce()
+ {
+ return new FooBase<Baz>();
+ }
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/FooProducer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/LookupFoo.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/LookupFoo.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/LookupFoo.java 2009-06-05 12:36:07 UTC (rev 2769)
@@ -0,0 +1,22 @@
+package org.jboss.webbeans.test.unit.lookup;
+
+import javax.enterprise.inject.Current;
+
+public class LookupFoo
+{
+
+ @Current Foo foo;
+
+ @Special FooBase<Baz> foobaz;
+
+ public Foo getFoo()
+ {
+ return foo;
+ }
+
+ public FooBase<Baz> getFoobaz()
+ {
+ return foobaz;
+ }
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/LookupFoo.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Special.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Special.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Special.java 2009-06-05 12:36:07 UTC (rev 2769)
@@ -0,0 +1,16 @@
+package org.jboss.webbeans.test.unit.lookup;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@BindingType
+(a)Retention(RetentionPolicy.RUNTIME)
+(a)Target({ElementType.FIELD, ElementType.METHOD, ElementType.TYPE})
+public @interface Special
+{
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Special.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Wbri256Test.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Wbri256Test.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Wbri256Test.java 2009-06-05 12:36:07 UTC (rev 2769)
@@ -0,0 +1,19 @@
+package org.jboss.webbeans.test.unit.lookup;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class Wbri256Test extends AbstractWebBeansTest
+{
+
+ @Test
+ public void testParameterizedInjection()
+ {
+ LookupFoo lookupFoo = getCurrentManager().getInstanceByType(LookupFoo.class);
+ assert lookupFoo.getFoo().getName().equals("foo");
+ assert lookupFoo.getFoobaz().getName().equals("foobase");
+ }
+
+}
Property changes on: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/Wbri256Test.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2768 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-06-05 05:42:47 -0400 (Fri, 05 Jun 2009)
New Revision: 2768
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
updated section 9 assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-05 02:37:14 UTC (rev 2767)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-05 09:42:47 UTC (rev 2768)
@@ -3500,15 +3500,170 @@
</assertion>
</section>
+ <section id="9" title="Interceptor bindings">
+
+ </section>
+ <section id="9.1" title="Interceptor binding types">
+ <assertion id="a">
+ <text>An interceptor binding type is a Java annotation defined as |@Target({TYPE, METHOD})| or |@Target(TYPE)| and |(a)Retention(RUNTIME)|./text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An interceptor binding type may be declared by specifying the |(a)javax.interceptor.InterceptorBindingType| metaannotation.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Multiple interceptors may be bound to the same interceptor binding type or types.</text>
+ </assertion>
+ </section>
+ <section id="9.1.1" title="Interceptor binding types with additional interceptor bindings">
+ <assertion id="a">
+ <text>An interceptor binding type may declare other interceptor bindings.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Interceptor bindings are transitive�an interceptor binding declared by an interceptor binding type is inherited by all beans and other interceptor binding types that declare that interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Interceptor binding types declared |@Target(TYPE)| may not be applied to interceptor binding types declared |@Target({TYPE, METHOD})|.</text>
+ </assertion>
+ </section>
+ <section id="9.1.2" title="Interceptor bindings for stereotypes">
+ <assertion id="a">
+ <text>Interceptor bindings may be applied to a stereotype by annotating the stereotype annotation</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An interceptor binding declared by a stereotype are inherited by any bean that declares that stereotype.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a stereotype declares interceptor bindings, it must be defined as |@Target(TYPE)|.</text>
+ </assertion>
+ </section>
+ <section id="9.2" title="Declaring the interceptor bindings of an interceptor">
+ <assertion id="a">
+ <text>The interceptor bindings of an interceptor are specified by annotating the interceptor bean class with the binding types and the |(a)javax.interceptor.Interceptor| annotation.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If an interceptor does not declare an |@Interceptor| annotation, it must be bound to beans using |@Interceptors| or |ejb-jar.xml|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>All interceptors declared using |@Interceptor| must specify at least one interceptor binding. If an interceptor declared using |@Interceptor| does not declare any interceptor binding, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>An interceptor for lifecycle callbacks may only declare interceptor binding types that are defined as |@Target(TYPE)|. If an
+interceptor for lifecycle callbacks declares an interceptor binding type that is defined |@Target({TYPE, METHOD})|, the containerautomatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
- <section id="7" title="Events">
+ <section id="9.3" title="Binding an interceptor to a bean">
+ <assertion id="a">
+ <text>An interceptor binding may be declared by annotating the bean class, or a method of the bean class, with the interceptor binding type.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>Interceptors may be enabled or disabled at deployment time.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Disabled interceptors are never called at runtime.</text>
+ </assertion>
+ </section>
+ <section id="9.4" title="Interceptor enablement and ordering">
+ <assertion id="a">
+ <text>By default, interceptors bound via interceptor bindings are not enabled. An interceptor must be explicitly enabled by listing
+its bean class under the |<Interceptors>| element in |beans.xml|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The order of the interceptor declarations determines the interceptor ordering. Interceptors which occur earlier in the list are
+called first.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a class listed under the |<Interceptors>| element is not the bean class of at least one interceptor, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean class of an interceptor with a disabled deployment type is listed under the |<Interceptors>| element, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the |<Interceptors>| element is specified in more than one |beans.xml| document, the container automatically detects the
+problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Interceptors declared using |@Interceptors| or in |ejb-jar.xml| are called before interceptors declared using interceptor
+bindings.</text>
+ </assertion>
+
+ <assertion id="g">
+ <text>Interceptors are called before decorators.</text>
+ </assertion>
</section>
+ <section id="9.5" title="Interceptor resolution">
+ <assertion id="a">
+ <text>For a lifecycle callback, the bean interceptor bindings include the interceptor bindings declared by the bean at the class
+level, including interceptor bindings declared as meta-annotations of other interceptor bindings, recursively, and of stereotypes.
+ </text>
+ </assertion>
+
+ <assertion id="b">
+ <text>For a method, the bean interceptor bindings include the interceptor bindings declared by the bean at the class level, including
+interceptor bindings declared as meta-annotations of other interceptor bindings, recursively, and of stereotypes, together with all interceptor bindings declared at the method level, including interceptor bindings declared as meta-annotations of other interceptor bindings, recursively./text>
+ </assertion>
+
+ <assertion id="c">
+ <text>First, the container identifies the set of matching enabled interceptors where for each declared interceptor binding, there exists an interceptor binding in the set of bean interceptor bindings with (a) the same type and (b) the same annotation member value for each member which is not annotated |(a)javax.enterprise.inject.NonBinding| (see Section
+9.5.2, "Interceptor binding types with members").</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>Next, the container narrows the set of matching interceptors according to whether the interceptor intercepts the given kind of lifecycle callback or business method.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>Next, the container orders the matching interceptors according to the interceptor ordering specified in Section 9.4, "Interceptor enablement and ordering" and returns the resulting list of interceptors. If no matching interceptors exist in the set, an empty list is returned.</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.1" title="Interceptors with multiple bindings">
+ <assertion id="a">
+ <text>An interceptor class may specify multiple interceptor bindings, in which case the interceptor will be applied only to beans
+that declare all the bindings at the class level, and to methods of beans for which every binding appears at either the method or class level.</text>
+ </assertion>
+ </section>
+
+ <section id="9.5.2" title="Interceptor binding types with members">
+ <assertion id="a">
+ <text>Interceptor binding types may have annotation members.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>An annotation member may be excluded from consideration using the @NonBinding annotation.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Array-valued or annotation-valued members of an interceptor binding type must be annotated |@NonBinding|. If an array-valued or annotation-valued member of an interceptor binding type is not annotated |@NonBinding|, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+ </section>
+
+ <section id="10" title="Events">
+
+ </section>
+
<section id="7.1" title="Event types and binding types">
<assertion id="a">
15 years, 6 months
[webbeans-commits] Webbeans SVN: r2767 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-06-04 22:37:14 -0400 (Thu, 04 Jun 2009)
New Revision: 2767
Modified:
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
updated section 8 assertions
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-04 23:59:36 UTC (rev 2766)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-06-05 02:37:14 UTC (rev 2767)
@@ -3354,6 +3354,157 @@
</section>
+ <section id="8" title="Decorators">
+ <assertion id="a">
+ <text>Decorators may be bound to any managed bean that is not itself an interceptor or decorator or to any EJB session or message-driven bean.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1" title="Decorator beans">
+ <assertion id="a">
+ <text>A decorator is a managed bean.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The set of decorated types of a decorator includes all interfaces implemented directly or indirectly by the bean class, except for |java.io.Serializable|.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>The decorator bean class and its superclasses are not decorated types of the decorator.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The decorator class may be abstract.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1.1" title="Declaring a decorator">
+ <assertion id="a">
+ <text>A decorator is declared by annotating the bean class with the |(a)javax.decorator.Decorator| stereotype.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1.2" title="Decorator delegate injection points">
+ <assertion id="a">
+ <text>All decorators have a delegate injection point. A delegate injection point is an injection point of the bean class. The type and bindings of the injection point are called the delegate type and delegate bindings. The delegate injection point must be be declared by annotating the field with the @javax.decorator.Decorates annotation.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The decorator applies to any bean that is eligible for injection to the delegate injection point, according to the rules defined
+in Section 5.1, "Typesafe resolution algorithm".</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A decorator must have exactly one delegate injection point. If a decorator has more than one delegate injection point, or does not have a delegate injection point, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If a decorator applies to a managed bean, and the bean class is declared final, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If a decorator applies to a managed bean with a non-static, non-private, final method, and the decorator also implements that method, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>When the container must inject a delegate object to the delegate injection point, the delegate object implements the delegate
+type and delegates method invocations along the decorator stack.</text>
+ </assertion>
+ </section>
+
+ <section id="8.1.3" title="Decorated types of a decorator">
+ <assertion id="a">
+ <text>The delegate type of a decorator must implement or extend every decorated type. If the delegate type does not implement or extend a decorated type of the decorator, the container automatically detects the problem and treats it as a definition error, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>A decorator is not required to implement the delegate type.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>A decorator may be an abstract Java class, and is not required to implement every method of every decorated type.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>The decorator intercepts every method declared by a decorated type of the decorator, and that is implemented by the bean class of the decorator.</text>
+ </assertion>
+ </section>
+
+ <section id="8.2" title="Decorator enablement and ordering">
+ <assertion id="a">
+ <text>By default, decorators are not enabled. A decorator must be explicitly enabled by listing its bean class under the
+|<Decorators>| element in |beans.xml|.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>The order of the decorator declarations determines the decorator ordering. Decorators which occur earlier in the list are called first.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>If a class listed under the |<Decorators>| element is not the bean class of at least one decorator, the container automatically
+detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".
+ </text>
+ </assertion>
+
+ <assertion id="d">
+ <text>If the bean class of a decorator with a disabled deployment type is listed under the |<Decorators>| element, the container
+automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If the |<Decorators>| element is specified in more than one |beans.xml| document, the container automatically detects the problem and treats it as a deployment problem, as defined in Section 12.4, "Problems detected automatically by the container".</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Decorators are called after interceptors.</text>
+ </assertion>
+ </section>
+
+ <section id="8.3" title="Decorator resolution">
+ <assertion id="a">
+ <text>The following algorithm must be used by the container when resolving decorators for a certain bean - First, the container identifies the set of matching enabled decorators such that the bean is eligible for injection to the delegate injection point according to the rules defined in Section 5.1, "Typesafe resolution algorithm". Next, the container orders the matching decorators according to the decorator ordering specified in Section 8.2, "Decorator enablement and ordering".</text>
+ </assertion>
+ </section>
+
+ <section id="8.4" title="Decorator stack creation">
+ <assertion id="a">
+ <text>When a bean with decorators is created, the container must
+identify the decorators for the bean according to Section 8.3, "Decorator resolution", and for each decorator, obtain a contextual reference, as defined in Section 6.5.3, "Contextual reference for a bean", and build an ordered list of the decorator instances.</text>
+ </assertion>
+ </section>
+
+ <section id="8.5" title="Decorator invocation">
+ <assertion id="a">
+ <text>Whenever a business method is invoked on an instance of a bean with decorators, the container intercepts the business method invocation and, after processing the interceptor stack, invokes decorators of the bean. The container searches for the first decorator in the decorator stack for the instance that implements the method that is being
+invoked as a business method.</text>
+ </assertion>
+
+ <assertion id="b">
+ <text>If no such decorator exists, the container invokes the business method of the intercepted instance.</text>
+ </assertion>
+
+ <assertion id="c">
+ <text>Otherwise, the container calls the method of the decorator.</text>
+ </assertion>
+
+ <assertion id="d">
+ <text>When any decorator is invoked by the container, it may in turn invoke a method of the delegate. The container intercepts the delegate invocation and searches for the first decorator in the decorator stack for the instance such that the decorator implements the method that is being invoked upon the delegate, and the decorator has not previously been invoked during this business method invocation.</text>
+ </assertion>
+
+ <assertion id="e">
+ <text>If no such decorator exists, the container invokes the business method of the intercepted instance.</text>
+ </assertion>
+
+ <assertion id="f">
+ <text>Otherwise, the container calls the method of the decorator.</text>
+ </assertion>
+ </section>
+
+
+
+
+
+
<section id="7" title="Events">
</section>
15 years, 7 months