From f28688fff7625cc2c64694541750f250a6c84674 Mon Sep 17 00:00:00 2001 From: Pete Muir Date: Thu, 25 Jun 2009 23:09:58 +0000 Subject: [PATCH] Update API to 20090625, mark all old methods still required by TCK as @Deprecated, new methods in RI are throw new UnsupportedOperationException() git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@2895 1c488680-804c-0410-94cd-c6b725194a0e --- api/pom.xml | 19 +- .../main/java/javax/decorator/Decorator.java | 2 +- .../java/javax/decorator/package-info.java | 5 + .../context/BusyConversationException.java | 57 +++ .../enterprise/context/ContextException.java | 53 +++ .../context/ContextNotActiveException.java | 9 +- .../enterprise/context/Conversation.java | 64 ++- .../NonexistentConversationException.java | 57 +++ .../event/AfterTransactionCompletion.java | 3 +- .../event/AfterTransactionFailure.java | 3 +- .../event/AfterTransactionSuccess.java | 3 +- .../event/BeforeTransactionCompletion.java | 3 +- .../javax/{ => enterprise}/event/Event.java | 20 +- .../java/javax/enterprise/event/Notify.java | 45 ++ .../java/javax/enterprise/event/Observer.java | 33 ++ .../enterprise/event/ObserverException.java | 52 +++ .../{ => enterprise}/event/Observes.java | 2 +- .../enterprise/event/TransactionPhase.java | 62 +++ .../javax/enterprise/event/package-info.java | 6 + .../javax/enterprise/inject/Instance.java | 11 + .../inject/Policy.java} | 40 +- .../inject/{deployment => }/Specializes.java | 2 +- .../inject/deployment/DeploymentType.java | 1 + .../inject/deployment/Production.java | 1 + .../inject/deployment/Standard.java | 1 + .../inject/spi/AfterBeanDiscovery.java | 30 +- .../inject/spi/AfterDeploymentValidation.java | 16 + .../enterprise/inject/spi/AnnotatedField.java | 1 - .../enterprise/inject/spi/BeanManager.java | 435 ++++++++---------- .../inject/spi/BeforeBeanDiscovery.java | 35 +- .../enterprise/inject/spi/BeforeShutdown.java | 1 + .../enterprise/inject/spi/Extension.java | 22 + .../inject/spi/InjectionTarget.java | 44 +- .../enterprise/inject/spi/Interceptor.java | 16 +- .../enterprise/inject/spi/ManagedBean.java | 11 - .../enterprise/inject/spi/ObserverMethod.java | 15 +- .../inject/spi/ProcessAnnotatedType.java | 1 + .../enterprise/inject/spi/ProcessBean.java | 1 + .../inject/spi/ProcessInjectionTarget.java | 1 + .../inject/spi/ProcessManagedBean.java | 1 + .../spi/ProcessProcessObserverMethod.java | 1 + .../inject/spi/ProcessProducer.java | 1 + .../inject/spi/ProcessProducerField.java | 1 + .../inject/spi/ProcessProducerMethod.java | 1 + .../inject/spi/ProcessSessionBean.java | 1 + .../javax/enterprise/inject/spi/Producer.java | 1 + .../enterprise/inject/spi/ProducerBean.java | 9 - .../inject/spi/SessionBeanType.java | 22 + .../inject/{ => stereotype}/Model.java | 3 +- .../inject/{ => stereotype}/Stereotype.java | 2 +- api/src/main/java/javax/event/Notify.java | 28 -- api/src/main/java/javax/event/Observer.java | 13 - api/src/main/java/javax/inject/Obtains.java | 1 + .../java/javax/interceptor/Interceptor.java | 8 +- .../interceptor/InterceptorBindingType.java | 4 +- .../java/javax/interceptor/package-info.java | 5 + .../java/org/jboss/webbeans}/Realizes.java | 2 +- .../org/jboss/webbeans/BeanManagerImpl.java | 43 +- .../org/jboss/webbeans/BeanValidator.java | 2 +- .../java/org/jboss/webbeans/InstanceImpl.java | 41 ++ .../org/jboss/webbeans/bean/AbstractBean.java | 6 +- .../webbeans/bean/AbstractClassBean.java | 2 +- .../webbeans/bean/DisposalMethodBean.java | 2 +- .../jboss/webbeans/bean/EnterpriseBean.java | 2 +- .../webbeans/bean/ProducerMethodBean.java | 2 +- .../webbeans/bean/standard/EventBean.java | 2 +- .../bootstrap/AfterBeanDiscoveryImpl.java | 18 + .../webbeans/bootstrap/BeanDeployer.java | 4 +- .../conversation/ConversationImpl.java | 6 + .../webbeans/el/WebBeansELResolverImpl.java | 2 +- .../org/jboss/webbeans/event/EventImpl.java | 28 +- .../jboss/webbeans/event/EventManager.java | 2 +- .../jboss/webbeans/event/EventObserver.java | 2 +- .../jboss/webbeans/event/ObserverImpl.java | 8 +- .../event/TransactionalObserverImpl.java | 12 +- .../webbeans/introspector/WBAnnotated.java | 2 +- .../jboss/webbeans/introspector/WBMethod.java | 10 +- .../webbeans/metadata/StereotypeModel.java | 2 +- .../tck/tests/activities/ActivitiesTest.java | 2 +- .../jsr299/tck/tests/activities/Fox.java | 2 +- .../tck/tests/activities/current/Dusk.java | 2 +- .../current/ELCurrentActivityTest.java | 2 +- .../current/EventCurrentActivityTest.java | 2 +- .../activities/current/InactiveScopeTest.java | 2 +- .../InjectedManagerCurrentActivityTest.java | 2 +- .../current/InstanceCurrentActivityTest.java | 2 +- .../JndiManagerCurrentActivityTest.java | 2 +- .../current/NonNormalScopeTest.java | 2 +- .../unit/bootstrap/InitializedObserver.java | 2 +- ...edObserverWhichUsesApplicationContext.java | 2 +- ...alizedObserverWhichUsesRequestContext.java | 2 +- .../definition/AnimalOrderStereotype.java | 2 +- .../unit/definition/AnimalStereotype.java | 2 +- .../RequestScopedAnimalStereotype.java | 2 +- .../annotatedItem/ClassAnnotatedItemTest.java | 2 +- .../event/NormalScopedBean.java | 2 +- .../implementation/event/SimpleEventTest.java | 4 +- .../named/NamedBeanWithBindingTest.java | 2 +- .../producer/method/NamedProducerTest.java | 4 +- .../method/NamedProducerWithBindingTest.java | 2 +- .../unit/implementation/proxy/ProxyTest.java | 2 +- .../beans/annotationtype/TestStereotype.java | 2 +- 102 files changed, 1039 insertions(+), 498 deletions(-) create mode 100644 api/src/main/java/javax/decorator/package-info.java create mode 100644 api/src/main/java/javax/enterprise/context/BusyConversationException.java create mode 100644 api/src/main/java/javax/enterprise/context/ContextException.java create mode 100644 api/src/main/java/javax/enterprise/context/NonexistentConversationException.java rename api/src/main/java/javax/{ => enterprise}/event/AfterTransactionCompletion.java (96%) rename api/src/main/java/javax/{ => enterprise}/event/AfterTransactionFailure.java (96%) rename api/src/main/java/javax/{ => enterprise}/event/AfterTransactionSuccess.java (96%) rename api/src/main/java/javax/{ => enterprise}/event/BeforeTransactionCompletion.java (96%) rename api/src/main/java/javax/{ => enterprise}/event/Event.java (76%) create mode 100644 api/src/main/java/javax/enterprise/event/Notify.java create mode 100644 api/src/main/java/javax/enterprise/event/Observer.java create mode 100644 api/src/main/java/javax/enterprise/event/ObserverException.java rename api/src/main/java/javax/{ => enterprise}/event/Observes.java (97%) create mode 100644 api/src/main/java/javax/enterprise/event/TransactionPhase.java create mode 100644 api/src/main/java/javax/enterprise/event/package-info.java rename api/src/main/java/javax/{event/ObserverException.java => enterprise/inject/Policy.java} (60%) rename api/src/main/java/javax/enterprise/inject/{deployment => }/Specializes.java (96%) create mode 100644 api/src/main/java/javax/enterprise/inject/spi/BeforeShutdown.java delete mode 100644 api/src/main/java/javax/enterprise/inject/spi/ManagedBean.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/ProcessAnnotatedType.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/ProcessBean.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/ProcessInjectionTarget.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/ProcessManagedBean.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/ProcessProcessObserverMethod.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/ProcessProducer.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/ProcessProducerField.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/ProcessProducerMethod.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/Producer.java delete mode 100644 api/src/main/java/javax/enterprise/inject/spi/ProducerBean.java create mode 100644 api/src/main/java/javax/enterprise/inject/spi/SessionBeanType.java rename api/src/main/java/javax/enterprise/inject/{ => stereotype}/Model.java (86%) rename api/src/main/java/javax/enterprise/inject/{ => stereotype}/Stereotype.java (97%) delete mode 100644 api/src/main/java/javax/event/Notify.java delete mode 100644 api/src/main/java/javax/event/Observer.java create mode 100644 api/src/main/java/javax/interceptor/package-info.java rename {api/src/main/java/javax/inject => core-api/src/main/java/org/jboss/webbeans}/Realizes.java (97%) diff --git a/api/pom.xml b/api/pom.xml index 9043fa7a630..dddf39a6fc6 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -1,4 +1,5 @@ - + 4.0.0 @@ -9,15 +10,19 @@ org.jboss.webbeans jsr299-api - 1.0.0-SNAPSHOT + 1.0.0-SNAPSHOT jar JSR-299 API http://www.seamframework.org/WebBeans - - javax.el - el-api - - + + javax.el + el-api + + + javax.ejb + ejb-api + + diff --git a/api/src/main/java/javax/decorator/Decorator.java b/api/src/main/java/javax/decorator/Decorator.java index 9a2ea5aef4c..dc5afd7c22b 100644 --- a/api/src/main/java/javax/decorator/Decorator.java +++ b/api/src/main/java/javax/decorator/Decorator.java @@ -24,7 +24,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import javax.enterprise.inject.Stereotype; +import javax.enterprise.inject.stereotype.Stereotype; /** * Specifies that a class is a decorator. diff --git a/api/src/main/java/javax/decorator/package-info.java b/api/src/main/java/javax/decorator/package-info.java new file mode 100644 index 00000000000..bc6c354b355 --- /dev/null +++ b/api/src/main/java/javax/decorator/package-info.java @@ -0,0 +1,5 @@ +package javax.decorator; + +/** + * The package javax.decorator contains annotations relating to decorators. + */ diff --git a/api/src/main/java/javax/enterprise/context/BusyConversationException.java b/api/src/main/java/javax/enterprise/context/BusyConversationException.java new file mode 100644 index 00000000000..cc4e1d050fc --- /dev/null +++ b/api/src/main/java/javax/enterprise/context/BusyConversationException.java @@ -0,0 +1,57 @@ +/* + * 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.context; + +/** + * The container ensures that a long-running conversation may be associated with + * at most one request at a time, by blocking or rejecting concurrent requests. + * If the container rejects a request, it must associate the request with a new + * transient conversation and throw an exception of type + * {@link BusyConversationException} from the restore view phase of the JSF + * lifecycle. + * + * + * @author Pete Muir + */ + +public class BusyConversationException extends ContextException +{ + + private static final long serialVersionUID = -3599813072560026919L; + + public BusyConversationException() + { + super(); + } + + public BusyConversationException(String message) + { + super(message); + } + + public BusyConversationException(Throwable cause) + { + super(cause); + } + + public BusyConversationException(String message, Throwable cause) + { + super(message, cause); + } + +} diff --git a/api/src/main/java/javax/enterprise/context/ContextException.java b/api/src/main/java/javax/enterprise/context/ContextException.java new file mode 100644 index 00000000000..0dd995154d9 --- /dev/null +++ b/api/src/main/java/javax/enterprise/context/ContextException.java @@ -0,0 +1,53 @@ +/* + * 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.context; + + +/** + * A ContextException is the base type for any context problem + * + * @author Pete Muir + * @author Shane Bryzak + */ + +public class ContextException extends RuntimeException +{ + + private static final long serialVersionUID = -3599813072560026919L; + + public ContextException() + { + super(); + } + + public ContextException(String message) + { + super(message); + } + + public ContextException(Throwable cause) + { + super(cause); + } + + public ContextException(String message, Throwable cause) + { + super(message, cause); + } + +} diff --git a/api/src/main/java/javax/enterprise/context/ContextNotActiveException.java b/api/src/main/java/javax/enterprise/context/ContextNotActiveException.java index 8cb555f2a47..e40e44cf061 100644 --- a/api/src/main/java/javax/enterprise/context/ContextNotActiveException.java +++ b/api/src/main/java/javax/enterprise/context/ContextNotActiveException.java @@ -19,17 +19,18 @@ /** - * A ContextNotActiveException is thrown if at a particular point in the - * execution of the program the scope is inactive with respect to the current - * thread. When the scope is inactive, any invocation of the get() from the + * A {@link ContextNotActiveException} is thrown if at a particular point in the + * execution of the program the context is inactive with respect to the current + * thread. When the context is inactive, any invocation of the get() from the * current thread upon the Context object for that scope results in a * ContextNotActiveException. * + * * @author Pete Muir * @author Shane Bryzak */ -public class ContextNotActiveException extends RuntimeException +public class ContextNotActiveException extends ContextException { private static final long serialVersionUID = -3599813072560026919L; diff --git a/api/src/main/java/javax/enterprise/context/Conversation.java b/api/src/main/java/javax/enterprise/context/Conversation.java index a51ab15ef28..2896bca6a51 100644 --- a/api/src/main/java/javax/enterprise/context/Conversation.java +++ b/api/src/main/java/javax/enterprise/context/Conversation.java @@ -1,62 +1,72 @@ /* -* 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. -*/ + * 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.context; /** * Provides conversation management operations * * @author Pete Muir - * + * */ -public interface Conversation +public interface Conversation { - + /** * Mark a transient conversation long running. The container will generate an * id + * + * @throws IllegalStateException if the current conversation is marked long + * running */ public void begin(); - + /** * Mark a transient conversation long running. * * @param id the id of the conversation + * @throws IllegalStateException if the current conversation is marked long + * running + * @throws IllegalArgumentException if a long running conversation with id + * already exists */ public void begin(String id); - + /** * Mark a long running conversation transient + * + * @throws IllegalStateException if the current conversation is marked + * transient */ public void end(); - + /** * Determine if a conversation is long running or transient * * @return true if the conversation is long running */ public boolean isLongRunning(); - + /** * Get the id associated with the current long running conversation * * @return the id of the current long running conversation */ public String getId(); - + /** * Get the timeout for the current long running conversation. * @@ -66,11 +76,17 @@ public interface Conversation * @return the current timeout in milliseconds */ public long getTimeout(); - + /** * Set the timeout for the current long running conversation * * @param milliseconds the new timeout in milliseconds */ public void setTimeout(long milliseconds); + + /** + * @return true if the conversation is marked transient, or false if it is + * marked long-running. + */ + public boolean isTransient(); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/context/NonexistentConversationException.java b/api/src/main/java/javax/enterprise/context/NonexistentConversationException.java new file mode 100644 index 00000000000..7c13398636d --- /dev/null +++ b/api/src/main/java/javax/enterprise/context/NonexistentConversationException.java @@ -0,0 +1,57 @@ +/* + * 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.context; + +/** + * If the propagated conversation cannot be restored, the container must + * associate the request with a new transient conversation and throw an + * exception of type {@link NonexistentConversationException} from the + * restore view phase of the JSF lifecycle. The application may handle this + * exception using the JSF ExceptionHandler. + * + * + * + * @author Pete Muir + */ + +public class NonexistentConversationException extends ContextException +{ + + private static final long serialVersionUID = -3599813072560026919L; + + public NonexistentConversationException() + { + super(); + } + + public NonexistentConversationException(String message) + { + super(message); + } + + public NonexistentConversationException(Throwable cause) + { + super(cause); + } + + public NonexistentConversationException(String message, Throwable cause) + { + super(message, cause); + } + +} diff --git a/api/src/main/java/javax/event/AfterTransactionCompletion.java b/api/src/main/java/javax/enterprise/event/AfterTransactionCompletion.java similarity index 96% rename from api/src/main/java/javax/event/AfterTransactionCompletion.java rename to api/src/main/java/javax/enterprise/event/AfterTransactionCompletion.java index 80e27d3c28f..07d1a28dd3d 100644 --- a/api/src/main/java/javax/event/AfterTransactionCompletion.java +++ b/api/src/main/java/javax/enterprise/event/AfterTransactionCompletion.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package javax.event; +package javax.enterprise.event; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; @@ -31,6 +31,7 @@ */ @Retention(RUNTIME) @Target(PARAMETER) +@Deprecated public @interface AfterTransactionCompletion { } diff --git a/api/src/main/java/javax/event/AfterTransactionFailure.java b/api/src/main/java/javax/enterprise/event/AfterTransactionFailure.java similarity index 96% rename from api/src/main/java/javax/event/AfterTransactionFailure.java rename to api/src/main/java/javax/enterprise/event/AfterTransactionFailure.java index 1dada7932e0..b9efded894e 100644 --- a/api/src/main/java/javax/event/AfterTransactionFailure.java +++ b/api/src/main/java/javax/enterprise/event/AfterTransactionFailure.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package javax.event; +package javax.enterprise.event; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; @@ -31,6 +31,7 @@ */ @Retention(RUNTIME) @Target(PARAMETER) +@Deprecated public @interface AfterTransactionFailure { } diff --git a/api/src/main/java/javax/event/AfterTransactionSuccess.java b/api/src/main/java/javax/enterprise/event/AfterTransactionSuccess.java similarity index 96% rename from api/src/main/java/javax/event/AfterTransactionSuccess.java rename to api/src/main/java/javax/enterprise/event/AfterTransactionSuccess.java index a4de942b27b..c8323a7dd9e 100644 --- a/api/src/main/java/javax/event/AfterTransactionSuccess.java +++ b/api/src/main/java/javax/enterprise/event/AfterTransactionSuccess.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package javax.event; +package javax.enterprise.event; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; @@ -31,6 +31,7 @@ */ @Retention(RUNTIME) @Target(PARAMETER) +@Deprecated public @interface AfterTransactionSuccess { } diff --git a/api/src/main/java/javax/event/BeforeTransactionCompletion.java b/api/src/main/java/javax/enterprise/event/BeforeTransactionCompletion.java similarity index 96% rename from api/src/main/java/javax/event/BeforeTransactionCompletion.java rename to api/src/main/java/javax/enterprise/event/BeforeTransactionCompletion.java index f8c9e27a685..34352d160c2 100644 --- a/api/src/main/java/javax/event/BeforeTransactionCompletion.java +++ b/api/src/main/java/javax/enterprise/event/BeforeTransactionCompletion.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package javax.event; +package javax.enterprise.event; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; @@ -32,6 +32,7 @@ */ @Retention(RUNTIME) @Target(PARAMETER) +@Deprecated public @interface BeforeTransactionCompletion { } diff --git a/api/src/main/java/javax/event/Event.java b/api/src/main/java/javax/enterprise/event/Event.java similarity index 76% rename from api/src/main/java/javax/event/Event.java rename to api/src/main/java/javax/enterprise/event/Event.java index 15ac48c340f..e7ed7582d1f 100644 --- a/api/src/main/java/javax/event/Event.java +++ b/api/src/main/java/javax/enterprise/event/Event.java @@ -15,10 +15,12 @@ * limitations under the License. */ -package javax.event; +package javax.enterprise.event; import java.lang.annotation.Annotation; +import javax.enterprise.inject.TypeLiteral; + /** * An interface for firing events of a particular type, and registering * observers for events of that type. @@ -39,14 +41,30 @@ public interface Event * @param event the event type * @param bindings the event bindings */ + @Deprecated public void fire(T event, Annotation... bindings); + /** + * Fire an event + * + * @param event the event type + */ + public void fire(T event); + + public Event select(Annotation... bindings); + public Event select(Class subtype, Annotation... bindings); + public Event select(TypeLiteral subtype, Annotation... bindings); + + /** * Register an observer for a specific type * * @param observer the observer to register * @param bindings the bindings to observe the event for */ + @Deprecated public void observe(Observer observer, Annotation... bindings); + + } diff --git a/api/src/main/java/javax/enterprise/event/Notify.java b/api/src/main/java/javax/enterprise/event/Notify.java new file mode 100644 index 00000000000..1a1d17f5e7f --- /dev/null +++ b/api/src/main/java/javax/enterprise/event/Notify.java @@ -0,0 +1,45 @@ +/* +* 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.event; + +/** + * An enumeration that is used to declare the condition under which an observer + * method should be called. The default behavior is to create the bean and + * invoke the observer method synchronously. + * + * @author Gavin King + * @author Dan Allen + */ +public enum Notify +{ + /** + * Specifies that an observer method is only called if the current instance + * of the bean declaring the observer method already exists. + */ + IF_EXISTS, + + /** + * Specifies that an observer method is called synchronously. + */ + SYNCHRONOUSLY, + + /** + * Specifies that an observer method receives the event notifications + * asynchronously. + */ + ASYNCHRONOUSLY +} \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/event/Observer.java b/api/src/main/java/javax/enterprise/event/Observer.java new file mode 100644 index 00000000000..43e49cb0a1f --- /dev/null +++ b/api/src/main/java/javax/enterprise/event/Observer.java @@ -0,0 +1,33 @@ +/* +* 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.event; + +/** + * The contract between the manager and an observer object. + * This interface should not be called directly by the application. + * + * @author Gavin King + * + * @deprecated Removed in latest rev of spec. + * + * TODO Move into RI and remove TCK assertions + */ +@Deprecated +public interface Observer +{ + public boolean notify(T event); +} \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/event/ObserverException.java b/api/src/main/java/javax/enterprise/event/ObserverException.java new file mode 100644 index 00000000000..b0f5b2dcb6f --- /dev/null +++ b/api/src/main/java/javax/enterprise/event/ObserverException.java @@ -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.event; + +/** + * Wraps any checked exceptions which occur during the notification of an + * observer + * + * @author Pete Muir + */ + +public class ObserverException extends RuntimeException +{ + + private static final long serialVersionUID = -801836224808304381L; + + public ObserverException() + { + + } + + public ObserverException(String message) + { + super(message); + } + + public ObserverException(Throwable cause) + { + super(cause); + } + + public ObserverException(String message, Throwable cause) + { + super(message, cause); + } + +} diff --git a/api/src/main/java/javax/event/Observes.java b/api/src/main/java/javax/enterprise/event/Observes.java similarity index 97% rename from api/src/main/java/javax/event/Observes.java rename to api/src/main/java/javax/enterprise/event/Observes.java index cd6b91d0435..d9fc287ae7a 100644 --- a/api/src/main/java/javax/event/Observes.java +++ b/api/src/main/java/javax/enterprise/event/Observes.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package javax.event; +package javax.enterprise.event; import static java.lang.annotation.ElementType.PARAMETER; import static java.lang.annotation.RetentionPolicy.RUNTIME; diff --git a/api/src/main/java/javax/enterprise/event/TransactionPhase.java b/api/src/main/java/javax/enterprise/event/TransactionPhase.java new file mode 100644 index 00000000000..d578f3b3b97 --- /dev/null +++ b/api/src/main/java/javax/enterprise/event/TransactionPhase.java @@ -0,0 +1,62 @@ +/* + * 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.event; + +/** + * The enumeration {@link TransactionPhase} identifies the kind + * of transactional observer method + * + * Transactional observer methods are observer methods which receive event + * notifications during the before or after completion phase of the + * transaction in which the event was fired. If no transaction is in progress + * when the event is fired, they are notified at the same time as other + * observers. + * + * + * @author Pete Muir + * + */ +public enum TransactionPhase +{ + + IN_PROGRESS, + + /** + * A before completion observer method is called during the before completion + * phase of the transaction. + */ + BEFORE_COMPLETION, + + /** + * An after completion observer method is called during the after completion + * phase of the transaction. + */ + AFTER_COMPLETION, + + /** + * An after failure observer method is called during the after completion + * phase of the transaction, only when the transaction fails. + */ + AFTER_FAILURE, + + /** + * A before completion observer method is called during the before completion + * phase of the transaction. + */ + AFTER_SUCCESS + +} diff --git a/api/src/main/java/javax/enterprise/event/package-info.java b/api/src/main/java/javax/enterprise/event/package-info.java new file mode 100644 index 00000000000..86665aaf21f --- /dev/null +++ b/api/src/main/java/javax/enterprise/event/package-info.java @@ -0,0 +1,6 @@ +package javax.enterprise.event; + +/** + * The package javax.enterprise.event contains annotations and interfaces + * relating to events. + */ diff --git a/api/src/main/java/javax/enterprise/inject/Instance.java b/api/src/main/java/javax/enterprise/inject/Instance.java index a029d70ea35..f8fd263b885 100644 --- a/api/src/main/java/javax/enterprise/inject/Instance.java +++ b/api/src/main/java/javax/enterprise/inject/Instance.java @@ -47,4 +47,15 @@ public interface Instance extends Iterable * */ public T get(Annotation... bindings); + + public Instance select(Annotation... bindings); + + public Instance select(Class subtype, Annotation... bindings); + + public Instance select(TypeLiteral subtype, Annotation... bindings); + + public boolean isUnsatisfied(); + + public boolean isAmbiguous(); + } diff --git a/api/src/main/java/javax/event/ObserverException.java b/api/src/main/java/javax/enterprise/inject/Policy.java similarity index 60% rename from api/src/main/java/javax/event/ObserverException.java rename to api/src/main/java/javax/enterprise/inject/Policy.java index a827a6bf97f..186900a1b03 100644 --- a/api/src/main/java/javax/event/ObserverException.java +++ b/api/src/main/java/javax/enterprise/inject/Policy.java @@ -15,39 +15,25 @@ * limitations under the License. */ -package javax.event; +package javax.enterprise.inject; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; /** - * Wraps any checked exceptions which occur during the notification of an - * observer + * Specifies that an annotation type is a deployment type. * + * @author Gavin King * @author Pete Muir */ -public class ObserverException extends RuntimeException +@Target(TYPE) +@Retention(RUNTIME) +@Documented +public @interface Policy { - - private static final long serialVersionUID = -801836224808304381L; - - public ObserverException() - { - - } - - public ObserverException(String message) - { - super(message); - } - - public ObserverException(Throwable cause) - { - super(cause); - } - - public ObserverException(String message, Throwable cause) - { - super(message, cause); - } - } diff --git a/api/src/main/java/javax/enterprise/inject/deployment/Specializes.java b/api/src/main/java/javax/enterprise/inject/Specializes.java similarity index 96% rename from api/src/main/java/javax/enterprise/inject/deployment/Specializes.java rename to api/src/main/java/javax/enterprise/inject/Specializes.java index fc522b38c66..4c82188ed96 100644 --- a/api/src/main/java/javax/enterprise/inject/deployment/Specializes.java +++ b/api/src/main/java/javax/enterprise/inject/Specializes.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package javax.enterprise.inject.deployment; +package javax.enterprise.inject; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.TYPE; diff --git a/api/src/main/java/javax/enterprise/inject/deployment/DeploymentType.java b/api/src/main/java/javax/enterprise/inject/deployment/DeploymentType.java index 046c0857745..716a643ca23 100644 --- a/api/src/main/java/javax/enterprise/inject/deployment/DeploymentType.java +++ b/api/src/main/java/javax/enterprise/inject/deployment/DeploymentType.java @@ -34,6 +34,7 @@ @Target(ANNOTATION_TYPE) @Retention(RUNTIME) @Documented +@Deprecated public @interface DeploymentType { } diff --git a/api/src/main/java/javax/enterprise/inject/deployment/Production.java b/api/src/main/java/javax/enterprise/inject/deployment/Production.java index 3db56d2ec4b..85ad660d0ae 100644 --- a/api/src/main/java/javax/enterprise/inject/deployment/Production.java +++ b/api/src/main/java/javax/enterprise/inject/deployment/Production.java @@ -37,6 +37,7 @@ @Retention(RUNTIME) @Documented @DeploymentType +@Deprecated public @interface Production { } diff --git a/api/src/main/java/javax/enterprise/inject/deployment/Standard.java b/api/src/main/java/javax/enterprise/inject/deployment/Standard.java index e153194c0af..e79b5ae2e11 100644 --- a/api/src/main/java/javax/enterprise/inject/deployment/Standard.java +++ b/api/src/main/java/javax/enterprise/inject/deployment/Standard.java @@ -37,6 +37,7 @@ @Retention(RUNTIME) @Documented @DeploymentType +@Deprecated public @interface Standard { } diff --git a/api/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java b/api/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java index 193ccfc968f..b724c5e1135 100644 --- a/api/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java +++ b/api/src/main/java/javax/enterprise/inject/spi/AfterBeanDiscovery.java @@ -1,5 +1,31 @@ +/* + * 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; -public interface AfterBeanDiscovery { - public void addDefinitionError(Throwable t); +import javax.enterprise.context.spi.Context; + +public interface AfterBeanDiscovery +{ + public void addDefinitionError(Throwable t); + + public void addBean(Bean bean); + + public void addObserverMethod(ObserverMethod observerMethod); + + public void addContext(Context context); + } diff --git a/api/src/main/java/javax/enterprise/inject/spi/AfterDeploymentValidation.java b/api/src/main/java/javax/enterprise/inject/spi/AfterDeploymentValidation.java index fd1ae9154e9..0e2d12ce5de 100644 --- a/api/src/main/java/javax/enterprise/inject/spi/AfterDeploymentValidation.java +++ b/api/src/main/java/javax/enterprise/inject/spi/AfterDeploymentValidation.java @@ -1,3 +1,19 @@ +/* + * JBoss, Home of Professional Open Source + * Copyright 2008, Red Hat Middleware LLC, and individual contributors + * by the @authors tag. See the copyright.txt in the distribution for a + * full listing of individual contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package javax.enterprise.inject.spi; public interface AfterDeploymentValidation diff --git a/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java b/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java index 2e776e3140e..bf92a94e599 100644 --- a/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java +++ b/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java @@ -1,4 +1,3 @@ - /* * JBoss, Home of Professional Open Source * Copyright 2008, Red Hat Middleware LLC, and individual contributors diff --git a/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java b/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java index 898e76646b2..b1f72cfdffa 100644 --- a/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java +++ b/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java @@ -28,9 +28,9 @@ import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.event.Observer; import javax.enterprise.inject.AmbiguousResolutionException; import javax.enterprise.inject.UnsatisfiedResolutionException; -import javax.event.Observer; /** * The contract between the application and the manager. Also the contract @@ -46,201 +46,166 @@ public interface BeanManager { - /** + /** * Obtains a contextual reference for a given bean and a given bean type. * - * @param bean - * the Bean object representing the bean - * @param beanType - * a bean type that must be implemented by any proxy that is returned + * @param bean the Bean object representing the bean + * @param beanType a bean type that must be implemented by any proxy that is + * returned * @return a contextual reference representing the bean - * @throws IllegalArgumentException - * if the given type is not a bean type of the given bean + * @throws IllegalArgumentException if the given type is not a bean type of + * the given bean */ - public Object getReference(Bean bean, Type beanType, CreationalContext creationalContext); + public Object getReference(Bean bean, Type beanType, CreationalContext ctx); /** * Obtains an instance of bean for a given injection point. * * This method should not be called by an application. * - * @param injectionPoint - * the injection point the instance is needed for - * @param creationalContext - * the context in which the injection is occurring + * @param ij the injection point the instance is needed for + * @param ctx the context in which the injection is occurring * @return an instance of the bean - * @throws UnsatisfiedResolutionException - * if no bean can be resolved for the given type and bindings - * @throws AmbiguousResolutionException - * if more than one bean is resolved for the given type and - * bindings + * @throws UnsatisfiedResolutionException if no bean can be resolved for the + * given type and bindings + * @throws AmbiguousResolutionException if more than one bean is resolved for + * the given type and bindings */ - public Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext creationalContext); + public Object getInjectableReference(InjectionPoint ij, CreationalContext ctx); /** - * Returns the set of beans which match the given required type and bindings and are - * accessible to the class into which the BeanManager was injected, according to the - * rules of typesafe resolution. + * Obtain an instance of a {@link CreationalContext} for the given contextual + * + * @param contextual the contextual to create a creational context for + * @return the {@link CreationalContext} instance + */ + public CreationalContext createCreationalContext(Contextual contextual); + + /** + * Returns the set of beans which match the given required type and bindings + * and are accessible to the class into which the BeanManager was injected, + * according to the rules of typesafe resolution. * * Typesafe resolution usually occurs at container deployment time. * - * @param beanType - * the type of the beans to be resolved - * @param bindings - * the bindings used to restrict the matched beans. If no bindings are passed to - * getBeans(), the default binding @Current is assumed. + * @param beanType the type of the beans to be resolved + * @param bindings the bindings used to restrict the matched beans. If no + * bindings are passed to getBeans(), the default binding @Current + * is assumed. * @return the matched beans - * @throws IllegalArgumentException - * if the given type represents a type variable, or - * if two instances of the same binding type are given, or - * if an instance of an annotation that is not a binding type is given + * @throws IllegalArgumentException if the given type represents a type + * variable + * @throws IllegalArgumentException if two instances of the same binding type + * are + * @throws IllegalArgumentException if an instance of an annotation that is + * not a binding type is given */ - public Set> getBeans(Type beanType, Annotation... bindings); - + public Set> getBeans(Type beanType, Annotation... bindings); /** - * Returns the set of beans which match the given EL name and are accessible to the - * class into which the BeanManager was injected, according to the rules of EL name - * resolution. + * Returns the set of beans which match the given EL name and are accessible + * to the class into which the BeanManager was injected, according to the + * rules of EL name resolution. * - * @param name - * the name used to restrict the beans matched + * @param name the name used to restrict the beans matched * @return the matched beans */ - public Set> getBeans(String name); + public Set> getBeans(String name); /** - * Returns the Bean object representing the most specialized enabled bean registered - * with the container that specializes the given bean, - + * Returns the Bean object representing the most specialized enabled bean + * registered with the container that specializes the given bean, + * * @param The type of the bean - * @param bean - * The Bean representation of the bean. - * @return the mest specialized enabled bean + * @param bean The Bean representation of the bean. + * @return the most specialized enabled bean */ - public Bean getMostSpecializedBean(Bean bean); + public Bean getMostSpecializedBean(Bean bean); /** * Returns the PassivationCapableBean with the given identifier. */ - public Bean getPassivationCapableBean(String id); + public Bean getPassivationCapableBean(String id); /** - * Allows resolution of an ambiguous dependency programatically, by returning the Bean - * with the highest precedence deployment type in a set of beans. - + * Apply the ambiguous dependency resolution rules + * * @param The type of the bean * @param beans A set of beans of the given type + * @throws AmbiguousResolutionException if the ambiguous dependency + * resolution rules fail */ - public Bean getHighestPrecedenceBean(Set> beans); + public Bean resolve(Set> beans); /** - * Allows a new bean to be registered. This fires a ProcessBean event and then - * registers a new bean with the container, thereby making it available for injection - * into other beans. - * - * This method may be called at any time in the applications lifecycle. + * Validates the dependency * - * @param bean - * the bean to register - */ - public void addBean(Bean bean); - - - - /** - * Register an observer with the container, allowing it to begin receiving - * event notifications. - * - * The observed event type is the actual type parameter of Observer declared - * by the class of the observer object. The observer is notified when an - * event object that is assignable to the observed event type is raised - * with the observed event bindings. - * - * @param observer - * the observer to register - * @param bindings - * event bindings to further restrict the events observed - * passed - * @throws IllegalArgumentException - * if an annotation which is not a binding type is passed, or - * if two instances of the same binding type are passed, or - * if the runtime type of the observer object contains a type variable - */ - public void addObserver(Observer observer, Annotation... bindings); - - - /** - * An alternative mechanism for registering an observer. The observed event - * type and event bindings for registration will be obtained from the - * ObserverMethod instance - * @param observerMethod - * a the method to register for receiving events + * @param injectionPoint the injection point to validate + * @throws an InjectionException if there is a deployment problem (for + * example, an unsatisfied or unresolvable ambiguous dependency) + * associated with the injection point. */ - public void addObserver(ObserverMethod observerMethod); - + public void validate(InjectionPoint injectionPoint); /** - * Remove an observer registration + * Fire an event * - * @param observer - * the observer to register - * @throws IllegalArgumentException - * if an annotation which is not a event binding type is passed or - * if two instances of the same binding type are passed + * @param event the event object + * @param bindings the event bindings used to restrict the observers matched + * @throws IllegalArgumentException if the runtime type of the event object + * contains a type variable + * @throws IllegalArgumentException if two instances of the same binding type + * are given + * @throws IllegalArgumentException if an instance of an annotation that is + * not a binding type is given, */ - public void removeObserver(Observer observer); - + public void fireEvent(Object event, Annotation... bindings); /** - * Fire an event + * Obtains observers for an event by considering event type and bindings. * - * @param event - * the event object - * @param bindings - * the event bindings used to restrict the observers matched - * @throws IllegalArgumentException - * if the runtime type of the event object contains a type variable or - * if two instances of the same binding type are given, or - * if an instance of an annotation that is not a binding type is given, - */ - public void fireEvent(Object event, Annotation... bindings); + * @param the type of the event to obtain + * @param event the event object + * @param bindings the bindings used to restrict the matched observers + * @return the resolved observers + * @throws IllegalArgumentException if a parameterized type with a type + * parameter or a wildcard is passed + * @throws IllegalArgumentException if an annotation which is not a event + * binding type is passed + * @throws IllegalArgumentException if two instances of the same binding type + * are passed + */ + @Deprecated + public Set> resolveObservers(T event, Annotation... bindings); /** * Obtains observers for an event by considering event type and bindings. * - * @param - * the type of the event to obtain - * @param event - * the event object - * @param bindings - * the bindings used to restrict the matched observers + * @param the type of the event to obtain + * @param event the event object + * @param bindings the bindings used to restrict the matched observers * @return the resolved observers - * @throws IllegalArgumentException - * if a parameterized type with a type parameter or a wildcard is - * passed - * @throws IllegalArgumentException - * if an annotation which is not a event binding type is passed - * @throws IllegalArgumentException - * if two instances of the same binding type are passed + * @throws IllegalArgumentException if a parameterized type with a type + * parameter or a wildcard is passed + * @throws IllegalArgumentException if an annotation which is not a event + * binding type is passed + * @throws IllegalArgumentException if two instances of the same binding type + * are passed */ - public Set> resolveObservers(T event, Annotation... bindings); + public Set> resolveObserverMethods(T event, Annotation... bindings); /** * Obtains an ordered list of enabled decorators for a set of bean types and * a set of bindings * - * @param types - * the set of bean types of the decorated bean - * @param bindings - * the bindings declared by the decorated bean + * @param types the set of bean types of the decorated bean + * @param bindings the bindings declared by the decorated bean * @return the resolved decorators - * @throws IllegalArgumentException - * if the set of bean types is empty - * @throws IllegalArgumentException - * if an annotation which is not a binding type is passed - * @throws IllegalArgumentException - * if two instances of the same binding type are passed + * @throws IllegalArgumentException if the set of bean types is empty + * @throws IllegalArgumentException if an annotation which is not a binding + * type is passed + * @throws IllegalArgumentException if two instances of the same binding type + * are passed */ public List> resolveDecorators(Set types, Annotation... bindings); @@ -248,31 +213,17 @@ public interface BeanManager * Obtains an ordered list of enabled interceptors for a set interceptor * bindings * - * @param type - * the type of the interception - * @param bindings - * the bindings used to restrict the matched interceptors + * @param type the type of the interception + * @param bindings the bindings used to restrict the matched interceptors * @return the resolved interceptors - * @throws IllegalArgumentException - * if no interceptor binding type is passed - * @throws IllegalArgumentException - * if an annotation which is not a interceptor binding type is - * passed - * @throws IllegalArgumentException - * if two instances of the same binding type are passed + * @throws IllegalArgumentException if no interceptor binding type is passed + * @throws IllegalArgumentException if an annotation which is not a + * interceptor binding type is passed + * @throws IllegalArgumentException if two instances of the same binding type + * are passed */ public List> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings); - /** - * Validates the dependency - * @throws - * an InjectionException if there is a deployment problem - * (for example, an unsatisfied or unresolvable ambiguous - * dependency) associated with the injection point. - * @param injectionPoint the injection point to validate - */ - public void validate(InjectionPoint injectionPoint); - /** * Determine if the given annotationType is a scope type */ @@ -283,7 +234,6 @@ public interface BeanManager */ public boolean isBindingType(Class annotationType); - /** * Determine if the given annotationType is an interceptor binding type */ @@ -295,123 +245,126 @@ public interface BeanManager public boolean isStereotype(Class annotationType); /** - * Return a ScopeType definition type for a given annotation representing a scope type + * Return a ScopeType definition type for a given annotation representing a + * scope type */ public ScopeType getScopeDefinition(Class scopeType); /** - * Obtain the set of interceptor binding types meta-annotatinos for the given binding type - * annotation + * Obtain the set of interceptor binding types meta-annotatinos for the given + * binding type annotation */ public Set getInterceptorBindingTypeDefinition(Class bindingType); - /** - * Obtain the set of binding types meta-annotations for the given stereotype annotation + * Obtain the set of binding types meta-annotations for the given stereotype + * annotation */ public Set getStereotypeDefinition(Class stereotype); - - - /** - * Exposes the list of enabled deployment types, in order of lower to higher precedence, - * This method may be used by portable extensions to discover information about the - * deployment. - */ - public List> getEnabledDeploymentTypes(); - - /** - * Associate a custom Context with a scope. - * - * This method may be called at any time in the applications lifecycle. - * - * @param context - * the context to register - */ - public void addContext(Context context); - + /** * Obtain an active context instance for the given scope type. * - * @param scopeType - * the scope to get the context instance for + * @param scopeType the scope to get the context instance for * @return the context instance - * @throws ContextNotActiveException - * if no active contexts exist for the given scope type - * @throws IllegalArgumentException - * if more than one active context exists for the given scope type + * @throws ContextNotActiveException if no active contexts exist for the + * given scope type + * @throws IllegalArgumentException if more than one active context exists + * for the given scope type */ public Context getContext(Class scopeType); - + /** - * Returns the ELResolver for integration with the servlet engine and JSF implementation - * This resolver will return a contextual instance of a bean if the name for resolution - * resolves to exactly one bean + * Returns the ELResolver for integration with the servlet engine and JSF + * implementation This resolver will return a contextual instance of a bean + * if the name for resolution resolves to exactly one bean */ public ELResolver getELResolver(); - + /** - * Parse and validate the standard metadata defined by JSR-299 for the specified class, - * returning an InjectionTarget to allow injection into custom beans or - * non-contextual instances by portable extensions + * Get an {@link AnnotatedType} for the given class + * @param the type + * @param type the type + * @return the {@link AnnotatedType} + */ + public AnnotatedType createAnnotatedType(Class type); + + /** + * Returns an InjectionTarget to allow injection into custom beans or + * non-contextual instances by portable extensions. * - * @param - * The type of the class to inspect - * @param type - * The class to inspect - * @returns - * a container provided instance of InjectionTarget for the given type - * @throws IllegalArgumentException - * if there is a definition error associated with any injection point of the type. + * The container ignores the annotations and types declared by the elements + * of the actual Java class and uses the metadata provided via the Annotated + * interface instead. + * + * @param The type of the AnnotatedType to inspect + * @param type The AnnotatedType to inspect + * @returns a container provided instance of InjectionTarget for the given + * type + * @throws IllegalArgumentException if there is a definition error associated + * with any injection point of the type. */ - public InjectionTarget createInjectionTarget(Class type); + public InjectionTarget createInjectionTarget(AnnotatedType type); + + /** + * Allows a new bean to be registered. This fires a ProcessBean event and + * then registers a new bean with the container, thereby making it available + * for injection into other beans. + * + * This method may be called at any time in the applications lifecycle. + * + * @param bean the bean to register + */ + @Deprecated + public void addBean(Bean bean); /** - * Returns an InjectionTarget to allow injection into custom beans - * or non-contextual instances by portable extensions. + * Register an observer with the container, allowing it to begin receiving + * event notifications. * - * The container ignores the annotations and types declared by the elements of the - * actual Java class and uses the metadata provided via the Annotated interface instead. + * The observed event type is the actual type parameter of Observer declared + * by the class of the observer object. The observer is notified when an + * event object that is assignable to the observed event type is raised with + * the observed event bindings. + * + * @param observer the observer to register + * @param bindings event bindings to further restrict the events observed + * passed + * @throws IllegalArgumentException if an annotation which is not a binding + * type is passed, or if two instances of the same binding type + * are passed, or if the runtime type of the observer object + * contains a type variable + */ + @Deprecated + public void addObserver(Observer observer, Annotation... bindings); - * @param - * The type of the AnnotatedType to inspect - * @param type - * The AnnotatedType to inspect - * @returns - * a container provided instance of InjectionTarget for the given type - * @throws IllegalArgumentException - * if there is a definition error associated with any injection point of the type. + /** + * Remove an observer registration + * + * @param observer the observer to register + * @throws IllegalArgumentException if an annotation which is not a event + * binding type is passed or if two instances of the same binding + * type are passed */ - public InjectionTarget createInjectionTarget(AnnotatedType type); + @Deprecated + public void removeObserver(Observer observer); /** - * Parse and validate the standard metadata defined by JSR-299 for the specified class, - * returning a ManagedBean instance representing that class. - * @param - * The type of the class - * @param type - * The class for which a managed bean instance should be created + * Exposes the list of enabled deployment types, in order of lower to higher + * precedence, This method may be used by portable extensions to discover + * information about the deployment. */ - public ManagedBean createManagedBean(Class type); + @Deprecated + public List> getEnabledDeploymentTypes(); /** - * Returns a ManagedBean instance representing the metadata described by the specified - * type. + * Associate a custom Context with a scope. * - * The container ignores the annotations and types declared by the elements of the - * actual Java class and uses the metadata provided via the Annotated interface instead. - * @param - * The type of the underlying bean - * @param type - * The metadata for construction of the ManagedBean - */ - public ManagedBean createManagedBean(AnnotatedType type); - - /** - * Obtain an instance of a {@link CreationalContext} for the given contextual + * This method may be called at any time in the applications lifecycle. * - * @param contextual the contextual to create a creational context for - * @return the {@link CreationalContext} instance + * @param context the context to register */ - public CreationalContext createCreationalContext(Contextual contextual); + @Deprecated + public void addContext(Context context); } diff --git a/api/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java b/api/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java index bdf31d2f8a9..8b01e13725e 100644 --- a/api/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java +++ b/api/src/main/java/javax/enterprise/inject/spi/BeforeBeanDiscovery.java @@ -1,10 +1,35 @@ +/* + * 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; import java.lang.annotation.Annotation; -public interface BeforeBeanDiscovery { - public void addBindingType(Class bindingType); - public void addScopeType(Class scopeType, boolean normal, boolean passivating); - public void addStereotype(Class stereotype, Annotation... stereotypeDef); - public void addInterceptorBindingType(Class bindingType); +/** + * + * @author Pete Muir + * + */ +public interface BeforeBeanDiscovery +{ + public void addBindingType(Class bindingType); + + public void addScopeType(Class scopeType, boolean normal, boolean passivating); + + public void addStereotype(Class stereotype, Annotation... stereotypeDef); + + public void addInterceptorBindingType(Class bindingType); } diff --git a/api/src/main/java/javax/enterprise/inject/spi/BeforeShutdown.java b/api/src/main/java/javax/enterprise/inject/spi/BeforeShutdown.java new file mode 100644 index 00000000000..b5bb3a7afcd --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/BeforeShutdown.java @@ -0,0 +1 @@ +/* * 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; public interface BeforeShutdown { } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/Extension.java b/api/src/main/java/javax/enterprise/inject/spi/Extension.java index ee893285835..94648159f7d 100644 --- a/api/src/main/java/javax/enterprise/inject/spi/Extension.java +++ b/api/src/main/java/javax/enterprise/inject/spi/Extension.java @@ -1,3 +1,25 @@ +/* + * 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; +/** + * + * @author Pete Muir + * + */ public interface Extension {} \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java b/api/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java index 2efd87353fd..43f9271a14e 100644 --- a/api/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java +++ b/api/src/main/java/javax/enterprise/inject/spi/InjectionTarget.java @@ -1,19 +1,37 @@ +/* + * 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; -import java.util.Set; - import javax.enterprise.context.spi.CreationalContext; -public interface InjectionTarget +/** + * + * + * @author Pete Muir + * + * @param + */ +public interface InjectionTarget extends Producer { - public X produce(CreationalContext ctx); - - public void inject(X instance, CreationalContext ctx); - - public void dispose(X instance); - - public void destroy(X instance); - - public Set getInjectionPoints(); - + + public void inject(T instance, CreationalContext ctx); + + public void postConstruct(T instance); + + public void preDestroy(T instance); + } diff --git a/api/src/main/java/javax/enterprise/inject/spi/Interceptor.java b/api/src/main/java/javax/enterprise/inject/spi/Interceptor.java index 592605d644f..73b1a72f01c 100644 --- a/api/src/main/java/javax/enterprise/inject/spi/Interceptor.java +++ b/api/src/main/java/javax/enterprise/inject/spi/Interceptor.java @@ -18,9 +18,10 @@ package javax.enterprise.inject.spi; import java.lang.annotation.Annotation; -import java.lang.reflect.Method; import java.util.Set; +import javax.interceptor.InvocationContext; + public interface Interceptor extends Bean { @@ -31,16 +32,9 @@ public interface Interceptor extends Bean * @return the interceptor bindings */ public Set getInterceptorBindingTypes(); + + public boolean intercepts(InterceptionType type); + public Object intercept(InterceptionType type, T instance, InvocationContext ctx); - /** - * The interceptor method for the specified lifecycle callback or business - * method - * - * @param type - * the interception type - * @return the method, or null if the interceptor does not intercept - * lifecycle callbacks or business methods - */ - public Method getMethod(InterceptionType type); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/ManagedBean.java b/api/src/main/java/javax/enterprise/inject/spi/ManagedBean.java deleted file mode 100644 index dbe133c35f6..00000000000 --- a/api/src/main/java/javax/enterprise/inject/spi/ManagedBean.java +++ /dev/null @@ -1,11 +0,0 @@ -package javax.enterprise.inject.spi; - -import java.util.Set; - -public interface ManagedBean extends Bean { - public AnnotatedType getAnnotatedType(); - public InjectionTarget getInjectionTarget(); - public Set> getProducerBeans(); - public Set> getObserverMethods(); - public Bean getBeanClass(); -} diff --git a/api/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java b/api/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java index 87ceae4d09a..ccfcecd5fe0 100644 --- a/api/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java +++ b/api/src/main/java/javax/enterprise/inject/spi/ObserverMethod.java @@ -4,13 +4,14 @@ import java.lang.reflect.Type; import java.util.Set; -import javax.event.Observer; +import javax.enterprise.event.Notify; +import javax.enterprise.event.TransactionPhase; -public interface ObserverMethod extends Observer { - public AnnotatedMethod getAnnotatedMethod(); +public interface ObserverMethod { public Bean getBean(); - public Type getObservedEventType(); - public Set getObservedEventBindings(); - public void notify(X instance, T event); - public Set getInjectionPoints(); + public Type getObservedType(); + public Set getObservedBindings(); + public Notify getNotify(); + public TransactionPhase getTransactionPhase(); + public void notify(T event); } diff --git a/api/src/main/java/javax/enterprise/inject/spi/ProcessAnnotatedType.java b/api/src/main/java/javax/enterprise/inject/spi/ProcessAnnotatedType.java new file mode 100644 index 00000000000..fce7eb456b3 --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/ProcessAnnotatedType.java @@ -0,0 +1 @@ +/* * 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; public interface ProcessAnnotatedType { public AnnotatedType getAnnotatedType(); public void setAnnotatedType(AnnotatedType type); public void veto(); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/ProcessBean.java b/api/src/main/java/javax/enterprise/inject/spi/ProcessBean.java new file mode 100644 index 00000000000..68c6e751088 --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/ProcessBean.java @@ -0,0 +1 @@ +/* * 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; public interface ProcessBean { public Annotated getAnnotated(); public Bean getBean(); public void addDefinitionError(Throwable t); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/ProcessInjectionTarget.java b/api/src/main/java/javax/enterprise/inject/spi/ProcessInjectionTarget.java new file mode 100644 index 00000000000..244fa3bb1d6 --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/ProcessInjectionTarget.java @@ -0,0 +1 @@ +/* * 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; public interface ProcessInjectionTarget { public AnnotatedType getAnnotatedType(); public InjectionTarget getInjectionTarget(); public void setInjectionTarget(InjectionTarget injectionTarget); public void addDefinitionError(Throwable t); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/ProcessManagedBean.java b/api/src/main/java/javax/enterprise/inject/spi/ProcessManagedBean.java new file mode 100644 index 00000000000..dac2e37a253 --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/ProcessManagedBean.java @@ -0,0 +1 @@ +/* * 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; public interface ProcessManagedBean extends ProcessBean { public AnnotatedType getAnnotatedBeanClass(); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/ProcessProcessObserverMethod.java b/api/src/main/java/javax/enterprise/inject/spi/ProcessProcessObserverMethod.java new file mode 100644 index 00000000000..d24ca8bf11b --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/ProcessProcessObserverMethod.java @@ -0,0 +1 @@ +/* * 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; public interface ProcessProcessObserverMethod { public AnnotatedMethod getAnnotatedMethod(); public ObserverMethod getObserverMethod(); public void addDefinitionError(Throwable t); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/ProcessProducer.java b/api/src/main/java/javax/enterprise/inject/spi/ProcessProducer.java new file mode 100644 index 00000000000..a63dbf1c2f2 --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/ProcessProducer.java @@ -0,0 +1 @@ +/* * 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; public interface ProcessProducer { public AnnotatedMember getAnnotatedMember(); public Producer getProducer(); public void setProducer(Producer producer); public void addDefinitionError(Throwable t); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/ProcessProducerField.java b/api/src/main/java/javax/enterprise/inject/spi/ProcessProducerField.java new file mode 100644 index 00000000000..7a80c50b521 --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/ProcessProducerField.java @@ -0,0 +1 @@ +/* * 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; public interface ProcessProducerField extends ProcessBean { public AnnotatedField getAnnotatedProducerField(); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/ProcessProducerMethod.java b/api/src/main/java/javax/enterprise/inject/spi/ProcessProducerMethod.java new file mode 100644 index 00000000000..a96c1abe5a2 --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/ProcessProducerMethod.java @@ -0,0 +1 @@ +/* * 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; public interface ProcessProducerMethod extends ProcessBean { public AnnotatedMethod getAnnotatedProducerMethod(); public AnnotatedParameter getAnnotatedDisposedParameter(); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java b/api/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java new file mode 100644 index 00000000000..4ac3dbc5669 --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/ProcessSessionBean.java @@ -0,0 +1 @@ +/* * 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; public interface ProcessSessionBean extends ProcessBean { public AnnotatedType getAnnotatedBeanClass(); public String getEjbName(); public SessionBeanType getSessionBeanType(); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/Producer.java b/api/src/main/java/javax/enterprise/inject/spi/Producer.java new file mode 100644 index 00000000000..2ba50b8bd48 --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/Producer.java @@ -0,0 +1 @@ +/* * 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; import java.util.Set; import javax.enterprise.context.spi.CreationalContext; /** * The interface javax.enterprise.inject.spi.Producer provides a generic operation for producing an instance of a type. * * @author Pete Muir * * @param */ public interface Producer { public T produce(CreationalContext ctx); public void dispose(T instance); public Set getInjectionPoints(); } \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/spi/ProducerBean.java b/api/src/main/java/javax/enterprise/inject/spi/ProducerBean.java deleted file mode 100644 index b80a2d85185..00000000000 --- a/api/src/main/java/javax/enterprise/inject/spi/ProducerBean.java +++ /dev/null @@ -1,9 +0,0 @@ -package javax.enterprise.inject.spi; - -public interface ProducerBean extends Bean { - public AnnotatedMember getAnnotatedProducer(); - public AnnotatedMethod getAnnotatedDisposer(); - public Bean getBean(); - public InjectionTarget getInjectionTarget(); - public Bean getBeanClass(); -} diff --git a/api/src/main/java/javax/enterprise/inject/spi/SessionBeanType.java b/api/src/main/java/javax/enterprise/inject/spi/SessionBeanType.java new file mode 100644 index 00000000000..cfa488b61d3 --- /dev/null +++ b/api/src/main/java/javax/enterprise/inject/spi/SessionBeanType.java @@ -0,0 +1,22 @@ +/* + * 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; + +public enum SessionBeanType +{ + STATELESS, STATEFUL, SINGLETON +} \ No newline at end of file diff --git a/api/src/main/java/javax/enterprise/inject/Model.java b/api/src/main/java/javax/enterprise/inject/stereotype/Model.java similarity index 86% rename from api/src/main/java/javax/enterprise/inject/Model.java rename to api/src/main/java/javax/enterprise/inject/stereotype/Model.java index 039508a4726..03994cdad98 100644 --- a/api/src/main/java/javax/enterprise/inject/Model.java +++ b/api/src/main/java/javax/enterprise/inject/stereotype/Model.java @@ -1,4 +1,4 @@ -package javax.enterprise.inject; +package javax.enterprise.inject.stereotype; import static java.lang.annotation.ElementType.FIELD; import static java.lang.annotation.ElementType.METHOD; @@ -9,6 +9,7 @@ import java.lang.annotation.Target; import javax.enterprise.context.RequestScoped; +import javax.enterprise.inject.Named; /** * A stereotype for MVC model objects diff --git a/api/src/main/java/javax/enterprise/inject/Stereotype.java b/api/src/main/java/javax/enterprise/inject/stereotype/Stereotype.java similarity index 97% rename from api/src/main/java/javax/enterprise/inject/Stereotype.java rename to api/src/main/java/javax/enterprise/inject/stereotype/Stereotype.java index f5a2358aed9..9df924df913 100644 --- a/api/src/main/java/javax/enterprise/inject/Stereotype.java +++ b/api/src/main/java/javax/enterprise/inject/stereotype/Stereotype.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package javax.enterprise.inject; +package javax.enterprise.inject.stereotype; import static java.lang.annotation.ElementType.ANNOTATION_TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; diff --git a/api/src/main/java/javax/event/Notify.java b/api/src/main/java/javax/event/Notify.java deleted file mode 100644 index 8bd4930ed1b..00000000000 --- a/api/src/main/java/javax/event/Notify.java +++ /dev/null @@ -1,28 +0,0 @@ -package javax.event; - -/** - * An enumeration that is used to declare the condition under which an - * observer method should be called. The default behavior is to - * create the bean and invoke the observer method synchronously. - * - * @author Gavin King - * @author Dan Allen - */ -public enum Notify { - /** - * Specifies that an observer method is only called if the current instance of - * the bean declaring the observer method already exists. - */ - IF_EXISTS, - - /** - * Specifies that an observer method is called synchronously. - */ - SYNCHRONOUSLY, - - /** - * Specifies that an observer method receives the event notifications - * asynchronously. - */ - ASYNCHRONOUSLY -} \ No newline at end of file diff --git a/api/src/main/java/javax/event/Observer.java b/api/src/main/java/javax/event/Observer.java deleted file mode 100644 index 016fa73853f..00000000000 --- a/api/src/main/java/javax/event/Observer.java +++ /dev/null @@ -1,13 +0,0 @@ -package javax.event; - -/** - * The contract between the manager and an observer object. - * This interface should not be called directly by the application. - * - * @author Gavin King - * - */ -public interface Observer -{ - public boolean notify(T event); -} \ No newline at end of file diff --git a/api/src/main/java/javax/inject/Obtains.java b/api/src/main/java/javax/inject/Obtains.java index ea9bc12ae3f..8f0bb83fa9a 100644 --- a/api/src/main/java/javax/inject/Obtains.java +++ b/api/src/main/java/javax/inject/Obtains.java @@ -38,6 +38,7 @@ @Retention(RUNTIME) @Target( { TYPE, METHOD, FIELD, PARAMETER }) @Documented +@Deprecated public @interface Obtains { } diff --git a/api/src/main/java/javax/interceptor/Interceptor.java b/api/src/main/java/javax/interceptor/Interceptor.java index e76d6f73702..a0b910fac86 100644 --- a/api/src/main/java/javax/interceptor/Interceptor.java +++ b/api/src/main/java/javax/interceptor/Interceptor.java @@ -20,10 +20,11 @@ import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; +import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import javax.enterprise.inject.Stereotype; +import javax.enterprise.inject.stereotype.Stereotype; /** * Specifies that a class is an interceptor. @@ -34,6 +35,5 @@ @Retention(RUNTIME) @Target(TYPE) @Stereotype -public @interface Interceptor -{ -} +@Documented +public @interface Interceptor {} diff --git a/api/src/main/java/javax/interceptor/InterceptorBindingType.java b/api/src/main/java/javax/interceptor/InterceptorBindingType.java index 969d1762c74..47bd5cc7d98 100644 --- a/api/src/main/java/javax/interceptor/InterceptorBindingType.java +++ b/api/src/main/java/javax/interceptor/InterceptorBindingType.java @@ -34,6 +34,4 @@ @Target(ANNOTATION_TYPE) @Retention(RUNTIME) @Documented -public @interface InterceptorBindingType -{ -} +public @interface InterceptorBindingType {} diff --git a/api/src/main/java/javax/interceptor/package-info.java b/api/src/main/java/javax/interceptor/package-info.java new file mode 100644 index 00000000000..0a7dc9b54e9 --- /dev/null +++ b/api/src/main/java/javax/interceptor/package-info.java @@ -0,0 +1,5 @@ +package javax.interceptor; + +/** + * + */ \ No newline at end of file diff --git a/api/src/main/java/javax/inject/Realizes.java b/core-api/src/main/java/org/jboss/webbeans/Realizes.java similarity index 97% rename from api/src/main/java/javax/inject/Realizes.java rename to core-api/src/main/java/org/jboss/webbeans/Realizes.java index dbd6e11616e..05a92a55e46 100644 --- a/api/src/main/java/javax/inject/Realizes.java +++ b/core-api/src/main/java/org/jboss/webbeans/Realizes.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package javax.inject; +package org.jboss.webbeans; import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; diff --git a/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java b/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java index 97c83f1494e..86f938c1c68 100644 --- a/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java +++ b/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java @@ -48,6 +48,7 @@ import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.event.Observer; import javax.enterprise.inject.AmbiguousResolutionException; import javax.enterprise.inject.BindingType; import javax.enterprise.inject.InjectionException; @@ -62,9 +63,7 @@ import javax.enterprise.inject.spi.InjectionTarget; import javax.enterprise.inject.spi.InterceptionType; import javax.enterprise.inject.spi.Interceptor; -import javax.enterprise.inject.spi.ManagedBean; import javax.enterprise.inject.spi.ObserverMethod; -import javax.event.Observer; import org.jboss.webbeans.bean.DecoratorBean; import org.jboss.webbeans.bean.EnterpriseBean; @@ -595,11 +594,6 @@ public void addObserver(ObserverImpl observer) addObserver(observer, observer.getEventType(), observer.getBindingsAsArray()); } - public void addObserver(ObserverMethod observerMethod) - { - addObserver(observerMethod, observerMethod.getObservedEventType(), new ArrayList(observerMethod.getObservedEventBindings()).toArray(new Annotation[0])); - } - /** * Does the actual observer registration * @@ -1048,16 +1042,6 @@ public InjectionTarget createInjectionTarget(AnnotatedType type) throw new UnsupportedOperationException("Not yet implemented"); } - public ManagedBean createManagedBean(Class type) - { - throw new UnsupportedOperationException("Not yet implemented"); - } - - public ManagedBean createManagedBean(AnnotatedType type) - { - throw new UnsupportedOperationException("Not yet implemented"); - } - public Bean getMostSpecializedBean(Bean bean) { Contextual key = bean; @@ -1117,6 +1101,7 @@ public boolean isStereotype(Class annotationType) throw new UnsupportedOperationException("Not yet implemented"); } + @Deprecated public Bean getHighestPrecedenceBean(Set> beans) { if (beans.size() == 1) @@ -1158,5 +1143,29 @@ public CreationalContextImpl createCreationalContext(Contextual contex { return new CreationalContextImpl(contextual); } + + /* (non-Javadoc) + * @see javax.enterprise.inject.spi.BeanManager#createAnnotatedType(java.lang.Class) + */ + public AnnotatedType createAnnotatedType(Class type) + { + throw new UnsupportedOperationException(); + } + + /* (non-Javadoc) + * @see javax.enterprise.inject.spi.BeanManager#resolve(java.util.Set) + */ + public Bean resolve(Set> beans) + { + return getHighestPrecedenceBean(beans); + } + + /* (non-Javadoc) + * @see javax.enterprise.inject.spi.BeanManager#resolveObserverMethods(java.lang.Object, java.lang.annotation.Annotation[]) + */ + public Set> resolveObserverMethods(T event, Annotation... bindings) + { + throw new UnsupportedOperationException(); + } } diff --git a/impl/src/main/java/org/jboss/webbeans/BeanValidator.java b/impl/src/main/java/org/jboss/webbeans/BeanValidator.java index fc76dea4dd3..5d198cb5150 100644 --- a/impl/src/main/java/org/jboss/webbeans/BeanValidator.java +++ b/impl/src/main/java/org/jboss/webbeans/BeanValidator.java @@ -28,6 +28,7 @@ import java.util.Set; import javax.enterprise.context.Dependent; +import javax.enterprise.event.Event; import javax.enterprise.inject.AmbiguousResolutionException; import javax.enterprise.inject.Any; import javax.enterprise.inject.Instance; @@ -37,7 +38,6 @@ import javax.enterprise.inject.spi.Bean; import javax.enterprise.inject.spi.Decorator; import javax.enterprise.inject.spi.InjectionPoint; -import javax.event.Event; import javax.inject.Obtains; import org.jboss.webbeans.bean.AbstractClassBean; diff --git a/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java b/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java index d55ed6ab17f..97a70504ba1 100644 --- a/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java +++ b/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java @@ -22,6 +22,7 @@ import java.util.Set; import javax.enterprise.inject.Instance; +import javax.enterprise.inject.TypeLiteral; import javax.enterprise.inject.spi.Bean; import org.jboss.webbeans.injection.resolution.ResolvableWBClass; @@ -74,4 +75,44 @@ public Iterator iterator() throw new UnsupportedOperationException("Not yet implemented"); } + /* (non-Javadoc) + * @see javax.enterprise.inject.Instance#isAmbiguous() + */ + public boolean isAmbiguous() + { + throw new UnsupportedOperationException(); + } + + /* (non-Javadoc) + * @see javax.enterprise.inject.Instance#isUnsatisfied() + */ + public boolean isUnsatisfied() + { + throw new UnsupportedOperationException(); + } + + /* (non-Javadoc) + * @see javax.enterprise.inject.Instance#select(java.lang.annotation.Annotation[]) + */ + public Instance select(Annotation... bindings) + { + throw new UnsupportedOperationException(); + } + + /* (non-Javadoc) + * @see javax.enterprise.inject.Instance#select(java.lang.Class, java.lang.annotation.Annotation[]) + */ + public Instance select(Class subtype, Annotation... bindings) + { + throw new UnsupportedOperationException(); + } + + /* (non-Javadoc) + * @see javax.enterprise.inject.Instance#select(javax.enterprise.inject.TypeLiteral, java.lang.annotation.Annotation[]) + */ + public Instance select(TypeLiteral subtype, Annotation... bindings) + { + throw new UnsupportedOperationException(); + } + } diff --git a/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java b/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java index 42d8cf5c1b5..e84f0c293b5 100644 --- a/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java +++ b/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java @@ -26,13 +26,13 @@ import javax.decorator.Decorates; import javax.enterprise.context.Dependent; +import javax.enterprise.event.Event; import javax.enterprise.inject.BindingType; import javax.enterprise.inject.Named; -import javax.enterprise.inject.Stereotype; -import javax.enterprise.inject.deployment.Specializes; +import javax.enterprise.inject.Specializes; import javax.enterprise.inject.deployment.Standard; import javax.enterprise.inject.spi.Bean; -import javax.event.Event; +import javax.enterprise.inject.stereotype.Stereotype; import org.jboss.webbeans.BeanManagerImpl; import org.jboss.webbeans.DefinitionException; diff --git a/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java b/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java index a6e34076f2e..541a0fe2667 100644 --- a/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java +++ b/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java @@ -31,6 +31,7 @@ import javax.enterprise.context.Dependent; import javax.enterprise.context.ScopeType; import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.event.Observes; import javax.enterprise.inject.CreationException; import javax.enterprise.inject.Disposes; import javax.enterprise.inject.Initializer; @@ -38,7 +39,6 @@ import javax.enterprise.inject.deployment.DeploymentType; import javax.enterprise.inject.deployment.Production; import javax.enterprise.inject.spi.Decorator; -import javax.event.Observes; import org.jboss.webbeans.BeanManagerImpl; import org.jboss.webbeans.DefinitionException; diff --git a/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java b/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java index 147684ba4f7..524c60e0228 100644 --- a/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java +++ b/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java @@ -26,11 +26,11 @@ import javax.enterprise.context.Dependent; import javax.enterprise.context.ScopeType; import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.event.Observes; import javax.enterprise.inject.Disposes; import javax.enterprise.inject.Initializer; import javax.enterprise.inject.Produces; import javax.enterprise.inject.deployment.DeploymentType; -import javax.event.Observes; import org.jboss.webbeans.BeanManagerImpl; import org.jboss.webbeans.DefinitionException; diff --git a/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java b/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java index 541e70db0ec..d19d7d7295f 100644 --- a/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java +++ b/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java @@ -30,8 +30,8 @@ import javax.decorator.Decorator; import javax.enterprise.context.ApplicationScoped; import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.event.Observes; import javax.enterprise.inject.CreationException; -import javax.event.Observes; import javax.interceptor.Interceptor; import org.jboss.webbeans.BeanManagerImpl; diff --git a/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java b/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java index 5940883bdd5..b5ed6aa6745 100644 --- a/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java +++ b/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java @@ -21,9 +21,9 @@ import java.util.Set; import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.event.Observes; import javax.enterprise.inject.CreationException; import javax.enterprise.inject.Disposes; -import javax.event.Observes; import org.jboss.webbeans.BeanManagerImpl; import org.jboss.webbeans.DefinitionException; diff --git a/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java b/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java index 9cd3836133d..518e36c6e89 100644 --- a/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java +++ b/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java @@ -22,8 +22,8 @@ import java.util.HashSet; import java.util.Set; +import javax.enterprise.event.Event; import javax.enterprise.inject.TypeLiteral; -import javax.event.Event; import javax.inject.Obtains; import org.jboss.webbeans.BeanManagerImpl; diff --git a/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java b/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java index bc9c417dff0..586e1178c1c 100644 --- a/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java +++ b/impl/src/main/java/org/jboss/webbeans/bootstrap/AfterBeanDiscoveryImpl.java @@ -3,7 +3,10 @@ import java.util.ArrayList; import java.util.List; +import javax.enterprise.context.spi.Context; import javax.enterprise.inject.spi.AfterBeanDiscovery; +import javax.enterprise.inject.spi.Bean; +import javax.enterprise.inject.spi.ObserverMethod; public class AfterBeanDiscoveryImpl implements AfterBeanDiscovery { @@ -19,4 +22,19 @@ public List getDefinitionErrors() return definitionErrors; } + public void addBean(Bean bean) + { + throw new UnsupportedOperationException(); + } + + public void addContext(Context context) + { + throw new UnsupportedOperationException(); + } + + public void addObserverMethod(ObserverMethod observerMethod) + { + throw new UnsupportedOperationException(); + } + } diff --git a/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java b/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java index ac69d92a26e..edec84aa771 100644 --- a/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java +++ b/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java @@ -22,16 +22,16 @@ import java.util.Set; import javax.decorator.Decorator; +import javax.enterprise.event.Observes; import javax.enterprise.inject.BindingType; import javax.enterprise.inject.Disposes; import javax.enterprise.inject.Initializer; import javax.enterprise.inject.Produces; import javax.enterprise.inject.UnsatisfiedResolutionException; import javax.enterprise.inject.deployment.DeploymentType; -import javax.event.Observes; -import javax.inject.Realizes; import org.jboss.webbeans.BeanManagerImpl; +import org.jboss.webbeans.Realizes; import org.jboss.webbeans.bean.AbstractClassBean; import org.jboss.webbeans.bean.DecoratorBean; import org.jboss.webbeans.bean.DisposalMethodBean; diff --git a/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java b/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java index 023a2f52add..1d2adcaed5a 100644 --- a/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java +++ b/impl/src/main/java/org/jboss/webbeans/conversation/ConversationImpl.java @@ -178,4 +178,10 @@ public int hashCode() { return cid == null ? super.hashCode() : cid.hashCode(); } + + + public boolean isTransient() + { + return !isLongRunning(); + } } diff --git a/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java b/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java index 7b1a10f97d0..dc1f31aca1e 100644 --- a/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java +++ b/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java @@ -133,7 +133,7 @@ else if (base instanceof Namespace) try { - Bean bean = manager.getHighestPrecedenceBean(manager.getBeans(name)); + Bean bean = manager.resolve(manager.getBeans(name)); CreationalContext creationalContext = manager.createCreationalContext(bean); if (bean != null) { diff --git a/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java b/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java index 2ebc6157f65..8cf7457d130 100644 --- a/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java +++ b/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java @@ -20,8 +20,9 @@ import java.lang.reflect.Type; import java.util.Set; -import javax.event.Event; -import javax.event.Observer; +import javax.enterprise.event.Event; +import javax.enterprise.event.Observer; +import javax.enterprise.inject.TypeLiteral; import org.jboss.webbeans.BeanManagerImpl; import org.jboss.webbeans.FacadeImpl; @@ -34,7 +35,7 @@ * @author David Allen * * @param The type of event being wrapped - * @see javax.event.Event + * @see javax.enterprise.event.Event */ public class EventImpl extends FacadeImpl implements Event { @@ -65,6 +66,7 @@ public EventImpl(Type eventType, BeanManagerImpl manager, Set bindin * @param event The event object * @param bindings Additional binding types */ + @Deprecated public void fire(T event, Annotation... bindings) { getManager().fireEvent(event, mergeInBindings(bindings)); @@ -91,4 +93,24 @@ public String toString() return buffer.toString(); } + public void fire(T event) + { + getManager().fireEvent(event, mergeInBindings()); + } + + public Event select(Annotation... bindings) + { + throw new UnsupportedOperationException(); + } + + public Event select(Class subtype, Annotation... bindings) + { + throw new UnsupportedOperationException(); + } + + public Event select(TypeLiteral subtype, Annotation... bindings) + { + throw new UnsupportedOperationException(); + } + } diff --git a/impl/src/main/java/org/jboss/webbeans/event/EventManager.java b/impl/src/main/java/org/jboss/webbeans/event/EventManager.java index db7d5e53015..55870d8a532 100644 --- a/impl/src/main/java/org/jboss/webbeans/event/EventManager.java +++ b/impl/src/main/java/org/jboss/webbeans/event/EventManager.java @@ -23,7 +23,7 @@ import java.util.HashSet; import java.util.Set; -import javax.event.Observer; +import javax.enterprise.event.Observer; import org.jboss.webbeans.BeanManagerImpl; import org.jboss.webbeans.context.DependentContext; diff --git a/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java b/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java index a0e1491f49a..74cbbe339b5 100644 --- a/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java +++ b/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java @@ -21,8 +21,8 @@ import java.util.ArrayList; import java.util.List; +import javax.enterprise.event.Observer; import javax.enterprise.inject.Current; -import javax.event.Observer; import org.jboss.webbeans.BeanManagerImpl; import org.jboss.webbeans.metadata.MetaDataCache; diff --git a/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java b/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java index 0c2339b069a..43a8e985cc3 100644 --- a/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java +++ b/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java @@ -24,13 +24,13 @@ import javax.enterprise.context.Dependent; import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.event.Notify; +import javax.enterprise.event.Observer; +import javax.enterprise.event.ObserverException; +import javax.enterprise.event.Observes; import javax.enterprise.inject.Disposes; import javax.enterprise.inject.Initializer; import javax.enterprise.inject.Produces; -import javax.event.Notify; -import javax.event.Observer; -import javax.event.ObserverException; -import javax.event.Observes; import org.jboss.webbeans.BeanManagerImpl; import org.jboss.webbeans.DefinitionException; diff --git a/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java b/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java index 1c070ee9408..52abb49d5c3 100644 --- a/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java +++ b/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java @@ -19,12 +19,12 @@ import java.util.ArrayList; import java.util.List; -import javax.event.AfterTransactionCompletion; -import javax.event.AfterTransactionFailure; -import javax.event.AfterTransactionSuccess; -import javax.event.BeforeTransactionCompletion; -import javax.event.Notify; -import javax.event.Observes; +import javax.enterprise.event.AfterTransactionCompletion; +import javax.enterprise.event.AfterTransactionFailure; +import javax.enterprise.event.AfterTransactionSuccess; +import javax.enterprise.event.BeforeTransactionCompletion; +import javax.enterprise.event.Notify; +import javax.enterprise.event.Observes; import javax.transaction.Synchronization; import org.jboss.webbeans.BeanManagerImpl; diff --git a/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java b/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java index fe4603327d6..73dfa0dd7aa 100644 --- a/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java +++ b/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java @@ -24,9 +24,9 @@ import javax.enterprise.context.ScopeType; import javax.enterprise.inject.BindingType; -import javax.enterprise.inject.Stereotype; import javax.enterprise.inject.deployment.DeploymentType; import javax.enterprise.inject.spi.Annotated; +import javax.enterprise.inject.stereotype.Stereotype; /** * AnnotatedItem provides a uniform access to the annotations on an annotated diff --git a/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java b/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java index 3581bac367f..529028b6279 100644 --- a/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java +++ b/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java @@ -24,12 +24,12 @@ import java.util.List; import java.util.Set; +import javax.enterprise.event.AfterTransactionCompletion; +import javax.enterprise.event.AfterTransactionFailure; +import javax.enterprise.event.AfterTransactionSuccess; +import javax.enterprise.event.BeforeTransactionCompletion; +import javax.enterprise.event.Observes; import javax.enterprise.inject.Disposes; -import javax.event.AfterTransactionCompletion; -import javax.event.AfterTransactionFailure; -import javax.event.AfterTransactionSuccess; -import javax.event.BeforeTransactionCompletion; -import javax.event.Observes; /** * AnnotatedType provides a uniform access to the annotations on an annotated diff --git a/impl/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java b/impl/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java index 501a5d5b815..54c08b4ab9d 100644 --- a/impl/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java +++ b/impl/src/main/java/org/jboss/webbeans/metadata/StereotypeModel.java @@ -24,8 +24,8 @@ import javax.enterprise.context.ScopeType; import javax.enterprise.inject.BindingType; import javax.enterprise.inject.Named; -import javax.enterprise.inject.Stereotype; import javax.enterprise.inject.deployment.DeploymentType; +import javax.enterprise.inject.stereotype.Stereotype; import javax.interceptor.InterceptorBindingType; import org.jboss.webbeans.DefinitionException; diff --git a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java index 4afc73c7b92..7140a16bee3 100644 --- a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java +++ b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java @@ -10,6 +10,7 @@ import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.event.Observer; import javax.enterprise.inject.AnnotationLiteral; import javax.enterprise.inject.UnsatisfiedResolutionException; import javax.enterprise.inject.deployment.Production; @@ -17,7 +18,6 @@ import javax.enterprise.inject.spi.Bean; import javax.enterprise.inject.spi.BeanManager; import javax.enterprise.inject.spi.InjectionPoint; -import javax.event.Observer; import org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle.MockCreationalContext; import org.jboss.testharness.impl.packaging.Artifact; diff --git a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Fox.java b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Fox.java index 31b3d575407..467466882de 100644 --- a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Fox.java +++ b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Fox.java @@ -1,6 +1,6 @@ package org.jboss.jsr299.tck.tests.activities; -import javax.event.Observes; +import javax.enterprise.event.Observes; class Fox { diff --git a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java index ee600926edf..a9e86e88b15 100644 --- a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java +++ b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java @@ -1,8 +1,8 @@ package org.jboss.jsr299.tck.tests.activities.current; +import javax.enterprise.event.Event; import javax.enterprise.inject.Any; import javax.enterprise.inject.Initializer; -import javax.event.Event; class Dusk { diff --git a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java index 83daf7a1dce..aa43909bc50 100644 --- a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java +++ b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java @@ -10,12 +10,12 @@ import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.event.Observer; import javax.enterprise.inject.AnnotationLiteral; import javax.enterprise.inject.deployment.Production; import javax.enterprise.inject.spi.Bean; import javax.enterprise.inject.spi.BeanManager; import javax.enterprise.inject.spi.InjectionPoint; -import javax.event.Observer; import org.jboss.testharness.impl.packaging.Artifact; import org.jboss.webbeans.manager.api.WebBeansManager; diff --git a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java index 79dfe8c9ef2..f4e0fad23f1 100644 --- a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java +++ b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java @@ -5,7 +5,7 @@ import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; -import javax.event.Observer; +import javax.enterprise.event.Observer; import org.jboss.testharness.impl.packaging.Artifact; import org.jboss.webbeans.manager.api.WebBeansManager; diff --git a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java index 03915ed9f72..e3ee8527108 100644 --- a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java +++ b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java @@ -6,7 +6,7 @@ import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; -import javax.event.Observer; +import javax.enterprise.event.Observer; import org.jboss.testharness.impl.packaging.Artifact; import org.jboss.webbeans.manager.api.WebBeansManager; diff --git a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java index 7cdf5157d3f..40e1ea9c68a 100644 --- a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java +++ b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java @@ -5,7 +5,7 @@ import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; -import javax.event.Observer; +import javax.enterprise.event.Observer; import org.jboss.testharness.impl.packaging.Artifact; import org.jboss.webbeans.manager.api.WebBeansManager; diff --git a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java index d38a4d983be..b3c3a96388a 100644 --- a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java +++ b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java @@ -10,12 +10,12 @@ import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; +import javax.enterprise.event.Observer; import javax.enterprise.inject.AnnotationLiteral; import javax.enterprise.inject.deployment.Production; import javax.enterprise.inject.spi.Bean; import javax.enterprise.inject.spi.BeanManager; import javax.enterprise.inject.spi.InjectionPoint; -import javax.event.Observer; import org.jboss.testharness.impl.packaging.Artifact; import org.jboss.webbeans.manager.api.WebBeansManager; diff --git a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java index 62fa1430559..523e2dd266e 100644 --- a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java +++ b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java @@ -5,7 +5,7 @@ import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; -import javax.event.Observer; +import javax.enterprise.event.Observer; import org.jboss.testharness.impl.packaging.Artifact; import org.jboss.testharness.impl.packaging.IntegrationTest; diff --git a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java index e1f4dd109ab..ba324716cbb 100644 --- a/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java +++ b/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java @@ -5,7 +5,7 @@ import javax.enterprise.context.spi.Context; import javax.enterprise.context.spi.Contextual; import javax.enterprise.context.spi.CreationalContext; -import javax.event.Observer; +import javax.enterprise.event.Observer; import org.jboss.testharness.impl.packaging.Artifact; import org.jboss.webbeans.manager.api.WebBeansManager; diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java b/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java index 348fbbea79f..6b5a3ba93f3 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserver.java @@ -1,7 +1,7 @@ package org.jboss.webbeans.test.unit.bootstrap; +import javax.enterprise.event.Observes; import javax.enterprise.inject.spi.AfterBeanDiscovery; -import javax.event.Observes; class InitializedObserver diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java b/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java index bc96c2b9c85..089c1abad99 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesApplicationContext.java @@ -1,8 +1,8 @@ package org.jboss.webbeans.test.unit.bootstrap; +import javax.enterprise.event.Observes; import javax.enterprise.inject.Current; import javax.enterprise.inject.spi.AfterBeanDiscovery; -import javax.event.Observes; class InitializedObserverWhichUsesApplicationContext { diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java b/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java index 1d89f2e2cc3..99fc8ad3ebb 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/InitializedObserverWhichUsesRequestContext.java @@ -1,8 +1,8 @@ package org.jboss.webbeans.test.unit.bootstrap; +import javax.enterprise.event.Observes; import javax.enterprise.inject.Current; import javax.enterprise.inject.spi.AfterBeanDiscovery; -import javax.event.Observes; class InitializedObserverWhichUsesRequestContext { diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalOrderStereotype.java b/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalOrderStereotype.java index f4defde8482..ea812f3c46d 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalOrderStereotype.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalOrderStereotype.java @@ -6,7 +6,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.Target; -import javax.enterprise.inject.Stereotype; +import javax.enterprise.inject.stereotype.Stereotype; diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalStereotype.java b/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalStereotype.java index 089b6c3fd13..85375c11a2f 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalStereotype.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/definition/AnimalStereotype.java @@ -9,7 +9,7 @@ import java.lang.annotation.Target; import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Stereotype; +import javax.enterprise.inject.stereotype.Stereotype; @Stereotype(requiredTypes=Animal.class) @Target( { TYPE, METHOD, FIELD }) diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/definition/RequestScopedAnimalStereotype.java b/tests/src/test/java/org/jboss/webbeans/test/unit/definition/RequestScopedAnimalStereotype.java index 9a97344ebf8..999fd862dea 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/definition/RequestScopedAnimalStereotype.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/definition/RequestScopedAnimalStereotype.java @@ -7,7 +7,7 @@ import java.lang.annotation.Target; import javax.enterprise.context.RequestScoped; -import javax.enterprise.inject.Stereotype; +import javax.enterprise.inject.stereotype.Stereotype; @Stereotype(requiredTypes=Animal.class, supportedScopes=RequestScoped.class) @Target( { TYPE }) diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java index 0b557a1fbea..0d9b9a6e3ec 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java @@ -4,9 +4,9 @@ import java.util.Iterator; import java.util.Set; -import javax.enterprise.inject.Stereotype; import javax.enterprise.inject.deployment.DeploymentType; import javax.enterprise.inject.deployment.Production; +import javax.enterprise.inject.stereotype.Stereotype; import org.jboss.testharness.impl.packaging.Artifact; import org.jboss.webbeans.introspector.WBClass; diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/NormalScopedBean.java b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/NormalScopedBean.java index 2b3fff7f0d5..e29f100a12a 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/NormalScopedBean.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/NormalScopedBean.java @@ -4,8 +4,8 @@ import java.io.Serializable; import javax.enterprise.context.SessionScoped; +import javax.enterprise.event.Event; import javax.enterprise.inject.Any; -import javax.event.Event; @SessionScoped public class NormalScopedBean implements Serializable diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java index 8c2382233a5..b91a43d458e 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java @@ -1,9 +1,9 @@ package org.jboss.webbeans.test.unit.implementation.event; +import javax.enterprise.event.Event; +import javax.enterprise.event.Observes; import javax.enterprise.inject.AnnotationLiteral; import javax.enterprise.inject.Any; -import javax.event.Event; -import javax.event.Observes; import org.jboss.testharness.impl.packaging.Artifact; import org.jboss.webbeans.BeanManagerImpl; diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/named/NamedBeanWithBindingTest.java b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/named/NamedBeanWithBindingTest.java index bd931f09fa2..93ad66ab6b4 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/named/NamedBeanWithBindingTest.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/named/NamedBeanWithBindingTest.java @@ -15,7 +15,7 @@ public class NamedBeanWithBindingTest extends AbstractWebBeansTest @Test public void testGetNamedBeanWithBinding() { - Bean bean = getCurrentManager().getHighestPrecedenceBean(getCurrentManager().getBeans("namedBeanWithBinding")); + Bean bean = getCurrentManager().resolve(getCurrentManager().getBeans("namedBeanWithBinding")); NamedBeanWithBinding instance = (NamedBeanWithBinding) getCurrentManager().getReference(bean, Object.class, getCurrentManager().createCreationalContext(bean)); assert instance != null; } diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerTest.java b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerTest.java index 79dd313f9a4..d8711c868d6 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerTest.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerTest.java @@ -12,10 +12,10 @@ public class NamedProducerTest extends AbstractWebBeansTest @Test public void testNamedProducer() { - Bean iemonBean = getCurrentManager().getHighestPrecedenceBean(getCurrentManager().getBeans("iemon")); + Bean iemonBean = getCurrentManager().resolve(getCurrentManager().getBeans("iemon")); String[] iemon = (String[]) getCurrentManager().getReference(iemonBean, Object.class, getCurrentManager().createCreationalContext(iemonBean)); assert iemon.length == 3; - Bean itoenBean = getCurrentManager().getHighestPrecedenceBean(getCurrentManager().getBeans("itoen")); + Bean itoenBean = getCurrentManager().resolve(getCurrentManager().getBeans("itoen")); String[] itoen = (String[]) getCurrentManager().getReference(itoenBean, Object.class, getCurrentManager().createCreationalContext(itoenBean)); assert itoen.length == 2; } diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerWithBindingTest.java b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerWithBindingTest.java index 2a61ce45a3c..aacf105a0c4 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerWithBindingTest.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/producer/method/NamedProducerWithBindingTest.java @@ -19,7 +19,7 @@ public class NamedProducerWithBindingTest extends AbstractWebBeansTest @Test public void testGetNamedProducerWithBinding() { - Bean bean = getCurrentManager().getHighestPrecedenceBean(getCurrentManager().getBeans("date")); + Bean bean = getCurrentManager().resolve(getCurrentManager().getBeans("date")); Date date = (Date) getCurrentManager().getReference(bean, Object.class, getCurrentManager().createCreationalContext(bean)); assertNotNull(date); } diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java index 511d6744d3c..16562eae1e7 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/ProxyTest.java @@ -13,7 +13,7 @@ public class ProxyTest extends AbstractWebBeansTest @Test(description="WBRI-122") public void testImplementationClassImplementsSerializable() { - Bean bean = getCurrentManager().getHighestPrecedenceBean(getCurrentManager().getBeans("foo")); + Bean bean = getCurrentManager().resolve(getCurrentManager().getBeans("foo")); getCurrentManager().getReference(bean, Object.class, getCurrentManager().createCreationalContext(bean)); } diff --git a/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/annotationtype/TestStereotype.java b/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/annotationtype/TestStereotype.java index c1c2936e974..e9dc42dbc9d 100644 --- a/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/annotationtype/TestStereotype.java +++ b/tests/src/test/java/org/jboss/webbeans/test/unit/xml/beans/annotationtype/TestStereotype.java @@ -1,6 +1,6 @@ package org.jboss.webbeans.test.unit.xml.beans.annotationtype; -import javax.enterprise.inject.Stereotype; +import javax.enterprise.inject.stereotype.Stereotype; @Stereotype public @interface TestStereotype