Author: pete.muir(a)jboss.org
Date: 2010-01-08 08:59:36 -0500 (Fri, 08 Jan 2010)
New Revision: 5398
Added:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/AmbiguousResolutionException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/CreationException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/DefinitionException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/DeploymentException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/ForbiddenArgumentException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/ForbiddenStateException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/IllegalProductException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InconsistentSpecializationException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InjectionException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InvalidObjectException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InvalidOperationException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/NullInstanceException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/NullableDependencyException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnproxyableResolutionException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnsatisfiedResolutionException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnserializableDependencyException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/WeldException.java
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/WeldExceptionMessage.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/
core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/SimpleInjectionTarget.java
core/trunk/impl/src/main/java/org/jboss/weld/manager/SingleThreadExecutorServices.java
core/trunk/impl/src/main/java/org/jboss/weld/util/CleanableMethodHandler.java
core/trunk/impl/src/main/java/org/jboss/weld/util/JavassistCleaner.java
Removed:
core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java
core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/CreationException.java
core/trunk/impl/src/main/java/org/jboss/weld/DefinitionException.java
core/trunk/impl/src/main/java/org/jboss/weld/DeploymentException.java
core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenArgumentException.java
core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenStateException.java
core/trunk/impl/src/main/java/org/jboss/weld/IllegalProductException.java
core/trunk/impl/src/main/java/org/jboss/weld/InconsistentSpecializationException.java
core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java
core/trunk/impl/src/main/java/org/jboss/weld/InvalidObjectException.java
core/trunk/impl/src/main/java/org/jboss/weld/InvalidOperationException.java
core/trunk/impl/src/main/java/org/jboss/weld/Logger.java
core/trunk/impl/src/main/java/org/jboss/weld/NullInstanceException.java
core/trunk/impl/src/main/java/org/jboss/weld/NullableDependencyException.java
core/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java
core/trunk/impl/src/main/java/org/jboss/weld/SingleThreadExecutorServices.java
core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java
core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java
core/trunk/impl/src/main/java/org/jboss/weld/UnserializableDependencyException.java
core/trunk/impl/src/main/java/org/jboss/weld/Validator.java
core/trunk/impl/src/main/java/org/jboss/weld/WeldException.java
core/trunk/impl/src/main/java/org/jboss/weld/WeldExceptionMessage.java
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/Container.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/CustomDecoratorWrapper.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacade.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacadeBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/BeanManagerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InjectionPointBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/AbstractEEBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/AbstractEECallable.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/DefaultValidatorBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/DefaultValidatorFactoryBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/PrincipalBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/UserTransactionBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/CdiInterceptorHandlerFactory.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/ClassInterceptionHandlerFactory.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/InterceptorBindingsAdapter.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyProvider.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyMethodHandler.java
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/EnterpriseBeanProxyMethodHandler.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployerEnvironment.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractBeanDiscoveryEvent.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractContainerEvent.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDefinitionContainerEvent.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDeploymentContainerEvent.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessClassBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessInjectionTarget.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessProducerBean.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterDeploymentValidationImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeShutdownImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessAnnotatedTypeImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessBeanImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessBeanInjectionTarget.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessManagedBeanImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerFieldImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSessionBeanImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSimpleInjectionTarget.java
core/trunk/impl/src/main/java/org/jboss/weld/context/AbstractMapContext.java
core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java
core/trunk/impl/src/main/java/org/jboss/weld/context/beanstore/NamingScheme.java
core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/ejb/EjbDescriptors.java
core/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java
core/trunk/impl/src/main/java/org/jboss/weld/el/WeldELResolver.java
core/trunk/impl/src/main/java/org/jboss/weld/el/WeldExpressionFactory.java
core/trunk/impl/src/main/java/org/jboss/weld/event/EventImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java
core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/injection/ConstructorInjectionPoint.java
core/trunk/impl/src/main/java/org/jboss/weld/injection/Exceptions.java
core/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java
core/trunk/impl/src/main/java/org/jboss/weld/injection/InjectionContextImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/injection/MethodInjectionPoint.java
core/trunk/impl/src/main/java/org/jboss/weld/injection/ParameterInjectionPoint.java
core/trunk/impl/src/main/java/org/jboss/weld/injection/ProxyClassConstructorInjectionPointWrapper.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/AnnotationStore.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java
core/trunk/impl/src/main/java/org/jboss/weld/jsf/JsfHelper.java
core/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/BindingTypeModel.java
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/MergedStereotypes.java
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/StereotypeModel.java
core/trunk/impl/src/main/java/org/jboss/weld/resolution/NameBasedResolver.java
core/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWeldClass.java
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDecoratorResolver.java
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDisposerResolver.java
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeInterceptorResolver.java
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeObserverResolver.java
core/trunk/impl/src/main/java/org/jboss/weld/resources/ManagerObjectFactory.java
core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletHelper.java
core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java
core/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java
core/trunk/impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Deployers.java
core/trunk/impl/src/main/java/org/jboss/weld/util/DeploymentStructures.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Observers.java
core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java
core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ConcurrentCache.java
core/trunk/impl/src/main/java/org/jboss/weld/util/dom/NodeListIterator.java
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/SecureReflections.java
core/trunk/impl/src/main/java/org/jboss/weld/util/serviceProvider/DefaultServiceLoader.java
core/trunk/impl/src/main/java/org/jboss/weld/xml/WeldXmlException.java
core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties
core/trunk/jboss-as/build.properties
core/trunk/jboss-tck-runner/pom.xml
core/trunk/porting-package/src/main/java/org/jboss/weld/tck/ELImpl.java
core/trunk/porting-package/src/main/java/org/jboss/weld/tck/ManagersImpl.java
core/trunk/tests/src/main/java/org/jboss/weld/mock/TestContainer.java
core/trunk/tests/src/main/java/org/jboss/weld/mock/cluster/AbstractClusterTest.java
core/trunk/tests/src/main/java/org/jboss/weld/mock/el/EL.java
core/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWeldTest.java
core/trunk/tests/src/main/java/org/jboss/weld/test/BeanManagerLocator.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/ActivitiesTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/child/SameBeanTypeInChildActivityTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/ELCurrentActivityTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/InstanceCurrentActivityTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/beanManager/serializability/ManagerTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/abstractDecorator/broken/SimpleAbstractDecoratorWithInvalidAbstractMethodTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/custom/CustomDecoratorTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/event/SimpleEventTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/passivation/broken/interceptorWithNonSerializableField/InterceptorWithNonSerializableFieldOnPassivatingBean.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/passivation/broken/nonSerializableInterceptor/NonPassivatingInterceptorOnPassivatingBean.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/cluster/NaiveClusterTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/extensions/NonBdaExtensionTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/nonTransitiveResolution/TransitiveResolutionTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/resolution/AccessibleManagerResolutionTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/environments/servlet/ServletEnvironmentTest.java
Log:
move Manager to own package, add cleanup for method handlers
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * Provides message localization service for the
- * {@link javax.enterprise.inject.AmbiguousResolutionException}.
- *
- * @author David Allen
- */
-public class AmbiguousResolutionException extends
javax.enterprise.inject.AmbiguousResolutionException
-{
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public AmbiguousResolutionException(Throwable throwable)
- {
- super(throwable);
- message = new WeldExceptionMessage(throwable.getLocalizedMessage());
- }
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> AmbiguousResolutionException(E key, Object...
args)
- {
- message = new WeldExceptionMessage(key, args);
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2010-01-08 12:25:43
UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2010-01-08 13:59:36
UTC (rev 5398)
@@ -1,1562 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld;
-
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.AMBIGUOUS_BEANS_FOR_DEPENDENCY;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.CONTEXT_NOT_ACTIVE;
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.DUPLICATE_ACTIVE_CONTEXTS;
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.DUPLICATE_INTERCEPTOR_BINDING;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.DUPLICATE_QUALIFIERS;
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.INTERCEPTOR_BINDINGS_EMPTY;
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.INTERCEPTOR_RESOLUTION_WITH_NONBINDING_TYPE;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.INVALID_QUALIFIER;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.NON_NORMAL_SCOPE;
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.NOT_INTERCEPTOR_BINDING_TYPE;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.NOT_PROXYABLE;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.NOT_STEREOTYPE;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.NO_DECORATOR_TYPES;
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.SPECIFIED_TYPE_NOT_BEAN_TYPE;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.TOO_MANY_ACTIVITIES;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.UNPROXYABLE_RESOLUTION;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.UNRESOLVABLE_ELEMENT;
-import static org.jboss.weld.logging.messages.BeanManagerMessage.UNRESOLVABLE_TYPE;
-
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Member;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Stack;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.el.ELResolver;
-import javax.el.ExpressionFactory;
-import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.Annotated;
-import javax.enterprise.inject.spi.AnnotatedType;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Decorator;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.InjectionTarget;
-import javax.enterprise.inject.spi.InterceptionType;
-import javax.enterprise.inject.spi.Interceptor;
-import javax.enterprise.inject.spi.ObserverMethod;
-import javax.enterprise.inject.spi.PassivationCapable;
-import javax.inject.Qualifier;
-
-import org.jboss.interceptor.registry.InterceptorRegistry;
-import org.jboss.weld.bean.NewBean;
-import org.jboss.weld.bean.RIBean;
-import org.jboss.weld.bean.SessionBean;
-import org.jboss.weld.bean.builtin.AbstractBuiltInBean;
-import org.jboss.weld.bean.builtin.ExtensionBean;
-import org.jboss.weld.bean.proxy.ClientProxyProvider;
-import org.jboss.weld.bootstrap.api.ServiceRegistry;
-import org.jboss.weld.bootstrap.events.AbstractProcessInjectionTarget;
-import org.jboss.weld.context.ContextNotActiveException;
-import org.jboss.weld.context.CreationalContextImpl;
-import org.jboss.weld.context.WeldCreationalContext;
-import org.jboss.weld.ejb.EjbDescriptors;
-import org.jboss.weld.ejb.spi.EjbDescriptor;
-import org.jboss.weld.el.Namespace;
-import org.jboss.weld.el.WeldELResolver;
-import org.jboss.weld.el.WeldExpressionFactory;
-import org.jboss.weld.introspector.WeldAnnotated;
-import org.jboss.weld.literal.AnyLiteral;
-import org.jboss.weld.manager.api.WeldManager;
-import org.jboss.weld.metadata.cache.MetaAnnotationStore;
-import org.jboss.weld.metadata.cache.ScopeModel;
-import org.jboss.weld.resolution.NameBasedResolver;
-import org.jboss.weld.resolution.Resolvable;
-import org.jboss.weld.resolution.ResolvableFactory;
-import org.jboss.weld.resolution.ResolvableWeldClass;
-import org.jboss.weld.resolution.TypeSafeBeanResolver;
-import org.jboss.weld.resolution.TypeSafeDecoratorResolver;
-import org.jboss.weld.resolution.TypeSafeInterceptorResolver;
-import org.jboss.weld.resolution.TypeSafeObserverResolver;
-import org.jboss.weld.resolution.TypeSafeResolver;
-import org.jboss.weld.resources.ClassTransformer;
-import org.jboss.weld.serialization.spi.ContextualStore;
-import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
-import org.jboss.weld.util.Beans;
-import org.jboss.weld.util.Observers;
-import org.jboss.weld.util.Proxies;
-import org.jboss.weld.util.reflection.HierarchyDiscovery;
-import org.jboss.weld.util.reflection.Reflections;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Iterators;
-import com.google.common.collect.ListMultimap;
-import com.google.common.collect.Multimaps;
-
-/**
- * Implementation of the Bean Manager.
- *
- * Essentially a singleton for registering Beans, Contexts, Observers,
- * Interceptors etc. as well as providing resolution
- *
- * @author Pete Muir
- * @author Marius Bogoevici
- */
-public class BeanManagerImpl implements WeldManager, Serializable
-{
-
-
- private static class CurrentActivity
- {
-
- private final Context context;
- private final BeanManagerImpl manager;
-
- public CurrentActivity(Context context, BeanManagerImpl manager)
- {
- this.context = context;
- this.manager = manager;
- }
-
- public Context getContext()
- {
- return context;
- }
-
- public BeanManagerImpl getManager()
- {
- return manager;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof CurrentActivity)
- {
- return this.getContext().equals(((CurrentActivity) obj).getContext());
- }
- else
- {
- return false;
- }
- }
-
- @Override
- public int hashCode()
- {
- return getContext().hashCode();
- }
-
- @Override
- public String toString()
- {
- return getContext() + " -> " + getManager();
- }
- }
-
- private static final long serialVersionUID = 3021562879133838561L;
-
- public static final InjectionPoint DUMMY_INJECTION_POINT = new InjectionPoint()
- {
-
- public boolean isTransient()
- {
- return true;
- }
-
- public boolean isDelegate()
- {
- return false;
- }
-
- public Type getType()
- {
- return InjectionPoint.class;
- }
-
- public Set<Annotation> getQualifiers()
- {
- return Collections.emptySet();
- }
-
- public Member getMember()
- {
- return null;
- }
-
- public Bean<?> getBean()
- {
- return null;
- }
-
- public Annotated getAnnotated()
- {
- return null;
- }
- };
-
- /*
- * Application scoped services
- * ***************************
- */
- private transient final ServiceRegistry services;
-
- /*
- * Application scoped data structures
- * ***********************************
- */
-
- // Contexts are shared across the application
- private transient final ListMultimap<Class<? extends Annotation>, Context>
contexts;
-
- // Client proxies can be used application wide
- private transient final ClientProxyProvider clientProxyProvider;
-
- // TODO review this structure
- private transient final Map<EjbDescriptor<?>, SessionBean<?>>
enterpriseBeans;
-
- // TODO This isn't right, specialization should follow accessibility rules, but I
think we can enforce these in resolve()
- private transient final Map<Contextual<?>, Contextual<?>>
specializedBeans;
-
- /*
- * Archive scoped data structures
- * ******************************
- */
-
- /* These data structures are all non-transitive in terms of bean deployment
- * archive accessibility, and the configuration for this bean deployment
- * archive
- */
- private transient Collection<Class<?>> enabledAlternativeClasses;
- private transient Collection<Class<? extends Annotation>>
enabledAlternativeStereotypes;
- private transient List<Class<?>> enabledDecoratorClasses;
- private transient List<Class<?>> enabledInterceptorClasses;
- private transient final Set<CurrentActivity> currentActivities;
-
- /*
- * Activity scoped services
- * *************************
- */
-
- /* These services are scoped to this activity only, but use data
- * structures that are transitive accessible from other bean deployment
- * archives
- */
- private transient final TypeSafeBeanResolver<Bean<?>> beanResolver;
- private transient final TypeSafeResolver<? extends Resolvable,
Decorator<?>> decoratorResolver;
- private transient final TypeSafeResolver<? extends Resolvable,
Interceptor<?>> interceptorResolver;
- private transient final TypeSafeResolver<? extends Resolvable,
ObserverMethod<?>> observerResolver;
- private transient final NameBasedResolver nameBasedResolver;
- private transient final ELResolver weldELResolver;
- private transient Namespace rootNamespace;
-
- /*
- * Activity scoped data structures
- * ********************************
- */
-
- /* These data structures are scoped to this bean deployment archive activity
- * only and represent the beans, decorators, interceptors, namespaces and
- * observers deployed in this bean deployment archive activity
- */
- private transient final List<Bean<?>> beans;
- private transient final List<Bean<?>> transitiveBeans;
- private transient final List<Decorator<?>> decorators;
- private transient final List<Interceptor<?>> interceptors;
- private transient final List<String> namespaces;
- private transient final List<ObserverMethod<?>> observers;
-
- /*
- * These data structures represent the managers *accessible* from this bean
- * deployment archive activity
- */
- private transient final HashSet<BeanManagerImpl> accessibleManagers;
-
- /*
- * This data structures represents child activities for this activity, it is
- * not transitively accessible
- */
- private transient final Set<BeanManagerImpl> childActivities;
-
- private final AtomicInteger childIds;
- private final String id;
-
- /*
- * Runtime data transfer
- * *********************
- */
- private transient final ThreadLocal<Stack<InjectionPoint>>
currentInjectionPoint;
-
- /**
- * Interception model
- */
- private transient final InterceptorRegistry<Class<?>,
SerializableContextual<Interceptor<?>, ?>> boundInterceptorsRegistry = new
InterceptorRegistry<Class<?>,
SerializableContextual<Interceptor<?>,?>>();
- private transient final InterceptorRegistry<Class<?>, Class<?>>
declaredInterceptorsRegistry = new InterceptorRegistry<Class<?>,
Class<?>>();
-
- /**
- * Create a new, root, manager
- *
- * @param serviceRegistry
- * @return
- */
- public static BeanManagerImpl newRootManager(String id, ServiceRegistry
serviceRegistry)
- {
- ListMultimap<Class<? extends Annotation>, Context> contexts =
Multimaps.newListMultimap(new ConcurrentHashMap<Class<? extends Annotation>,
Collection<Context>>(), new Supplier<List<Context>>()
- {
-
- public List<Context> get()
- {
- return new CopyOnWriteArrayList<Context>();
- }
-
- });
-
- return new BeanManagerImpl(
- serviceRegistry,
- new CopyOnWriteArrayList<Bean<?>>(),
- new CopyOnWriteArrayList<Bean<?>>(),
- new CopyOnWriteArrayList<Decorator<?>>(),
- new CopyOnWriteArrayList<Interceptor<?>>(),
- new CopyOnWriteArrayList<ObserverMethod<?>>(),
- new CopyOnWriteArrayList<String>(),
- new ConcurrentHashMap<EjbDescriptor<?>, SessionBean<?>>(),
- new ClientProxyProvider(),
- contexts,
- new CopyOnWriteArraySet<CurrentActivity>(),
- new HashMap<Contextual<?>, Contextual<?>>(),
- new ArrayList<Class<?>>(),
- new ArrayList<Class<? extends Annotation>>(),
- new ArrayList<Class<?>>(),
- new ArrayList<Class<?>>(),
- id,
- new AtomicInteger());
- }
-
- /**
- * Create a new, root, manager
- *
- * @param serviceRegistry
- * @return
- */
- public static BeanManagerImpl newManager(BeanManagerImpl rootManager, String id,
ServiceRegistry services)
- {
- return new BeanManagerImpl(
- services,
- new CopyOnWriteArrayList<Bean<?>>(),
- new CopyOnWriteArrayList<Bean<?>>(),
- new CopyOnWriteArrayList<Decorator<?>>(),
- new CopyOnWriteArrayList<Interceptor<?>>(),
- new CopyOnWriteArrayList<ObserverMethod<?>>(),
- new CopyOnWriteArrayList<String>(),
- rootManager.getEnterpriseBeans(),
- rootManager.getClientProxyProvider(),
- rootManager.getContexts(),
- new CopyOnWriteArraySet<CurrentActivity>(),
- new HashMap<Contextual<?>, Contextual<?>>(),
- new ArrayList<Class<?>>(),
- new ArrayList<Class<? extends Annotation>>(),
- new ArrayList<Class<?>>(),
- new ArrayList<Class<?>>(),
- id,
- new AtomicInteger());
- }
-
- /**
- * Create a new child manager
- *
- * @param parentManager
- * @return
- */
- public static BeanManagerImpl newChildActivityManager(BeanManagerImpl parentManager)
- {
- List<Bean<?>> beans = new CopyOnWriteArrayList<Bean<?>>();
- beans.addAll(parentManager.getBeans());
- List<Bean<?>> transitiveBeans = new
CopyOnWriteArrayList<Bean<?>>();
- beans.addAll(parentManager.getTransitiveBeans());
-
- List<ObserverMethod<?>> registeredObservers = new
CopyOnWriteArrayList<ObserverMethod<?>>();
- registeredObservers.addAll(parentManager.getObservers());
- List<String> namespaces = new CopyOnWriteArrayList<String>();
- namespaces.addAll(parentManager.getNamespaces());
-
- return new BeanManagerImpl(
- parentManager.getServices(),
- beans,
- transitiveBeans,
- parentManager.getDecorators(),
- parentManager.getInterceptors(),
- registeredObservers,
- namespaces,
- parentManager.getEnterpriseBeans(),
- parentManager.getClientProxyProvider(),
- parentManager.getContexts(),
- parentManager.getCurrentActivities(),
- parentManager.getSpecializedBeans(),
- parentManager.getEnabledAlternativeClasses(),
- parentManager.getEnabledAlternativeStereotypes(),
- parentManager.getEnabledDecoratorClasses(),
- parentManager.getEnabledInterceptorClasses(),
- new
StringBuilder().append(parentManager.getChildIds().incrementAndGet()).toString(),
- parentManager.getChildIds());
- }
-
- /**
- * Create a new manager
- * @param enabledDecoratorClasses
- *
- * @param ejbServices the ejbResolver to use
- */
- private BeanManagerImpl(
- ServiceRegistry serviceRegistry,
- List<Bean<?>> beans,
- List<Bean<?>> transitiveBeans,
- List<Decorator<?>> decorators,
- List<Interceptor<?>> interceptors,
- List<ObserverMethod<?>> observers,
- List<String> namespaces,
- Map<EjbDescriptor<?>, SessionBean<?>> enterpriseBeans,
- ClientProxyProvider clientProxyProvider,
- ListMultimap<Class<? extends Annotation>, Context> contexts,
- Set<CurrentActivity> currentActivities,
- Map<Contextual<?>, Contextual<?>> specializedBeans,
- Collection<Class<?>> enabledAlternativeClasses,
- Collection<Class<? extends Annotation>>
enabledAlternativeStereotypes,
- List<Class<?>> enabledDecoratorClasses,
- List<Class<?>> enabledInterceptorClasses,
- String id,
- AtomicInteger childIds)
- {
- this.services = serviceRegistry;
- this.beans = beans;
- this.transitiveBeans = transitiveBeans;
- this.decorators = decorators;
- this.interceptors = interceptors;
- this.enterpriseBeans = enterpriseBeans;
- this.clientProxyProvider = clientProxyProvider;
- this.contexts = contexts;
- this.currentActivities = currentActivities;
- this.specializedBeans = specializedBeans;
- this.observers = observers;
- this.enabledAlternativeClasses = enabledAlternativeClasses;
- this.enabledAlternativeStereotypes = enabledAlternativeStereotypes;
- setEnabledDecoratorClasses(enabledDecoratorClasses);
- setEnabledInterceptorClasses(enabledInterceptorClasses);
- this.namespaces = namespaces;
- this.id = id;
- this.childIds = new AtomicInteger();
-
- // Set up the structure to store accessible managers in
- this.accessibleManagers = new HashSet<BeanManagerImpl>();
-
-
-
- // TODO Currently we build the accessible bean list on the fly, we need to set it
in stone once bootstrap is finished...
- Transform<Bean<?>> beanTransform = new Transform.BeanTransform(this);
- this.beanResolver = new TypeSafeBeanResolver<Bean<?>>(this,
createDynamicAccessibleIterable(beanTransform));
- this.decoratorResolver = new TypeSafeDecoratorResolver(this,
createDynamicAccessibleIterable(Transform.DECORATOR_BEAN));
- this.interceptorResolver = new TypeSafeInterceptorResolver(this,
createDynamicAccessibleIterable(Transform.INTERCEPTOR_BEAN));
- this.observerResolver = new TypeSafeObserverResolver(this,
createDynamicAccessibleIterable(Transform.EVENT_OBSERVER));
- this.nameBasedResolver = new NameBasedResolver(this,
createDynamicAccessibleIterable(beanTransform));
- this.weldELResolver = new WeldELResolver(this);
- this.childActivities = new CopyOnWriteArraySet<BeanManagerImpl>();
-
- this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
- {
- @Override
- protected Stack<InjectionPoint> initialValue()
- {
- return new Stack<InjectionPoint>();
- }
- };
- }
-
- private <T> Set<Iterable<T>>
buildAccessibleClosure(Collection<BeanManagerImpl> hierarchy, Transform<T>
transform)
- {
- Set<Iterable<T>> result = new HashSet<Iterable<T>>();
- hierarchy.add(this);
- result.add(transform.transform(this));
- for (BeanManagerImpl beanManager : accessibleManagers)
- {
- // Only add if we aren't already in the tree (remove cycles)
- if (!hierarchy.contains(beanManager))
- {
- result.addAll(beanManager.buildAccessibleClosure(new
ArrayList<BeanManagerImpl>(hierarchy), transform));
- }
- }
- return result;
- }
-
- private <T> Iterable<T> createDynamicAccessibleIterable(final
Transform<T> transform)
- {
- return new Iterable<T>()
- {
-
- private Function<Iterable<T>, Iterator<T>> function = new
Function<Iterable<T>, Iterator<T>>()
- {
-
- public Iterator<T> apply(Iterable<T> iterable)
- {
- return iterable.iterator();
- }
-
- };
-
- public Iterator<T> iterator()
- {
- Set<Iterable<T>> iterable = buildAccessibleClosure(new
ArrayList<BeanManagerImpl>(), transform);
- return Iterators.concat(Iterators.transform(iterable.iterator(), function));
- }
-
- };
- }
-
- private <T> Iterable<T> createStaticAccessibleIterable(final
Transform<T> transform)
- {
- Set<Iterable<T>> iterable = buildAccessibleClosure(new
ArrayList<BeanManagerImpl>(), transform);
- return Iterables.concat(iterable);
- }
-
- private static interface Transform<T>
- {
-
- public static class BeanTransform implements Transform<Bean<?>>
- {
-
- private final BeanManagerImpl declaringBeanManager;
-
- public BeanTransform(BeanManagerImpl declaringBeanManager)
- {
- this.declaringBeanManager = declaringBeanManager;
- }
-
- public Iterable<Bean<?>> transform(BeanManagerImpl beanManager)
- {
- // New beans and built in beans aren't resolvable transitively
- if (beanManager.equals(declaringBeanManager))
- {
- return beanManager.getBeans();
- }
- else
- {
- return beanManager.getTransitiveBeans();
- }
- }
-
- };
-
- public static Transform<Decorator<?>> DECORATOR_BEAN = new
Transform<Decorator<?>>()
- {
-
- public Iterable<Decorator<?>> transform(BeanManagerImpl
beanManager)
- {
- return beanManager.getDecorators();
- }
-
- };
-
- public static Transform<Interceptor<?>> INTERCEPTOR_BEAN = new
Transform<Interceptor<?>>()
- {
-
- public Iterable<Interceptor<?>> transform(BeanManagerImpl
beanManager)
- {
- return beanManager.getInterceptors();
- }
-
- };
-
- public static Transform<ObserverMethod<?>> EVENT_OBSERVER = new
Transform<ObserverMethod<?>>()
- {
-
- public Iterable<ObserverMethod<?>> transform(BeanManagerImpl
beanManager)
- {
- return beanManager.getObservers();
- }
-
- };
-
- public static Transform<String> NAMESPACE = new Transform<String>()
- {
-
- public Iterable<String> transform(BeanManagerImpl beanManager)
- {
- return beanManager.getNamespaces();
- }
-
- };
-
- public Iterable<T> transform(BeanManagerImpl beanManager);
-
- }
-
- public void addAccessibleBeanManager(BeanManagerImpl accessibleBeanManager)
- {
- accessibleManagers.add(accessibleBeanManager);
- beanResolver.clear();
- }
-
- public void addBean(Bean<?> bean)
- {
- if (beans.contains(bean))
- {
- return;
- }
- if (bean.getClass().equals(SessionBean.class))
- {
- SessionBean<?> enterpriseBean = (SessionBean<?>) bean;
- enterpriseBeans.put(enterpriseBean.getEjbDescriptor(), enterpriseBean);
- }
- if (bean instanceof PassivationCapable)
- {
-
Container.instance().deploymentServices().get(ContextualStore.class).putIfAbsent(bean);
- }
- registerBeanNamespace(bean);
- for (BeanManagerImpl childActivity : childActivities)
- {
- childActivity.addBean(bean);
- }
- // New beans and most built in beans aren't resolvable transtively
- if (bean instanceof ExtensionBean || (!(bean instanceof NewBean) && !(bean
instanceof AbstractBuiltInBean<?>)))
- {
- this.transitiveBeans.add(bean);
- }
- this.beans.add(bean);
- beanResolver.clear();
- }
-
- public void addDecorator(Decorator<?> bean)
- {
- decorators.add(bean);
- getServices().get(ContextualStore.class).putIfAbsent(bean);
- decoratorResolver.clear();
- }
-
- public <T> Set<ObserverMethod<? super T>> resolveObserverMethods(T
event, Annotation... bindings)
- {
- Observers.checkEventObjectType(event);
- return this.<T>resolveObserverMethods(event.getClass(), bindings);
- }
-
- public void addInterceptor(Interceptor<?> bean)
- {
- interceptors.add(bean);
- getServices().get(ContextualStore.class).putIfAbsent(bean);
- interceptorResolver.clear();
- }
-
-
- @SuppressWarnings("unchecked")
- public <T> Set<ObserverMethod<? super T>>
resolveObserverMethods(Type eventType, Annotation... bindings)
- {
- checkBindingTypes(Arrays.asList(bindings));
- HashSet<Annotation> bindingAnnotations = new
HashSet<Annotation>(Arrays.asList(bindings));
- bindingAnnotations.add(new AnyLiteral());
- Set<ObserverMethod<? super T>> observers = new
HashSet<ObserverMethod<? super T>>();
- Set<ObserverMethod<?>> eventObservers =
observerResolver.resolve(ResolvableFactory.of(new
HierarchyDiscovery(eventType).getTypeClosure(), bindingAnnotations, null));
- for (ObserverMethod<?> observer : eventObservers)
- {
- observers.add((ObserverMethod<T>) observer);
- }
- return observers;
- }
-
- private void checkBindingTypes(Collection<Annotation> bindings)
- {
- HashSet<Annotation> bindingAnnotations = new
HashSet<Annotation>(bindings);
- for (Annotation annotation : bindings)
- {
- if
(!getServices().get(MetaAnnotationStore.class).getBindingTypeModel(annotation.annotationType()).isValid())
- {
- throw new ForbiddenArgumentException(INVALID_QUALIFIER, annotation);
- }
- }
- if (bindingAnnotations.size() < bindings.size())
- {
- throw new ForbiddenArgumentException(DUPLICATE_QUALIFIERS, bindings);
- }
-
- }
-
- /**
- * A collection of enabled alternative classes
- *
- */
- public Collection<Class<?>> getEnabledAlternativeClasses()
- {
- return Collections.unmodifiableCollection(enabledAlternativeClasses);
- }
-
- /**
- * @return the enabled alternative stereotypes
- */
- public Collection<Class<? extends Annotation>>
getEnabledAlternativeStereotypes()
- {
- return Collections.unmodifiableCollection(enabledAlternativeStereotypes);
- }
-
- public boolean isBeanEnabled(Bean<?> bean)
- {
- return Beans.isBeanEnabled(bean, getEnabledAlternativeClasses(),
getEnabledAlternativeStereotypes());
- }
-
- /**
- * @return the enabledDecoratorClasses
- */
- public List<Class<?>> getEnabledDecoratorClasses()
- {
- return Collections.unmodifiableList(enabledDecoratorClasses);
- }
-
- /**
- * @return the enabledInterceptorClasses
- */
- public List<Class<?>> getEnabledInterceptorClasses()
- {
- return Collections.unmodifiableList(enabledInterceptorClasses);
- }
-
- public void setEnabledAlternativeClasses(Collection<Class<?>>
enabledAlternativeClasses)
- {
- this.enabledAlternativeClasses = enabledAlternativeClasses;
- }
-
- public void setEnabledAlternativeStereotypes(Collection<Class<? extends
Annotation>> enabledAlternativeSterotypes)
- {
- this.enabledAlternativeStereotypes = enabledAlternativeSterotypes;
- }
-
- public void setEnabledDecoratorClasses(List<Class<?>>
enabledDecoratorClasses)
- {
- this.enabledDecoratorClasses = enabledDecoratorClasses;
- }
-
- public void setEnabledInterceptorClasses(List<Class<?>>
enabledInterceptorClasses)
- {
- this.enabledInterceptorClasses = enabledInterceptorClasses;
- }
-
- public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
- {
- return getBeans(ResolvableWeldClass.of(beanType, bindings, this), bindings);
- }
-
- public Set<Bean<?>> getBeans(WeldAnnotated<?, ?> element,
Annotation... bindings)
- {
- for (Annotation annotation : element.getAnnotations())
- {
- if
(!getServices().get(MetaAnnotationStore.class).getBindingTypeModel(annotation.annotationType()).isValid())
- {
- throw new ForbiddenArgumentException(INVALID_QUALIFIER, annotation);
- }
- }
-// for (Type type : element.getActualTypeArguments())
-// {
-// if (type instanceof WildcardType)
-// {
-// throw new IllegalArgumentException("Cannot resolve a type
parameterized with a wildcard " + element);
-// }
-// if (type instanceof TypeVariable<?>)
-// {
-// throw new IllegalArgumentException("Cannot resolve a type
parameterized with a type parameter " + element);
-// }
-// }
- if (bindings != null && bindings.length >
element.getMetaAnnotations(Qualifier.class).size())
- {
- throw new ForbiddenArgumentException(DUPLICATE_QUALIFIERS,
Arrays.asList(bindings));
- }
- return beanResolver.resolve(ResolvableFactory.of(element));
- }
-
- public Set<Bean<?>> getInjectableBeans(InjectionPoint injectionPoint)
- {
- boolean registerInjectionPoint =
!injectionPoint.getType().equals(InjectionPoint.class);
- try
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().push(injectionPoint);
- }
- // TODO Do this properly
- Set<Bean<?>> beans =
getBeans(ResolvableWeldClass.of(injectionPoint.getType(),
injectionPoint.getQualifiers().toArray(new Annotation[0]), this));
- Set<Bean<?>> injectableBeans = new HashSet<Bean<?>>();
- for (Bean<?> bean : beans)
- {
- if (!(bean instanceof Decorator || bean instanceof Interceptor))
- {
- injectableBeans.add(bean);
- }
- }
- return injectableBeans;
- }
- finally
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().pop();
- }
- }
- }
-
- protected void registerBeanNamespace(Bean<?> bean)
- {
- if (bean.getName() != null && bean.getName().indexOf('.') > 0)
- {
- namespaces.add(bean.getName().substring(0,
bean.getName().lastIndexOf('.')));
- }
- }
-
- /**
- * Gets the class-mapped beans. For internal use.
- *
- * @return The bean map
- */
- public Map<EjbDescriptor<?>, SessionBean<?>> getEnterpriseBeans()
- {
- return enterpriseBeans;
- }
-
- /**
- * The beans registered with the Web Bean manager which are resolvable. Does
- * not include interceptor and decorator beans
- *
- * @return The list of known beans
- */
- public List<Bean<?>> getBeans()
- {
- return Collections.unmodifiableList(beans);
- }
-
- private List<Bean<?>> getTransitiveBeans()
- {
- return Collections.unmodifiableList(transitiveBeans);
- }
-
- public List<Decorator<?>> getDecorators()
- {
- return Collections.unmodifiableList(decorators);
- }
-
- public List<Interceptor<?>> getInterceptors()
- {
- return Collections.unmodifiableList(interceptors);
- }
-
- public Iterable<Bean<?>> getAccessibleBeans()
- {
- return createDynamicAccessibleIterable(new Transform.BeanTransform(this));
- }
-
- public void addContext(Context context)
- {
- contexts.put(context.getScope(), context);
- }
-
- /**
- * Does the actual observer registration
- *
- * @param observer
-= */
- public void addObserver(ObserverMethod<?> observer)
- {
- //checkEventType(observer.getObservedType());
- observers.add(observer);
- for (BeanManagerImpl childActivity : childActivities)
- {
- childActivity.addObserver(observer);
- }
- }
-
- /**
- * Fires an event object with given event object for given bindings
- *
- * @param event The event object to pass along
- * @param bindings The binding types to match
- *
- * @see javax.enterprise.inject.spi.BeanManager#fireEvent(java.lang.Object,
- * java.lang.annotation.Annotation[])
- */
- public void fireEvent(Object event, Annotation... qualifiers)
- {
- fireEvent(event.getClass(), event, qualifiers);
- }
-
- public void fireEvent(Type eventType, Object event, Annotation... qualifiers)
- {
- Observers.checkEventObjectType(event);
- notifyObservers(event, resolveObserverMethods(eventType, qualifiers));
- }
-
- private <T> void notifyObservers(final T event, final Set<ObserverMethod<?
super T>> observers)
- {
- for (ObserverMethod<? super T> observer : observers)
- {
- observer.notify(event);
- }
- }
-
- /**
- * Gets an active context of the given scope. Throws an exception if there
- * are no active contexts found or if there are too many matches
- *
- * @param scopeType The scope to match
- * @return A single active context of the given scope
- *
- * @see javax.enterprise.inject.spi.BeanManager#getContext(java.lang.Class)
- */
- public Context getContext(Class<? extends Annotation> scopeType)
- {
- List<Context> activeContexts = new ArrayList<Context>();
- for (Context context : contexts.get(scopeType))
- {
- if (context.isActive())
- {
- activeContexts.add(context);
- }
- }
- if (activeContexts.isEmpty())
- {
- throw new ContextNotActiveException(CONTEXT_NOT_ACTIVE, scopeType.getName());
- }
- if (activeContexts.size() > 1)
- {
- throw new ForbiddenStateException(DUPLICATE_ACTIVE_CONTEXTS,
scopeType.getName());
- }
- return activeContexts.iterator().next();
-
- }
-
- public Object getReference(Bean<?> bean, CreationalContext<?>
creationalContext, boolean delegate)
- {
- bean = getMostSpecializedBean(bean);
- if (creationalContext instanceof WeldCreationalContext<?>)
- {
- creationalContext = ((WeldCreationalContext<?>)
creationalContext).getCreationalContext(bean);
- }
- if (!delegate && isProxyRequired(bean))
- {
- if (creationalContext != null || getContext(bean.getScope()).get(bean) != null)
- {
- return clientProxyProvider.getClientProxy(this, bean);
- }
- else
- {
- return null;
- }
- }
- else
- {
- return getContext(bean.getScope()).get((Contextual) bean, creationalContext);
- }
- }
-
- private boolean isProxyRequired(Bean<?> bean)
- {
- if
(getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal())
- {
- return true;
- }
- else if (bean instanceof RIBean<?>)
- {
- return ((RIBean<?>) bean).isProxyRequired();
- }
- else
- {
- return false;
- }
- }
-
- public Object getReference(Bean<?> bean, Type beanType,
CreationalContext<?> creationalContext)
- {
- if (!Reflections.isAssignableFrom(bean.getTypes(), beanType))
- {
- throw new ForbiddenArgumentException(SPECIFIED_TYPE_NOT_BEAN_TYPE, beanType,
bean );
- }
- return getReference(bean, creationalContext, false);
- }
-
-
- /**
- * Get a reference, registering the injection point used.
- *
- * @param injectionPoint the injection point to register
- * @param resolvedBean the bean to get a reference to
- * @param creationalContext the creationalContext
- * @return
- */
- public Object getReference(InjectionPoint injectionPoint, Bean<?> resolvedBean,
CreationalContext<?> creationalContext)
- {
- boolean registerInjectionPoint = (injectionPoint != null &&
!injectionPoint.getType().equals(InjectionPoint.class));
- boolean delegateInjectionPoint = injectionPoint != null &&
injectionPoint.isDelegate();
- try
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().push(injectionPoint);
- }
- if
(getServices().get(MetaAnnotationStore.class).getScopeModel(resolvedBean.getScope()).isNormal()
&& !Proxies.isTypeProxyable(injectionPoint.getType()))
- {
- throw new UnproxyableResolutionException(UNPROXYABLE_RESOLUTION,
resolvedBean, injectionPoint);
- }
- // TODO Can we move this logic to getReference?
- if (creationalContext instanceof WeldCreationalContext<?>)
- {
- WeldCreationalContext<?> wbCreationalContext =
(WeldCreationalContext<?>) creationalContext;
- if (wbCreationalContext.containsIncompleteInstance(resolvedBean))
- {
- return wbCreationalContext.getIncompleteInstance(resolvedBean);
- }
- else
- {
- return getReference(resolvedBean, wbCreationalContext,
delegateInjectionPoint);
- }
- }
- else
- {
- return getReference(resolvedBean, creationalContext,
delegateInjectionPoint);
- }
- }
- finally
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().pop();
- }
- }
- }
-
-
- public Object getInjectableReference(InjectionPoint injectionPoint,
CreationalContext<?> creationalContext)
- {
- WeldAnnotated<?, ?> element =
ResolvableWeldClass.of(injectionPoint.getType(),
injectionPoint.getQualifiers().toArray(new Annotation[0]), this);
- Bean<?> resolvedBean = getBean(element, element.getBindingsAsArray());
- return getReference(injectionPoint, resolvedBean, creationalContext);
- }
-
- /**
- * Returns an instance by API type and binding types
- *
- * @param beanType The API type to match
- * @param bindings The binding types to match
- * @return An instance of the bean
- *
- */
- @Deprecated
- public <T> T getInstanceByType(Class<T> beanType, Annotation... bindings)
- {
- Set<Bean<?>> beans = getBeans(beanType, bindings);
- Bean<?> bean = resolve(beans);
- if (bean == null)
- {
- throw new UnsatisfiedResolutionException(UNRESOLVABLE_TYPE, beanType,
Arrays.toString(bindings));
- }
- Object reference = getReference(bean, beanType, createCreationalContext(bean));
-
- @SuppressWarnings("unchecked")
- T instance = (T) reference;
-
- return instance;
- }
-
- public <T> Bean<T> getBean(WeldAnnotated<T, ?> element,
Annotation... bindings)
- {
- Bean<T> bean = (Bean<T>) resolve(getBeans(element, bindings));
- if (bean == null)
- {
- throw new UnsatisfiedResolutionException(UNRESOLVABLE_ELEMENT, element);
- }
-
- boolean normalScoped =
getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal();
- if (normalScoped && !Beans.isBeanProxyable(bean))
- {
- throw new UnproxyableResolutionException(NOT_PROXYABLE, bean);
- }
- return bean;
- }
-
- public Set<Bean<?>> getBeans(String name)
- {
- return nameBasedResolver.resolve(name);
- }
-
- /**
- * Resolves a list of decorators based on API types and binding types
- *
- * @param types The set of API types to match
- * @param bindings The binding types to match
- * @return A list of matching decorators
- *
- * @see javax.enterprise.inject.spi.BeanManager#resolveDecorators(java.util.Set,
- * java.lang.annotation.Annotation[])
- */
- public List<Decorator<?>> resolveDecorators(Set<Type> types,
Annotation... bindings)
- {
- checkResolveDecoratorsArguments(types, Arrays.asList(bindings));
- // TODO Fix this cast and make the resolver return a list
- return new
ArrayList<Decorator<?>>(decoratorResolver.resolve(ResolvableFactory.of(types,
null, bindings)));
- }
-
- public List<Decorator<?>> resolveDecorators(Set<Type> types,
Set<Annotation> bindings)
- {
- checkResolveDecoratorsArguments(types, bindings);
- // TODO Fix this cast and make the resolver return a list
- return new
ArrayList<Decorator<?>>(decoratorResolver.resolve(ResolvableFactory.of(types,
bindings, null)));
- }
-
- private void checkResolveDecoratorsArguments(Set<Type> types,
Collection<Annotation> bindings)
- {
- if (types.isEmpty())
- {
- throw new ForbiddenArgumentException(NO_DECORATOR_TYPES);
- }
- checkBindingTypes(bindings);
- }
-
- /**
- * Resolves a list of interceptors based on interception type and interceptor
- * bindings
- *
- * @param type The interception type to resolve
- * @param interceptorBindings The binding types to match
- * @return A list of matching interceptors
- *
- * @see
javax.enterprise.inject.spi.BeanManager#resolveInterceptors(javax.enterprise.inject.spi.InterceptionType,
- * java.lang.annotation.Annotation[])
- */
- public List<Interceptor<?>> resolveInterceptors(InterceptionType type,
Annotation... interceptorBindings)
- {
- if (interceptorBindings.length == 0)
- throw new ForbiddenArgumentException(INTERCEPTOR_BINDINGS_EMPTY);
- Set<Class<?>> uniqueInterceptorBindings = new
HashSet<Class<?>>();
- for (Annotation interceptorBinding: interceptorBindings)
- {
- if (uniqueInterceptorBindings.contains(interceptorBinding.annotationType()))
- throw new ForbiddenArgumentException(DUPLICATE_INTERCEPTOR_BINDING,
interceptorBinding.annotationType());
- if (!isInterceptorBinding(interceptorBinding.annotationType()))
- throw new
ForbiddenArgumentException(INTERCEPTOR_RESOLUTION_WITH_NONBINDING_TYPE,
interceptorBinding.annotationType());
- uniqueInterceptorBindings.add(interceptorBinding.annotationType());
- }
- return new
ArrayList<Interceptor<?>>(interceptorResolver.resolve(ResolvableFactory.of(type,interceptorBindings)));
- }
-
- /**
- * Get the web bean resolver. For internal use
- *
- * @return The resolver
- */
- public TypeSafeBeanResolver<Bean<?>> getBeanResolver()
- {
- return beanResolver;
- }
-
- /**
- * Gets a string representation
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("Manager\n");
- buffer.append("Enabled alternatives: " + getEnabledAlternativeClasses() +
" " + getEnabledAlternativeStereotypes() + "\n");
- buffer.append("Registered contexts: " + contexts.keySet() +
"\n");
- buffer.append("Registered beans: " + getBeans().size() +
"\n");
- buffer.append("Specialized beans: " + specializedBeans.size() +
"\n");
- return buffer.toString();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj instanceof BeanManagerImpl)
- {
- BeanManagerImpl that = (BeanManagerImpl) obj;
- return this.getId().equals(that.getId());
- }
- else
- {
- return false;
- }
- }
-
- @Override
- public int hashCode()
- {
- return getId().hashCode();
- }
-
- public BeanManagerImpl createActivity()
- {
- BeanManagerImpl childActivity = newChildActivityManager(this);
- childActivities.add(childActivity);
- Container.instance().addActivity(childActivity);
- return childActivity;
- }
-
- public BeanManagerImpl setCurrent(Class<? extends Annotation> scopeType)
- {
- if
(!getServices().get(MetaAnnotationStore.class).getScopeModel(scopeType).isNormal())
- {
- throw new ForbiddenArgumentException(NON_NORMAL_SCOPE, scopeType);
- }
- currentActivities.add(new CurrentActivity(getContext(scopeType), this));
- return this;
- }
-
- public BeanManagerImpl getCurrent()
- {
- List<CurrentActivity> activeCurrentActivities = new
ArrayList<CurrentActivity>();
- for (CurrentActivity currentActivity : currentActivities)
- {
- if (currentActivity.getContext().isActive())
- {
- activeCurrentActivities.add(currentActivity);
- }
- }
- if (activeCurrentActivities.size() == 0)
- {
- return this;
- }
- else if (activeCurrentActivities.size() == 1)
- {
- return activeCurrentActivities.get(0).getManager();
- }
- throw new ForbiddenStateException(TOO_MANY_ACTIVITIES, currentActivities);
- }
-
- public ServiceRegistry getServices()
- {
- return services;
- }
-
- /**
- * The injection point being operated on for this thread
- *
- * @return the current injection point
- */
- public InjectionPoint getCurrentInjectionPoint()
- {
- if (!currentInjectionPoint.get().empty())
- {
- return currentInjectionPoint.get().peek();
- }
- else
- {
- return null;
- }
- }
-
- /**
- * Replaces (or adds) the current injection point. If a current injection
- * point exists, it will be replaced. If no current injection point exists,
- * one will be added.
- *
- * @param injectionPoint the injection point to use
- * @return the injection point added, or null if non previous existed
- */
- public InjectionPoint replaceOrPushCurrentInjectionPoint(InjectionPoint
injectionPoint)
- {
- InjectionPoint originalInjectionPoint = null;
- if (!currentInjectionPoint.get().empty())
- {
- originalInjectionPoint = currentInjectionPoint.get().pop();
- }
- currentInjectionPoint.get().push(injectionPoint);
- return originalInjectionPoint;
- }
-
- public void pushDummyInjectionPoint()
- {
- currentInjectionPoint.get().push(DUMMY_INJECTION_POINT);
- }
-
- public void popDummyInjectionPoint()
- {
- if (!currentInjectionPoint.get().isEmpty() &&
DUMMY_INJECTION_POINT.equals(currentInjectionPoint.get().peek()))
- {
- currentInjectionPoint.get().pop();
- }
- }
-
- /**
- *
- * @return
- */
- public Map<Contextual<?>, Contextual<?>> getSpecializedBeans()
- {
- // TODO make this unmodifiable after deploy!
- return specializedBeans;
- }
-
- // Serialization
-
- protected Object readResolve()
- {
- return Container.instance().activityManager(id);
- }
-
- protected ClientProxyProvider getClientProxyProvider()
- {
- return clientProxyProvider;
- }
-
- protected ListMultimap<Class<? extends Annotation>, Context>
getContexts()
- {
- return contexts;
- }
-
- /**
- * @return the namespaces
- */
- protected List<String> getNamespaces()
- {
- return namespaces;
- }
-
- public Iterable<String> getAccessibleNamespaces()
- {
- // TODO Cache this
- return createDynamicAccessibleIterable(Transform.NAMESPACE);
- }
-
- private Set<CurrentActivity> getCurrentActivities()
- {
- return currentActivities;
- }
-
- public String getId()
- {
- return id;
- }
-
- public AtomicInteger getChildIds()
- {
- return childIds;
- }
-
- public List<ObserverMethod<?>> getObservers()
- {
- return observers;
- }
-
- public Namespace getRootNamespace()
- {
- // TODO I don't like this lazy init
- if (rootNamespace == null)
- {
- rootNamespace = new
Namespace(createDynamicAccessibleIterable(Transform.NAMESPACE));
- }
- return rootNamespace;
- }
-
- public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T>
type)
- {
- return new
SimpleInjectionTarget<T>(getServices().get(ClassTransformer.class).loadClass(type),
this);
- }
-
- public <T> InjectionTarget<T> createInjectionTarget(EjbDescriptor<T>
descriptor)
- {
- return getBean(descriptor).getInjectionTarget();
- }
-
- public <X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean)
- {
- Contextual<?> key = bean;
- while (specializedBeans.containsKey(key))
- {
- if (key == null)
- {
- System.out.println("null key " + bean);
- }
- key = specializedBeans.get(key);
- }
- return (Bean<X>) key;
- }
-
- public void validate(InjectionPoint ij)
- {
- try
- {
- getServices().get(Validator.class).validateInjectionPoint(ij, this);
- }
- catch (DeploymentException e)
- {
- throw new InjectionException(e.getLocalizedMessage(), e.getCause());
- }
- }
-
- public Set<Annotation> getInterceptorBindingDefinition(Class<? extends
Annotation> bindingType)
- {
- if
(getServices().get(MetaAnnotationStore.class).getInterceptorBindingModel(bindingType).isValid())
- {
- return
getServices().get(MetaAnnotationStore.class).getInterceptorBindingModel(bindingType).getMetaAnnotations();
- }
- else
- {
- throw new ForbiddenArgumentException(NOT_INTERCEPTOR_BINDING_TYPE,
bindingType);
- }
- }
-
- public Bean<?> getPassivationCapableBean(String id)
- {
- return getServices().get(ContextualStore.class).<Bean<Object>,
Object>getContextual(id);
- }
-
- public Set<Annotation> getStereotypeDefinition(Class<? extends Annotation>
stereotype)
- {
- if
(getServices().get(MetaAnnotationStore.class).getStereotype(stereotype).isValid())
- {
- return
getServices().get(MetaAnnotationStore.class).getStereotype(stereotype).getMetaAnnotations();
- }
- else
- {
- throw new ForbiddenArgumentException(NOT_STEREOTYPE, stereotype);
- }
- }
-
- public boolean isQualifier(Class<? extends Annotation> annotationType)
- {
- return
getServices().get(MetaAnnotationStore.class).getBindingTypeModel(annotationType).isValid();
- }
-
- public boolean isInterceptorBinding(Class<? extends Annotation> annotationType)
- {
- return
getServices().get(MetaAnnotationStore.class).getInterceptorBindingModel(annotationType).isValid();
- }
-
- public boolean isNormalScope(Class<? extends Annotation> annotationType)
- {
- ScopeModel<?> scope =
getServices().get(MetaAnnotationStore.class).getScopeModel(annotationType);
- return scope.isValid() && scope.isNormal();
- }
-
- public boolean isPassivatingScope(Class<? extends Annotation> annotationType)
- {
- ScopeModel<?> scope =
getServices().get(MetaAnnotationStore.class).getScopeModel(annotationType);
- return scope.isValid() && scope.isPassivating();
- }
-
- public boolean isScope(Class<? extends Annotation> annotationType)
- {
- return
getServices().get(MetaAnnotationStore.class).getScopeModel(annotationType).isValid();
- }
-
- public boolean isStereotype(Class<? extends Annotation> annotationType)
- {
- return
getServices().get(MetaAnnotationStore.class).getStereotype(annotationType).isValid();
- }
-
- public ELResolver getELResolver()
- {
- return weldELResolver;
- }
-
- public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory)
- {
- return new WeldExpressionFactory(expressionFactory);
- }
-
- public <T> WeldCreationalContext<T>
createCreationalContext(Contextual<T> contextual)
- {
- return new CreationalContextImpl<T>(contextual);
- }
-
- public <T> AnnotatedType<T> createAnnotatedType(Class<T> type)
- {
- return getServices().get(ClassTransformer.class).loadClass(type);
- }
-
- public <X> Bean<? extends X> resolve(Set<Bean<? extends X>>
beans)
- {
- Set<Bean<? extends X>> resolvedBeans = beanResolver.resolve(beans);
- if (resolvedBeans.size() == 0)
- {
- return null;
- }
- if (resolvedBeans.size() == 1)
- {
- return resolvedBeans.iterator().next();
- }
- else
- {
- throw new AmbiguousResolutionException(AMBIGUOUS_BEANS_FOR_DEPENDENCY, beans);
- }
- }
-
- public <T> EjbDescriptor<T> getEjbDescriptor(String beanName)
- {
- return getServices().get(EjbDescriptors.class).get(beanName);
- }
-
- public <T> SessionBean<T> getBean(EjbDescriptor<T> descriptor)
- {
- return (SessionBean<T>) getEnterpriseBeans().get(descriptor);
- }
-
- public void cleanup()
- {
- services.cleanup();
- this.currentInjectionPoint.remove();
- this.accessibleManagers.clear();
- this.beanResolver.clear();
- this.beans.clear();
- this.childActivities.clear();
- this.clientProxyProvider.clear();
- this.contexts.clear();
- this.currentActivities.clear();
- this.decoratorResolver.clear();
- this.decorators.clear();
- this.enabledDecoratorClasses.clear();
- this.enabledInterceptorClasses.clear();
- this.enabledAlternativeClasses.clear();
- this.enabledAlternativeStereotypes.clear();
- this.enterpriseBeans.clear();
- this.interceptorResolver.clear();
- this.interceptors.clear();
- this.nameBasedResolver.clear();
- this.namespaces.clear();
- this.observerResolver.clear();
- this.observers.clear();
- this.specializedBeans.clear();
- }
-
- public InterceptorRegistry<Class<?>,
SerializableContextual<Interceptor<?>, ?>> getCdiInterceptorsRegistry()
- {
- return boundInterceptorsRegistry;
- }
-
- public InterceptorRegistry<Class<?>, Class<?>>
getClassDeclaredInterceptorsRegistry()
- {
- return declaredInterceptorsRegistry;
- }
-
- public <X> InjectionTarget<X>
fireProcessInjectionTarget(AnnotatedType<X> annotatedType)
- {
- return AbstractProcessInjectionTarget.fire(this, annotatedType,
createInjectionTarget(annotatedType));
- }
-}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/Container.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/Container.java 2010-01-08 12:25:43 UTC
(rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/Container.java 2010-01-08 13:59:36 UTC
(rev 5398)
@@ -27,8 +27,10 @@
import org.jboss.weld.bootstrap.api.Singleton;
import org.jboss.weld.bootstrap.api.SingletonProvider;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.logging.LoggerFactory;
import org.jboss.weld.logging.MessageConveyorFactory;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* A Weld application container
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/CreationException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/CreationException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/CreationException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,72 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * A version of {@link javax.enterprise.inject.CreationException} that supports
- * message localization.
- *
- * @author David Allen
- */
-public class CreationException extends javax.enterprise.inject.CreationException
-{
-
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> CreationException(E key, Object... args)
- {
- message = new WeldExceptionMessage(key, args);
- }
-
- /**
- * Creates a new exception with the given localized message key, the cause
- * for this exception and optional arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param throwable The cause for this exception
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> CreationException(E key, Throwable throwable,
Object... args)
- {
- super(throwable);
- message = new WeldExceptionMessage(key, args);
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/DefinitionException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/DefinitionException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/DefinitionException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,79 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld;
-
-import java.util.List;
-
-/**
- * Thrown if the definition of a bean is incorrect
- *
- * @author Pete Muir
- */
-public class DefinitionException extends WeldException
-{
- private static final long serialVersionUID = 8014646336322875707L;
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> DefinitionException(E key, Object... args)
- {
- super(key, args);
- }
-
- /**
- * Creates a new exception with the given localized message key, the cause
- * for this exception and optional arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param throwable The cause for this exception
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> DefinitionException(E key, Throwable throwable,
Object... args)
- {
- super(throwable);
- }
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public DefinitionException(Throwable throwable)
- {
- super(throwable);
- }
-
- /**
- * Creates a new exception based on a list of throwables. The throwables are not
- * used as the cause, but the message from each throwable is included as the message
- * for this exception.
- *
- * @param errors A list of throwables to use in the message
- */
- public DefinitionException(List<Throwable> errors)
- {
- super(errors);
- }
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/DeploymentException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/DeploymentException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/DeploymentException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,78 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld;
-
-import java.util.List;
-
-/**
- * Thrown if an deployment exception occurs.
- *
- * @author Pete Muir
- */
-public class DeploymentException extends WeldException
-{
- private static final long serialVersionUID = 8014646336322875707L;
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> DeploymentException(E key, Object... args)
- {
- super(key, args);
- }
-
- /**
- * Creates a new exception with the given localized message key, the cause
- * for this exception and optional arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param throwable The cause for this exception
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> DeploymentException(E key, Throwable throwable,
Object... args)
- {
- super(key, throwable, args);
- }
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public DeploymentException(Throwable throwable)
- {
- super(throwable);
- }
-
- /**
- * Creates a new exception based on a list of throwables. The throwables are not
- * used as the cause, but the message from each throwable is included as the message
- * for this exception.
- *
- * @param errors A list of throwables to use in the message
- */
- public DeploymentException(List<Throwable> errors)
- {
- super(errors);
- }
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenArgumentException.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenArgumentException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenArgumentException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * This exception is used when the specification calls for an
- * {@link java.lang.IllegalArgumentException}.
- *
- * @author David Allen
- */
-public class ForbiddenArgumentException extends IllegalArgumentException
-{
-
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public ForbiddenArgumentException(Throwable throwable)
- {
- super(throwable);
- message = new WeldExceptionMessage(throwable.getLocalizedMessage());
- }
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> ForbiddenArgumentException(E key, Object...
args)
- {
- message = new WeldExceptionMessage(key, args);
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenStateException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenStateException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenStateException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * This exception is used when the specification calls for an
- * {@link java.lang.IllegalStateException}.
- *
- * @author David Allen
- */
-public class ForbiddenStateException extends IllegalStateException
-{
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> ForbiddenStateException(E key, Object... args)
- {
- message = new WeldExceptionMessage(key, args);
- }
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public ForbiddenStateException(Throwable cause)
- {
- super(cause.getLocalizedMessage(), cause);
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/IllegalProductException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/IllegalProductException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/IllegalProductException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * An {@link javax.enterprise.inject.IllegalProductException} with support for
- * localized messages in Weld.
- *
- * @author David Allen
- */
-public class IllegalProductException extends
javax.enterprise.inject.IllegalProductException
-{
-
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> IllegalProductException(E key, Object... args)
- {
- message = new WeldExceptionMessage(key, args);
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-}
Deleted:
core/trunk/impl/src/main/java/org/jboss/weld/InconsistentSpecializationException.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/InconsistentSpecializationException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/InconsistentSpecializationException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,54 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld;
-
-
-/**
- *
- * @author Pete Muir
- */
-public class InconsistentSpecializationException extends DeploymentException
-{
-
- private static final long serialVersionUID = 4359656880524913555L;
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> InconsistentSpecializationException(E key,
Object... args)
- {
- super(key, args);
- }
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public InconsistentSpecializationException(Throwable throwable)
- {
- super(throwable);
- }
-
-
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * Provides message localization service for the
- * {@link javax.enterprise.inject.InjectionException}.
- *
- * @author David Allen
- */
-public class InjectionException extends javax.enterprise.inject.InjectionException
-{
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public InjectionException(Throwable throwable)
- {
- super(throwable);
- message = new WeldExceptionMessage(throwable.getLocalizedMessage());
- }
-
- /**
- * Creates a new exception with an arbitrary message and the cause of the
- * exception. It is not recommended to use this constructor since the message
- * cannot be localized.
- *
- * @param message The error message
- * @param throwable The cause of the exception or wrapped throwable
- */
- public InjectionException(String message, Throwable throwable)
- {
- super(throwable);
- this.message = new WeldExceptionMessage(message);
- }
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> InjectionException(E key, Object... args)
- {
- message = new WeldExceptionMessage(key, args);
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/InvalidObjectException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/InvalidObjectException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/InvalidObjectException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * An extended version of {@link java.io.InvalidObjectException} that supports
- * localization.
- *
- * @author David Allen
- */
-public class InvalidObjectException extends java.io.InvalidObjectException
-{
-
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> InvalidObjectException(E key, Object... args)
- {
- super(null);
- message = new WeldExceptionMessage(key, args);
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/InvalidOperationException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/InvalidOperationException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/InvalidOperationException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * An exception used for unsupported operations or invocations of operations
- * that are invalid in certain contexts.
- *
- * @author David Allen
- */
-public class InvalidOperationException extends UnsupportedOperationException
-{
-
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with no message. Here the stacktrace serves as the
- * main information since it has the method which was invoked causing this
- * exception.
- */
- public InvalidOperationException()
- {
- super();
- }
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> InvalidOperationException(E key, Object...
args)
- {
- message = new WeldExceptionMessage(key, args);
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/Logger.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/Logger.java 2010-01-08 12:25:43 UTC (rev
5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/Logger.java 2010-01-08 13:59:36 UTC (rev
5398)
@@ -1,51 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld;
-
-/**
- * @author pmuir
- *
- */
-public interface Logger {
-
- public enum LogMessages {
-
- WRONG_PASSWORD
-
- }
-
- public static class Test {
-
- public void test()
- {
- Logger logger = new Logger()
- {
-
- public void warn(Enum<?> message)
- {
- // No-op, this is a mock
- }
-
- };
- logger.warn(LogMessages.WRONG_PASSWORD);
- }
-
- }
-
- public void warn(Enum<?> message);
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/NullInstanceException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/NullInstanceException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/NullInstanceException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * This exception occurs in cases where an object instance was expected, but
- * the reference was null. A typical example is with a producer method that
- * is not allowed to return null.
- *
- * @author David Allen
- *
- */
-public class NullInstanceException extends WeldException
-{
-
- private static final long serialVersionUID = 1L;
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> NullInstanceException(E key, Object... args)
- {
- super(key, args);
- }
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/NullableDependencyException.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/NullableDependencyException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/NullableDependencyException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld;
-
-
-/**
- * Thrown if an injection point of primitive type resolves to a bean which may
- * be null
- *
- * @author Pete Muir
- */
-public class NullableDependencyException extends DeploymentException
-{
-
- private static final long serialVersionUID = 6877485218767005761L;
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> NullableDependencyException(E key, Object...
args)
- {
- super(key, args);
- }
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public NullableDependencyException(Throwable throwable)
- {
- super(throwable);
- }
-
-
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,166 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld;
-
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.ERROR_INVOKING_POST_CONSTRUCT;
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.ERROR_INVOKING_PRE_DESTROY;
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.INJECTION_ON_NON_CONTEXTUAL;
-import static
org.jboss.weld.logging.messages.BeanManagerMessage.MISSING_BEAN_CONSTRUCTOR_FOUND;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.InjectionTarget;
-
-import org.jboss.weld.injection.ConstructorInjectionPoint;
-import org.jboss.weld.injection.FieldInjectionPoint;
-import org.jboss.weld.injection.InjectionContextImpl;
-import org.jboss.weld.injection.MethodInjectionPoint;
-import org.jboss.weld.injection.WeldInjectionPoint;
-import org.jboss.weld.introspector.WeldClass;
-import org.jboss.weld.introspector.WeldMethod;
-import org.jboss.weld.util.Beans;
-
-/**
- * @author pmuir
- *
- */
-public class SimpleInjectionTarget<T> implements InjectionTarget<T>
-{
-
- private final BeanManagerImpl beanManager;
- private final WeldClass<T> type;
- private final ConstructorInjectionPoint<T> constructor;
- private final List<Set<FieldInjectionPoint<?, ?>>>
injectableFields;
- private final List<Set<MethodInjectionPoint<?, ?>>>
initializerMethods;
- private final WeldMethod<?, ?> postConstruct;
- private final WeldMethod<?, ?> preDestroy;
- private final Set<InjectionPoint> injectionPoints;
- private final Set<WeldInjectionPoint<?, ?>> ejbInjectionPoints;
- private final Set<WeldInjectionPoint<?, ?>>
persistenceContextInjectionPoints;
- private final Set<WeldInjectionPoint<?, ?>>
persistenceUnitInjectionPoints;
- private final Set<WeldInjectionPoint<?, ?>> resourceInjectionPoints;
-
- public SimpleInjectionTarget(WeldClass<T> type, BeanManagerImpl beanManager)
- {
- this.beanManager = beanManager;
- this.type = type;
- this.injectionPoints = new HashSet<InjectionPoint>();
- ConstructorInjectionPoint<T> constructor = null;
- try
- {
- constructor = Beans.getBeanConstructor(null, type);
- this.injectionPoints.addAll(Beans.getParameterInjectionPoints(null,
constructor));
- }
- catch (Exception e)
- {
- // this means the bean of a type that cannot be produce()d, but that is
non-fatal
- // unless someone calls produce()
- }
- this.constructor = constructor;
- this.injectableFields = Beans.getFieldInjectionPoints(null, type);
- this.injectionPoints.addAll(Beans.getFieldInjectionPoints(null,
this.injectableFields));
- this.initializerMethods = Beans.getInitializerMethods(null, type);
- this.injectionPoints.addAll(Beans.getParameterInjectionPoints(null,
initializerMethods));
- this.postConstruct = Beans.getPostConstruct(type);
- this.preDestroy = Beans.getPreDestroy(type);
- this.ejbInjectionPoints = Beans.getEjbInjectionPoints(null, type, beanManager);
- this.persistenceContextInjectionPoints =
Beans.getPersistenceContextInjectionPoints(null, type, beanManager);
- this.persistenceUnitInjectionPoints = Beans.getPersistenceUnitInjectionPoints(null,
type, beanManager);
- this.resourceInjectionPoints = Beans.getResourceInjectionPoints(null, type,
beanManager);
- for (InjectionPoint ip : this.injectionPoints)
- {
- if (ip.getType().equals(InjectionPoint.class))
- {
- throw new DefinitionException(INJECTION_ON_NON_CONTEXTUAL, type, ip);
- }
- }
- }
-
- public T produce(CreationalContext<T> ctx)
- {
- if (constructor == null)
- {
- // this means we couldn't find a constructor on instantiation, which
- // means there isn't one that's spec-compliant
- // try again so the correct DefinitionException is thrown
- Beans.getBeanConstructor(null, type);
- // should not be reached
- throw new ForbiddenStateException(MISSING_BEAN_CONSTRUCTOR_FOUND);
- }
- return constructor.newInstance(beanManager, ctx);
- }
-
- public void inject(final T instance, final CreationalContext<T> ctx)
- {
- new InjectionContextImpl<T>(beanManager, this, instance)
- {
-
- public void proceed()
- {
- Beans.injectEEFields(instance, beanManager, ejbInjectionPoints,
persistenceContextInjectionPoints, persistenceUnitInjectionPoints,
resourceInjectionPoints);
- Beans.injectFieldsAndInitializers(instance, ctx, beanManager,
injectableFields, initializerMethods);
- }
-
- }.run();
-
- }
-
- public void postConstruct(T instance)
- {
- if (postConstruct == null)
- return;
-
- try
- {
- postConstruct.invoke(instance);
- }
- catch (Exception e)
- {
- throw new WeldException(ERROR_INVOKING_POST_CONSTRUCT, e, postConstruct);
- }
- }
-
- public void preDestroy(T instance)
- {
- if (preDestroy == null)
- return;
-
- try
- {
- preDestroy.invoke(instance);
- }
- catch (Exception e)
- {
- throw new WeldException(ERROR_INVOKING_PRE_DESTROY, e, preDestroy);
- }
- }
-
- public void dispose(T instance)
- {
- // No-op
- }
-
- public Set<InjectionPoint> getInjectionPoints()
- {
- return injectionPoints;
- }
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/SingleThreadExecutorServices.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/SingleThreadExecutorServices.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/SingleThreadExecutorServices.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,70 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import org.jboss.weld.manager.api.ExecutorServices;
-
-/**
- * @author pmuir
- *
- */
-public class SingleThreadExecutorServices implements ExecutorServices
-{
-
- private transient final ExecutorService taskExecutor =
Executors.newSingleThreadExecutor();
-
-
- /**
- * Provides access to the executor service used for asynchronous tasks.
- *
- * @return the ExecutorService for this manager
- */
- public ExecutorService getTaskExecutor()
- {
- return taskExecutor;
- }
-
- public void cleanup()
- {
- taskExecutor.shutdown();
- try
- {
- // Wait a while for existing tasks to terminate
- if (!taskExecutor.awaitTermination(60, TimeUnit.SECONDS))
- {
- taskExecutor.shutdownNow(); // Cancel currently executing tasks
- // Wait a while for tasks to respond to being cancelled
- if (!taskExecutor.awaitTermination(60, TimeUnit.SECONDS))
- {
- // Log the error here
- }
- }
- }
- catch (InterruptedException ie)
- {
- // (Re-)Cancel if current thread also interrupted
- taskExecutor.shutdownNow();
- // Preserve interrupt status
- Thread.currentThread().interrupt();
- }
- }
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * Provides message localization service for the
- * {@link javax.enterprise.inject.UnproxyableResolutionException}.
- *
- * @author David Allen
- */
-public class UnproxyableResolutionException extends
javax.enterprise.inject.UnproxyableResolutionException
-{
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public UnproxyableResolutionException(Throwable throwable)
- {
- super(throwable);
- message = new WeldExceptionMessage(throwable.getLocalizedMessage());
- }
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> UnproxyableResolutionException(E key, Object...
args)
- {
- message = new WeldExceptionMessage(key, args);
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-/**
- * Provides message localization service for the
- * {@link javax.enterprise.inject.UnsatisfiedResolutionException}.
- *
- * @author David Allen
- */
-public class UnsatisfiedResolutionException extends
javax.enterprise.inject.UnsatisfiedResolutionException
-{
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public UnsatisfiedResolutionException(Throwable throwable)
- {
- super(throwable);
- message = new WeldExceptionMessage(throwable.getLocalizedMessage());
- }
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> UnsatisfiedResolutionException(E key, Object...
args)
- {
- message = new WeldExceptionMessage(key, args);
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-
-}
Deleted:
core/trunk/impl/src/main/java/org/jboss/weld/UnserializableDependencyException.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/UnserializableDependencyException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/UnserializableDependencyException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld;
-
-
-
-/**
- * Thrown if a simple bean is dependent scoped and injected into a stateful
- * session bean, into a non-transient field, bean constructor parameter or
- * initializer method parameter of a bean which declares a passivating scope, or
- * into a parameter of a producer method which declares a passivating scope
- *
- * @author Pete Muir
- */
-public class UnserializableDependencyException extends DeploymentException
-{
-
- private static final long serialVersionUID = -6287506607413810688L;
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> UnserializableDependencyException(E key,
Object... args)
- {
- super(key, args);
- }
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public UnserializableDependencyException(Throwable throwable)
- {
- super(throwable);
- }
-
-
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/Validator.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/Validator.java 2010-01-08 12:25:43 UTC
(rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/Validator.java 2010-01-08 13:59:36 UTC
(rev 5398)
@@ -1,462 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.weld;
-
-import static
org.jboss.weld.logging.messages.ValidatorMessage.ALTERNATIVE_BEAN_CLASS_NOT_ANNOTATED;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.ALTERNATIVE_BEAN_CLASS_SPECIFIED_MULTIPLE_TIMES;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.ALTERNATIVE_STEREOTYPE_NOT_ANNOTATED;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.ALTERNATIVE_STEREOTYPE_SPECIFIED_MULTIPLE_TIMES;
-import static org.jboss.weld.logging.messages.ValidatorMessage.AMBIGUOUS_EL_NAME;
-import static org.jboss.weld.logging.messages.ValidatorMessage.BEAN_NAME_IS_PREFIX;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.BEAN_SPECIALIZED_TOO_MANY_TIMES;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.DECORATOR_CLASS_NOT_BEAN_CLASS_OF_DECORATOR;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.DECORATOR_SPECIFIED_TWICE;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.DISPOSAL_METHODS_WITHOUT_PRODUCER;
-import static org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_INTO_NON_BEAN;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_INTO_NON_DEPENDENT_BEAN;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_AMBIGUOUS_DEPENDENCIES;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_NON_PROXYABLE_DEPENDENCIES;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_NON_SERIALIZABLE_DEPENDENCY;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_NULLABLE_DEPENDENCIES;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_UNSATISFIED_DEPENDENCIES;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_WILDCARD;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_MUST_HAVE_TYPE_PARAMETER;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_WITH_TYPE_VARIABLE;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INTERCEPTOR_NOT_ANNOTATED_OR_REGISTERED;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.INTERCEPTOR_SPECIFIED_TWICE;
-import static org.jboss.weld.logging.messages.ValidatorMessage.NEW_WITH_QUALIFIERS;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.NON_SERIALIZABLE_BEAN_INJECTED_INTO_PASSIVATING_BEAN;
-import static org.jboss.weld.logging.messages.ValidatorMessage.NOT_PROXYABLE;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.PASSIVATING_BEAN_WITH_NONSERIALIZABLE_DECORATOR;
-import static
org.jboss.weld.logging.messages.ValidatorMessage.PASSIVATING_BEAN_WITH_NONSERIALIZABLE_INTERCEPTOR;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.TypeVariable;
-import java.lang.reflect.WildcardType;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.enterprise.context.Dependent;
-import javax.enterprise.event.Event;
-import javax.enterprise.inject.Alternative;
-import javax.enterprise.inject.Instance;
-import javax.enterprise.inject.New;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Decorator;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.enterprise.inject.spi.InjectionTarget;
-import javax.enterprise.inject.spi.Interceptor;
-
-import org.jboss.interceptor.model.InterceptionModel;
-import org.jboss.weld.bean.AbstractClassBean;
-import org.jboss.weld.bean.AbstractProducerBean;
-import org.jboss.weld.bean.DisposalMethod;
-import org.jboss.weld.bean.InterceptorImpl;
-import org.jboss.weld.bean.NewManagedBean;
-import org.jboss.weld.bean.NewSessionBean;
-import org.jboss.weld.bean.RIBean;
-import org.jboss.weld.bean.WeldDecorator;
-import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
-import org.jboss.weld.bootstrap.api.Service;
-import org.jboss.weld.introspector.WeldAnnotated;
-import org.jboss.weld.metadata.cache.MetaAnnotationStore;
-import org.jboss.weld.resolution.ResolvableWeldClass;
-import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
-import org.jboss.weld.util.Beans;
-import org.jboss.weld.util.Proxies;
-import org.jboss.weld.util.reflection.Reflections;
-
-import com.google.common.base.Supplier;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Multimaps;
-
-/**
- * Checks a list of beans for DeploymentExceptions and their subclasses
- *
- * @author Nicklas Karlsson
- * @author David Allen
- */
-public class Validator implements Service
-{
-
- private void validateBean(Bean<?> bean, BeanManagerImpl beanManager)
- {
- for (InjectionPoint ij : bean.getInjectionPoints())
- {
- validateInjectionPoint(ij, beanManager);
- }
- boolean normalScoped =
beanManager.getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal();
- if (normalScoped && !Beans.isBeanProxyable(bean))
- {
- throw new UnproxyableResolutionException(NOT_PROXYABLE, bean);
- }
- }
-
- /**
- * Validate an RIBean. This includes validating whether two beans specialize
- * the same bean
- *
- * @param bean the bean to validate
- * @param beanManager the current manager
- * @param specializedBeans the existing specialized beans
- */
- private void validateRIBean(RIBean<?> bean, BeanManagerImpl beanManager,
Collection<RIBean<?>> specializedBeans)
- {
- validateBean(bean, beanManager);
- if (!(bean instanceof NewManagedBean<?>) && !(bean instanceof
NewSessionBean<?>))
- {
- RIBean<?> abstractBean = bean;
- if (abstractBean.isSpecializing())
- {
- if (specializedBeans.contains(abstractBean.getSpecializedBean()))
- {
- throw new
InconsistentSpecializationException(BEAN_SPECIALIZED_TOO_MANY_TIMES, bean);
- }
- specializedBeans.add(abstractBean.getSpecializedBean());
- }
- if ((bean instanceof AbstractClassBean<?>) &&
bean.isPassivationCapableBean())
- {
- AbstractClassBean<?> classBean = (AbstractClassBean<?>) bean;
- if (classBean.hasDecorators())
- {
- validateDecorators(beanManager, classBean);
- }
- // validate CDI-defined interceptors
- if (classBean.hasCdiBoundInterceptors())
- {
- validateCdiBoundInterceptors(beanManager, classBean);
- }
- // validate EJB-defined interceptors
- if (((AbstractClassBean<?>) bean).hasDirectlyDefinedInterceptors())
- {
- validateDirectlyDefinedInterceptorClasses(beanManager, classBean);
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private void validateDirectlyDefinedInterceptorClasses(BeanManagerImpl beanManager,
AbstractClassBean<?> classBean)
- {
- InterceptionModel<Class<?>, Class<?>> ejbInterceptorModel =
beanManager.getClassDeclaredInterceptorsRegistry().getInterceptionModel(classBean.getType());
- if (ejbInterceptorModel != null)
- {
- Class<?>[] classDeclaredInterceptors =
ejbInterceptorModel.getAllInterceptors().toArray(new
Class<?>[ejbInterceptorModel.getAllInterceptors().size()]);
- if (classDeclaredInterceptors != null)
- {
- for (Class<?> interceptorClass : classDeclaredInterceptors)
- {
- if (!Reflections.isSerializable(interceptorClass))
- {
- throw new
DeploymentException(PASSIVATING_BEAN_WITH_NONSERIALIZABLE_INTERCEPTOR, this,
interceptorClass.getName());
- }
- InjectionTarget<Object> injectionTarget =
(InjectionTarget<Object>)
beanManager.createInjectionTarget(beanManager.createAnnotatedType(interceptorClass));
- for (InjectionPoint injectionPoint :
injectionTarget.getInjectionPoints())
- {
- Bean<?> resolvedBean =
beanManager.resolve(beanManager.getInjectableBeans(injectionPoint));
- validateInjectionPointPassivationCapable(injectionPoint, resolvedBean,
beanManager);
- }
- }
- }
- }
- }
-
- private void validateCdiBoundInterceptors(BeanManagerImpl beanManager,
AbstractClassBean<?> classBean)
- {
- InterceptionModel<Class<?>,
SerializableContextual<Interceptor<?>, ?>> cdiInterceptorModel =
beanManager.getCdiInterceptorsRegistry().getInterceptionModel(classBean.getType());
- if (cdiInterceptorModel != null)
- {
- Collection<SerializableContextual<Interceptor<?>, ?>>
interceptors = cdiInterceptorModel.getAllInterceptors();
- if (interceptors.size() > 0)
- {
- for (SerializableContextual<Interceptor<?>, ?>
serializableContextual : interceptors)
- {
- if
(!((InterceptorImpl<?>)serializableContextual.get()).isSerializable())
- {
- throw new
DeploymentException(PASSIVATING_BEAN_WITH_NONSERIALIZABLE_INTERCEPTOR, classBean,
serializableContextual.get());
- }
- for (InjectionPoint injectionPoint :
serializableContextual.get().getInjectionPoints())
- {
- Bean<?> resolvedBean =
beanManager.resolve(beanManager.getInjectableBeans(injectionPoint));
- validateInjectionPointPassivationCapable(injectionPoint, resolvedBean,
beanManager);
- }
- }
- }
- }
- }
-
- private void validateDecorators(BeanManagerImpl beanManager,
AbstractClassBean<?> classBean)
- {
- for (Decorator<?> decorator : classBean.getDecorators())
- {
- if (!((WeldDecorator<?>)decorator).getAnnotatedItem().isSerializable())
- {
- throw new
UnserializableDependencyException(PASSIVATING_BEAN_WITH_NONSERIALIZABLE_DECORATOR,
classBean, decorator);
- }
- for (InjectionPoint ij : decorator.getInjectionPoints())
- {
- Bean<?> resolvedBean =
beanManager.resolve(beanManager.getInjectableBeans(ij));
- validateInjectionPointPassivationCapable(ij, resolvedBean, beanManager);
- }
- }
- }
-
- /**
- * Validate an injection point
- *
- * @param ij the injection point to validate
- * @param declaringBean the bean into which the injectionPoint has been
- * injected, if null, certain validations aren't available
- * @param beanManager
- */
- public void validateInjectionPoint(InjectionPoint ij, BeanManagerImpl beanManager)
- {
- if (ij.getAnnotated().getAnnotation(New.class) != null &&
ij.getQualifiers().size() > 1)
- {
- throw new DefinitionException(NEW_WITH_QUALIFIERS, ij);
- }
- if (ij.getType().equals(InjectionPoint.class) && ij.getBean() == null)
- {
- throw new DefinitionException(INJECTION_INTO_NON_BEAN, ij);
- }
- if (ij.getType().equals(InjectionPoint.class) &&
!Dependent.class.equals(ij.getBean().getScope()))
- {
- throw new DefinitionException(INJECTION_INTO_NON_DEPENDENT_BEAN, ij);
- }
- if (ij.getType() instanceof TypeVariable<?>)
- {
- throw new DefinitionException(INJECTION_POINT_WITH_TYPE_VARIABLE, ij);
- }
- checkFacadeInjectionPoint(ij, Instance.class);
- checkFacadeInjectionPoint(ij, Event.class);
- Annotation[] bindings = ij.getQualifiers().toArray(new Annotation[0]);
- WeldAnnotated<?, ?> annotatedItem = ResolvableWeldClass.of(ij.getType(),
bindings, beanManager);
- Set<?> resolvedBeans =
beanManager.getBeanResolver().resolve(beanManager.getInjectableBeans(ij));
- if (resolvedBeans.isEmpty())
- {
- throw new DeploymentException(INJECTION_POINT_HAS_UNSATISFIED_DEPENDENCIES, ij,
Arrays.toString(bindings));
- }
- if (resolvedBeans.size() > 1)
- {
- throw new DeploymentException(INJECTION_POINT_HAS_AMBIGUOUS_DEPENDENCIES, ij,
Arrays.toString(bindings) + "; Possible dependencies: " + resolvedBeans);
- }
- Bean<?> resolvedBean = (Bean<?>) resolvedBeans.iterator().next();
- if
(beanManager.getServices().get(MetaAnnotationStore.class).getScopeModel(resolvedBean.getScope()).isNormal()
&& !Proxies.isTypeProxyable(ij.getType()))
- {
- throw new
UnproxyableResolutionException(INJECTION_POINT_HAS_NON_PROXYABLE_DEPENDENCIES, ij);
- }
- if (Reflections.isPrimitive(annotatedItem.getJavaClass()) &&
resolvedBean.isNullable())
- {
- throw new NullableDependencyException(INJECTION_POINT_HAS_NULLABLE_DEPENDENCIES,
ij);
- }
- if (ij.getBean() != null && Beans.isPassivatingScope(ij.getBean(),
beanManager) && (!ij.isTransient()) &&
!Beans.isPassivationCapableBean(resolvedBean))
- {
- validateInjectionPointPassivationCapable(ij, resolvedBean, beanManager);
- }
- }
-
- public void validateInjectionPointPassivationCapable(InjectionPoint ij, Bean<?>
resolvedBean, BeanManagerImpl beanManager)
- {
- if (!ij.isTransient() &&
!Beans.isPassivationCapableDependency(resolvedBean))
- {
- if (resolvedBean.getScope().equals(Dependent.class) && resolvedBean
instanceof AbstractProducerBean<?, ?, ?>)
- {
- throw new
IllegalProductException(NON_SERIALIZABLE_BEAN_INJECTED_INTO_PASSIVATING_BEAN,
ij.getBean(), resolvedBean);
- }
- throw new
UnserializableDependencyException(INJECTION_POINT_HAS_NON_SERIALIZABLE_DEPENDENCY,
ij.getBean(), resolvedBean);
- }
- }
-
- public void validateDeployment(BeanManagerImpl manager, BeanDeployerEnvironment
environment)
- {
- validateBeans(manager.getDecorators(), new ArrayList<RIBean<?>>(),
manager);
- validateBeans(manager.getBeans(), new ArrayList<RIBean<?>>(),
manager);
- validateEnabledDecoratorClasses(manager);
- validateEnabledInterceptorClasses(manager);
- validateEnabledAlternatives(manager);
- validateDisposalMethods(environment);
- validateBeanNames(manager);
- }
-
- public void validateBeans(Collection<? extends Bean<?>> beans,
Collection<RIBean<?>> specializedBeans, BeanManagerImpl manager)
- {
- for (Bean<?> bean : beans)
- {
- if (bean instanceof RIBean<?>)
- {
- validateRIBean((RIBean<?>) bean, manager, specializedBeans);
- }
- else
- {
- validateBean(bean, manager);
- }
- }
- }
-
- public void validateBeanNames(BeanManagerImpl beanManager)
- {
- Multimap<String, Bean<?>> namedAccessibleBeans =
Multimaps.newSetMultimap(new HashMap<String, Collection<Bean<?>>>(), new
Supplier<Set<Bean<?>>>()
- {
-
- public Set<Bean<?>> get()
- {
- return new HashSet<Bean<?>>();
- }
-
- });
- for (Bean<?> bean : beanManager.getAccessibleBeans())
- {
- if (bean.getName() != null)
- {
- namedAccessibleBeans.put(bean.getName(), bean);
- }
- }
-
- List<String> accessibleNamespaces = new ArrayList<String>();
- for (String namespace : beanManager.getAccessibleNamespaces())
- {
- accessibleNamespaces.add(namespace);
- }
-
- for (String name : namedAccessibleBeans.keySet())
- {
- Set<Bean<?>> resolvedBeans =
beanManager.getBeanResolver().resolve(namedAccessibleBeans.get(name));
- if (resolvedBeans.size() > 1)
- {
- throw new DeploymentException(AMBIGUOUS_EL_NAME, name, resolvedBeans);
- }
- if (accessibleNamespaces.contains(name))
- {
- throw new DeploymentException(BEAN_NAME_IS_PREFIX, name);
- }
- }
- }
-
- private void validateEnabledInterceptorClasses(BeanManagerImpl beanManager)
- {
- Set<Class<?>> interceptorBeanClasses = new
HashSet<Class<?>>();
- for (Interceptor<?> interceptor : beanManager.getInterceptors())
- {
- interceptorBeanClasses.add(interceptor.getBeanClass());
- }
- for (Class<?> enabledInterceptorClass :
beanManager.getEnabledInterceptorClasses())
- {
- if (beanManager.getEnabledInterceptorClasses().indexOf(enabledInterceptorClass)
< beanManager.getEnabledInterceptorClasses().lastIndexOf(enabledInterceptorClass))
- {
- throw new DeploymentException(INTERCEPTOR_SPECIFIED_TWICE,
enabledInterceptorClass + " specified twice");
- }
- if (!interceptorBeanClasses.contains(enabledInterceptorClass))
- {
- throw new DeploymentException(INTERCEPTOR_NOT_ANNOTATED_OR_REGISTERED,
enabledInterceptorClass);
- }
- }
- }
-
- private void validateEnabledDecoratorClasses(BeanManagerImpl beanManager)
- {
- // TODO Move building this list to the boot or sth
- Set<Class<?>> decoratorBeanClasses = new
HashSet<Class<?>>();
- for (Decorator<?> bean : beanManager.getDecorators())
- {
- decoratorBeanClasses.add(bean.getBeanClass());
- }
- for (Class<?> clazz : beanManager.getEnabledDecoratorClasses())
- {
- if (beanManager.getEnabledDecoratorClasses().indexOf(clazz) <
beanManager.getEnabledDecoratorClasses().lastIndexOf(clazz))
- {
- throw new DeploymentException(DECORATOR_SPECIFIED_TWICE, clazz);
- }
- if (!decoratorBeanClasses.contains(clazz))
- {
- throw new DeploymentException(DECORATOR_CLASS_NOT_BEAN_CLASS_OF_DECORATOR,
clazz, decoratorBeanClasses);
- }
- }
- }
-
- private void validateEnabledAlternatives(BeanManagerImpl beanManager)
- {
- List<Class<?>> seenAlternatives = new
ArrayList<Class<?>>();
- for (Class<? extends Annotation> stereotype :
beanManager.getEnabledAlternativeStereotypes())
- {
- if (!stereotype.isAnnotationPresent(Alternative.class))
- {
- throw new DeploymentException(ALTERNATIVE_STEREOTYPE_NOT_ANNOTATED,
stereotype);
- }
- if (seenAlternatives.contains(stereotype))
- {
- throw new
DeploymentException(ALTERNATIVE_STEREOTYPE_SPECIFIED_MULTIPLE_TIMES, stereotype);
- }
- seenAlternatives.add(stereotype);
- }
- for (Class<?> clazz : beanManager.getEnabledAlternativeClasses())
- {
- if (!clazz.isAnnotationPresent(Alternative.class))
- {
- throw new DeploymentException(ALTERNATIVE_BEAN_CLASS_NOT_ANNOTATED, clazz);
- }
- if (seenAlternatives.contains(clazz))
- {
- throw new
DeploymentException(ALTERNATIVE_BEAN_CLASS_SPECIFIED_MULTIPLE_TIMES, clazz);
- }
- seenAlternatives.add(clazz);
- }
- }
-
- private void validateDisposalMethods(BeanDeployerEnvironment environment)
- {
- Set<DisposalMethod<?, ?>> beans =
environment.getUnresolvedDisposalBeans();
- if (!beans.isEmpty())
- {
- throw new DefinitionException(DISPOSAL_METHODS_WITHOUT_PRODUCER, beans);
- }
- }
-
- private static void checkFacadeInjectionPoint(InjectionPoint injectionPoint,
Class<?> type)
- {
- if (injectionPoint.getAnnotated().getBaseType().equals(type))
- {
- if (injectionPoint.getType() instanceof ParameterizedType)
- {
- ParameterizedType parameterizedType = (ParameterizedType)
injectionPoint.getType();
- if (parameterizedType.getActualTypeArguments()[0] instanceof
TypeVariable<?>)
- {
- throw new DefinitionException(INJECTION_POINT_WITH_TYPE_VARIABLE,
injectionPoint);
- }
- if (parameterizedType.getActualTypeArguments()[0] instanceof WildcardType)
- {
- throw new DefinitionException(INJECTION_POINT_HAS_WILDCARD, type,
injectionPoint);
- }
- }
- else
- {
- throw new DefinitionException(INJECTION_POINT_MUST_HAVE_TYPE_PARAMETER, type,
injectionPoint);
- }
- }
-
- }
-
- public void cleanup()
- {
- }
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/WeldException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/WeldException.java 2010-01-08 12:25:43
UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/WeldException.java 2010-01-08 13:59:36
UTC (rev 5398)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-import java.util.List;
-
-/**
- * A general run-time exception used by the JSR-299 reference implementation Weld.
- *
- * @author David Allen
- */
-public class WeldException extends RuntimeException
-{
- private static final long serialVersionUID = 2L;
-
- private WeldExceptionMessage message;
-
- /**
- * Creates a new exception with the given cause.
- *
- * @param throwable The cause of the exception
- */
- public WeldException(Throwable throwable)
- {
- super(throwable);
- this.message = new WeldExceptionMessage(throwable.getLocalizedMessage());
- }
-
- /**
- * Creates a new exception with the given localized message key and optional
- * arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> WeldException(E key, Object... args)
- {
- this.message = new WeldExceptionMessage(key, args);
- }
-
- /**
- * Creates a new exception with the given localized message key, the cause
- * for this exception and optional arguments for the message.
- *
- * @param <E> The enumeration type for the message keys
- * @param key The localized message to use
- * @param throwable The cause for this exception
- * @param args Optional arguments to insert into the message
- */
- public <E extends Enum<?>> WeldException(E key, Throwable throwable,
Object... args)
- {
- super(throwable);
- this.message = new WeldExceptionMessage(key, args);
- }
-
- /**
- * Creates a new exception based on a list of throwables. The throwables are not
- * used as the cause, but the message from each throwable is included as the message
- * for this exception.
- *
- * @param errors A list of throwables to use in the message
- */
- public WeldException(List<Throwable> errors)
- {
- super();
- StringBuilder errorMessage = new StringBuilder();
- boolean firstError = true;
- for (Throwable throwable : errors)
- {
- if (!firstError)
- {
- errorMessage.append('\n');
- }
- errorMessage.append(throwable.getLocalizedMessage());
- }
- this.message = new WeldExceptionMessage(errorMessage.toString());
- }
-
- @Override
- public String getLocalizedMessage()
- {
- return getMessage();
- }
-
- @Override
- public String getMessage()
- {
- return message.getAsString();
- }
-
-}
Deleted: core/trunk/impl/src/main/java/org/jboss/weld/WeldExceptionMessage.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/WeldExceptionMessage.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/WeldExceptionMessage.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,117 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.jboss.weld;
-
-import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
-
-import java.io.Serializable;
-
-/**
- * <p>
- * The message for exceptions generated by Weld. Each exception contains one
- * message object which will handle the generation of the string message at the
- * time the message is needed. This includes localization of the message based
- * on the settings in the JVM where the {@link java.lang.Throwable#getMessage()}
- * or {@link java.lang.Throwable#getLocalizedMessage()} methods are invoked.
- * </p>
- *
- * @author David Allen
- */
-public class WeldExceptionMessage implements Serializable
-{
-
- private static final long serialVersionUID = 2L;
-
- /**
- * The string version of the message. This is only used when the original
- * message from a wrapped exception is being used. Since it is already
- * localized, it will simply be stored here and used as the message.
- */
- private String message;
-
- private Enum<?> messageKey;
- private Object messageArguments[];
-
- /**
- * <p>
- * Creates a new exception message initialized to a static message. Use this
- * only for messages generated by third-party software, i.e., those which do
- * not use enumerated message keys.
- * </p>
- *
- * @param message the static message
- */
- public WeldExceptionMessage(String message)
- {
- // This will not be further localized
- this.message = message;
- }
-
- /**
- * <p>
- * Creates a new exception message based on an enumerated message key. This
- * message will not be localized until it is actually logged or other
- * software invokes the {@link #getMessage()} method.
- * </p>
- *
- * @param <E> the message key enumeration
- * @param key the message key from the above enumeration
- * @param args optional arguments for the message
- */
- public <E extends Enum<?>> WeldExceptionMessage(E key, Object... args)
- {
- this.messageKey = key;
- if ((args != null) && (args.length > 0))
- {
- this.messageArguments = new String[args.length];
- int index = 0;
- for (Object arg : args)
- {
- messageArguments[index++] = arg.toString();
- }
- }
- }
-
- /**
- * Generates the localized message for the exception.
- *
- * @return exception message as a string
- */
- public String getAsString()
- {
- String result = message;
- if (result == null)
- {
- try
- {
- result = loggerFactory().getMessageConveyor().getMessage(messageKey,
messageArguments);
- }
- catch (Exception e)
- {
- // We want the using exception to be processed, but also include
- // this one in its message
- result = "Exception message for key " + messageKey + " not
found due to " + e.getLocalizedMessage();
- }
- if (result == null)
- {
- result = "Exception message for key " + messageKey + " not
found";
- }
- }
- return result;
- }
-}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -44,14 +44,14 @@
import javax.inject.Named;
import javax.inject.Qualifier;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
-import org.jboss.weld.DefinitionException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.MergedStereotypes;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.util.Beans;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -36,8 +36,6 @@
import java.util.List;
import java.util.Set;
-import javassist.util.proxy.ProxyObject;
-
import javax.enterprise.context.Dependent;
import javax.enterprise.context.NormalScope;
import javax.enterprise.context.spi.CreationalContext;
@@ -56,21 +54,21 @@
import org.jboss.interceptor.model.InterceptorClassMetadataImpl;
import org.jboss.interceptor.util.InterceptionUtils;
import org.jboss.interceptor.util.proxy.TargetInstanceProxy;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.DefinitionException;
-import org.jboss.weld.DeploymentException;
-import org.jboss.weld.ForbiddenStateException;
-import org.jboss.weld.WeldException;
import org.jboss.weld.bean.proxy.DecoratorProxyMethodHandler;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.context.SerializableContextualImpl;
import org.jboss.weld.context.SerializableContextualInstanceImpl;
import org.jboss.weld.ejb.EJBApiAbstraction;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.DeploymentException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.injection.ConstructorInjectionPoint;
import org.jboss.weld.injection.FieldInjectionPoint;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.serialization.spi.helpers.SerializableContextualInstance;
@@ -235,7 +233,7 @@
// temporary fix for decorators - make sure that the instance wrapped by the
decorators
// is the contextual instance
// TODO - correct the decoration algorithm to avoid the creation of new target
class instances
- ((ProxyObject) proxy).setHandler(new
DecoratorProxyMethodHandler(decoratorInstances, decoratedActualInstance.get()));
+ Proxies.attachMethodHandler(proxy, new
DecoratorProxyMethodHandler(decoratorInstances, decoratedActualInstance.get()));
return proxy;
}
catch (InstantiationException e)
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -53,13 +53,13 @@
import javax.inject.Inject;
import javax.inject.Scope;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
-import org.jboss.weld.DefinitionException;
-import org.jboss.weld.IllegalProductException;
-import org.jboss.weld.WeldException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.IllegalProductException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.introspector.WeldMember;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Names;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -25,10 +25,10 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.Alternative;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.context.WeldCreationalContext;
import org.jboss.weld.introspector.WeldMember;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.slf4j.cal10n.LocLogger;
/**
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/CustomDecoratorWrapper.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/CustomDecoratorWrapper.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/CustomDecoratorWrapper.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -19,9 +19,9 @@
import javax.enterprise.inject.spi.Decorator;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.introspector.MethodSignature;
import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.Deployers;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -33,17 +33,14 @@
import java.util.HashSet;
import java.util.Set;
-import javassist.util.proxy.ProxyObject;
-
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.AnnotatedMethod;
import javax.enterprise.inject.spi.Decorator;
import javax.inject.Inject;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.DefinitionException;
import org.jboss.weld.bean.proxy.AbstractDecoratorMethodHandler;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.injection.ProxyClassConstructorInjectionPointWrapper;
import org.jboss.weld.injection.WeldInjectionPoint;
@@ -53,6 +50,7 @@
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.jlr.WeldClassImpl;
import org.jboss.weld.introspector.jlr.WeldConstructorImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.Deployers;
import org.jboss.weld.util.Proxies;
@@ -293,8 +291,7 @@
{
ProxyClassConstructorInjectionPointWrapper<T>
constructorInjectionPointWrapper = new ProxyClassConstructorInjectionPointWrapper(this,
constructorForAbstractDecorator, getConstructor());
T instance = constructorInjectionPointWrapper.newInstance(manager, ctx);
- AbstractDecoratorMethodHandler abstractDecoratorMethodHandler = new
AbstractDecoratorMethodHandler(annotatedDelegateItem, getDelegateInjectionPoint(),
constructorInjectionPointWrapper.getInjectedDelegate());
- ((ProxyObject)instance).setHandler(abstractDecoratorMethodHandler);
+ Proxies.attachMethodHandler(instance, new
AbstractDecoratorMethodHandler(annotatedDelegateItem, getDelegateInjectionPoint(),
constructorInjectionPointWrapper.getInjectedDelegate()));
return instance;
}
}
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -34,12 +34,12 @@
import javax.enterprise.inject.Produces;
import javax.inject.Inject;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.DefinitionException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.reflection.SecureReflections;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -31,10 +31,10 @@
import org.jboss.interceptor.model.InterceptorClassMetadata;
import org.jboss.interceptor.proxy.DirectClassInterceptionHandler;
import org.jboss.interceptor.registry.InterceptorClassMetadataRegistry;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.DeploymentException;
-import org.jboss.weld.WeldException;
+import org.jboss.weld.exceptions.DeploymentException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
/**
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2010-01-08 12:25:43
UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2010-01-08 13:59:36
UTC (rev 5398)
@@ -45,19 +45,19 @@
import org.jboss.interceptor.proxy.InterceptorProxyCreatorImpl;
import org.jboss.interceptor.registry.InterceptorRegistry;
import org.jboss.interceptor.util.InterceptionUtils;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
-import org.jboss.weld.DefinitionException;
-import org.jboss.weld.DeploymentException;
-import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.bean.interceptor.CdiInterceptorHandlerFactory;
import org.jboss.weld.bean.interceptor.ClassInterceptionHandlerFactory;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.DeploymentException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.injection.InjectionContextImpl;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.util.Beans;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -22,9 +22,9 @@
import javax.enterprise.context.Dependent;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.literal.NewLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* Represents a @New simple bean
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -22,10 +22,10 @@
import javax.enterprise.context.Dependent;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.ejb.InternalEjbDescriptor;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.literal.NewLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
/**
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -26,9 +26,9 @@
import javax.enterprise.inject.spi.Producer;
import org.jboss.interceptor.util.InterceptionUtils;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.introspector.WeldField;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Names;
/**
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -34,14 +34,14 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.Producer;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.DefinitionException;
-import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.injection.ParameterInjectionPoint;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Names;
import org.jboss.weld.util.reflection.SecureReflections;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java 2010-01-08 12:25:43 UTC
(rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java 2010-01-08 13:59:36 UTC
(rev 5398)
@@ -23,9 +23,9 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.PassivationCapable;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.injection.WeldInjectionPoint;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* Abstract base class with functions specific to RI built-in beans
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2010-01-08 12:25:43
UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2010-01-08 13:59:36
UTC (rev 5398)
@@ -50,12 +50,6 @@
import javax.interceptor.Interceptor;
import org.jboss.interceptor.model.InterceptionModel;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.CreationException;
-import org.jboss.weld.DefinitionException;
-import org.jboss.weld.ForbiddenArgumentException;
-import org.jboss.weld.ForbiddenStateException;
-import org.jboss.weld.WeldException;
import org.jboss.weld.bean.interceptor.InterceptorBindingsAdapter;
import org.jboss.weld.bean.proxy.EnterpriseBeanInstance;
import org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler;
@@ -65,9 +59,15 @@
import org.jboss.weld.ejb.api.SessionObjectReference;
import org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor;
import org.jboss.weld.ejb.spi.EjbServices;
+import org.jboss.weld.exceptions.CreationException;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.injection.InjectionContextImpl;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.util.Beans;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -24,12 +24,12 @@
import javax.enterprise.context.Dependent;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
public abstract class AbstractBuiltInBean<T> extends RIBean<T>
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacade.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacade.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacade.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -26,8 +26,8 @@
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenStateException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* Common implementation for binding-type-based helpers
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacadeBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacadeBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractFacadeBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -23,7 +23,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.slf4j.cal10n.LocLogger;
public abstract class AbstractFacadeBean<T> extends AbstractBuiltInBean<T>
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/BeanManagerBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/BeanManagerBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/BeanManagerBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -22,7 +22,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.BeanManager;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.collections.Arrays2;
public class BeanManagerBean extends AbstractBuiltInBean<BeanManagerImpl>
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/CallableMethodHandler.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -8,49 +8,17 @@
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.HashSet;
import java.util.concurrent.Callable;
-import javassist.tools.reflect.Reflection;
import javassist.util.proxy.MethodHandler;
-import org.jboss.weld.Container;
-import org.jboss.weld.NullInstanceException;
-import org.jboss.weld.bootstrap.api.Service;
-import org.jboss.weld.util.reflection.Reflections;
+import org.jboss.weld.exceptions.NullInstanceException;
import org.jboss.weld.util.reflection.SecureReflections;
import org.slf4j.cal10n.LocLogger;
public class CallableMethodHandler implements MethodHandler, Serializable
{
- public static class CallableMethodHandlerCleaner implements Service
- {
-
- private final Collection<CallableMethodHandler> callableMethodHandlers;
-
- public CallableMethodHandlerCleaner()
- {
- this.callableMethodHandlers = new HashSet<CallableMethodHandler>();
- }
-
- private void add(CallableMethodHandler callableMethodHandler)
- {
- this.callableMethodHandlers.add(callableMethodHandler);
- }
-
- public void cleanup()
- {
- for (CallableMethodHandler callableMethodHandler : callableMethodHandlers)
- {
- callableMethodHandler.cleanup();
- }
- callableMethodHandlers.clear();
- }
-
- }
-
private static final long serialVersionUID = -1348302663981663427L;
private static final LocLogger log = loggerFactory().getLogger(BEAN);
@@ -61,7 +29,6 @@
{
super();
this.callable = callable;
-
Container.instance().deploymentServices().get(CallableMethodHandlerCleaner.class).add(this);
}
public Object invoke(Object self, Method proxiedMethod, Method proceed, Object[] args)
throws Throwable
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/EventBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -26,9 +26,9 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.util.TypeLiteral;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.event.EventImpl;
import org.jboss.weld.literal.AnyLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resolution.ResolvableTransformer;
import org.jboss.weld.util.collections.Arrays2;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -24,8 +24,8 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Extension;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* @author pmuir
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InjectionPointBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InjectionPointBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InjectionPointBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -22,7 +22,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.collections.Arrays2;
/**
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -28,8 +28,8 @@
import javax.enterprise.util.TypeLiteral;
import javax.inject.Provider;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.literal.AnyLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resolution.ResolvableTransformer;
import org.jboss.weld.util.collections.Arrays2;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/InstanceImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -34,8 +34,8 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.util.TypeLiteral;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.InvalidObjectException;
+import org.jboss.weld.exceptions.InvalidObjectException;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resolution.ResolvableWeldClass;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Names;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/AbstractEEBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/AbstractEEBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/AbstractEEBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -11,10 +11,10 @@
import javax.enterprise.context.spi.CreationalContext;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.DefinitionException;
import org.jboss.weld.bean.builtin.AbstractBuiltInBean;
import org.jboss.weld.bean.builtin.CallableMethodHandler;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Proxies;
import org.jboss.weld.util.Proxies.TypeInfo;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/AbstractEECallable.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/AbstractEECallable.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/AbstractEECallable.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -3,7 +3,7 @@
import java.io.Serializable;
import java.util.concurrent.Callable;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
public abstract class AbstractEECallable<V> implements Callable<V>,
Serializable
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/DefaultValidatorBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/DefaultValidatorBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/DefaultValidatorBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -20,9 +20,9 @@
import javax.validation.Validator;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
-import org.jboss.weld.ForbiddenStateException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.validation.spi.ValidationServices;
/**
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/DefaultValidatorFactoryBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/DefaultValidatorFactoryBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/DefaultValidatorFactoryBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -20,8 +20,8 @@
import javax.validation.ValidatorFactory;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenStateException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.validation.spi.ValidationServices;
/**
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/EEResourceProducerField.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -26,16 +26,16 @@
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
-import org.jboss.weld.ForbiddenStateException;
-import org.jboss.weld.WeldException;
import org.jboss.weld.bean.AbstractClassBean;
import org.jboss.weld.bean.ProducerField;
import org.jboss.weld.bean.builtin.CallableMethodHandler;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.ejb.EJBApiAbstraction;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.introspector.WeldField;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.persistence.PersistenceApiAbstraction;
import org.jboss.weld.serialization.spi.ContextualStore;
import org.jboss.weld.util.Proxies;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/PrincipalBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/PrincipalBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/PrincipalBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -20,8 +20,8 @@
import java.security.Principal;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenStateException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.security.spi.SecurityServices;
/**
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/UserTransactionBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/UserTransactionBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ee/UserTransactionBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -20,8 +20,8 @@
import javax.transaction.UserTransaction;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenStateException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.transaction.spi.TransactionServices;
/**
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/CdiInterceptorHandlerFactory.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/CdiInterceptorHandlerFactory.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/CdiInterceptorHandlerFactory.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -22,7 +22,7 @@
import org.jboss.interceptor.proxy.InterceptionHandler;
import org.jboss.interceptor.proxy.InterceptionHandlerFactory;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
import org.jboss.weld.context.SerializableContextualInstanceImpl;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/ClassInterceptionHandlerFactory.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/ClassInterceptionHandlerFactory.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/ClassInterceptionHandlerFactory.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -24,8 +24,8 @@
import org.jboss.interceptor.proxy.DirectClassInterceptionHandler;
import org.jboss.interceptor.proxy.InterceptionHandler;
import org.jboss.interceptor.proxy.InterceptionHandlerFactory;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.DeploymentException;
+import org.jboss.weld.exceptions.DeploymentException;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.reflection.SecureReflections;
/**
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/InterceptorBindingsAdapter.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/InterceptorBindingsAdapter.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/interceptor/InterceptorBindingsAdapter.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -32,8 +32,8 @@
import javax.enterprise.inject.spi.Interceptor;
import org.jboss.interceptor.model.InterceptionModel;
-import org.jboss.weld.ForbiddenArgumentException;
import org.jboss.weld.ejb.spi.InterceptorBindings;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
/**
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -29,9 +29,9 @@
import javax.enterprise.context.spi.Context;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.context.WeldCreationalContext;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.serialization.spi.ContextualStore;
import org.jboss.weld.util.reflection.Reflections;
import org.jboss.weld.util.reflection.SecureReflections;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyProvider.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyProvider.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyProvider.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -25,11 +25,11 @@
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
-import org.jboss.weld.DefinitionException;
-import org.jboss.weld.WeldException;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.logging.messages.BeanMessage;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.serialization.spi.ContextualStore;
import org.jboss.weld.util.Proxies;
import org.jboss.weld.util.Proxies.TypeInfo;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyMethodHandler.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyMethodHandler.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyMethodHandler.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -24,8 +24,8 @@
import javax.enterprise.inject.spi.Decorator;
import org.jboss.interceptor.util.proxy.TargetInstanceProxyMethodHandler;
-import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.bean.WeldDecorator;
+import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.introspector.MethodSignature;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.jlr.MethodSignatureImpl;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/EnterpriseBeanProxyMethodHandler.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/EnterpriseBeanProxyMethodHandler.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -31,9 +31,9 @@
import javax.enterprise.context.spi.CreationalContext;
-import org.jboss.weld.InvalidOperationException;
import org.jboss.weld.bean.SessionBean;
import org.jboss.weld.ejb.api.SessionObjectReference;
+import org.jboss.weld.exceptions.InvalidOperationException;
import org.jboss.weld.introspector.MethodSignature;
import org.jboss.weld.introspector.jlr.MethodSignatureImpl;
import org.jboss.weld.util.reflection.Reflections;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -32,7 +32,6 @@
import javax.enterprise.inject.spi.Extension;
import javax.inject.Inject;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.AbstractClassBean;
import org.jboss.weld.bean.AbstractProducerBean;
import org.jboss.weld.bean.DecoratorImpl;
@@ -63,6 +62,7 @@
import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.jsf.JsfApiAbstraction;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.persistence.PersistenceApiAbstraction;
import org.jboss.weld.servlet.ServletApiAbstraction;
import org.jboss.weld.util.reflection.Reflections;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -25,13 +25,13 @@
import javax.enterprise.inject.spi.AnnotatedType;
import javax.interceptor.Interceptor;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
-import org.jboss.weld.DeploymentException;
import org.jboss.weld.bootstrap.events.ProcessAnnotatedTypeImpl;
import org.jboss.weld.ejb.EjbDescriptors;
import org.jboss.weld.ejb.InternalEjbDescriptor;
+import org.jboss.weld.exceptions.DeploymentException;
import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
/**
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -28,7 +28,6 @@
import javax.enterprise.inject.New;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.AbstractBean;
import org.jboss.weld.bean.AbstractClassBean;
import org.jboss.weld.bean.DecoratorImpl;
@@ -50,6 +49,7 @@
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resolution.ResolvableFactory;
import org.jboss.weld.resolution.TypeSafeDisposerResolver;
import org.jboss.weld.resources.ClassTransformer;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -26,7 +26,6 @@
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bean.builtin.BeanManagerBean;
import org.jboss.weld.bean.builtin.EventBean;
@@ -42,6 +41,7 @@
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.ejb.EjbDescriptors;
import org.jboss.weld.ejb.spi.EjbServices;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.spi.ResourceLoader;
import org.jboss.weld.security.spi.SecurityServices;
import org.jboss.weld.transaction.spi.TransactionServices;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -23,7 +23,6 @@
import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.Extension;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bean.builtin.ExtensionBean;
@@ -33,6 +32,7 @@
import org.jboss.weld.event.ObserverMethodImpl;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.DeploymentStructures;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployerEnvironment.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployerEnvironment.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployerEnvironment.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -3,9 +3,9 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.builtin.ExtensionBean;
import org.jboss.weld.ejb.EjbDescriptors;
+import org.jboss.weld.manager.BeanManagerImpl;
public class ExtensionBeanDeployerEnvironment extends BeanDeployerEnvironment
{
Copied: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java (from rev
5388, core/trunk/impl/src/main/java/org/jboss/weld/Validator.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java
(rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,469 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.bootstrap;
+
+import static
org.jboss.weld.logging.messages.ValidatorMessage.ALTERNATIVE_BEAN_CLASS_NOT_ANNOTATED;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.ALTERNATIVE_BEAN_CLASS_SPECIFIED_MULTIPLE_TIMES;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.ALTERNATIVE_STEREOTYPE_NOT_ANNOTATED;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.ALTERNATIVE_STEREOTYPE_SPECIFIED_MULTIPLE_TIMES;
+import static org.jboss.weld.logging.messages.ValidatorMessage.AMBIGUOUS_EL_NAME;
+import static org.jboss.weld.logging.messages.ValidatorMessage.BEAN_NAME_IS_PREFIX;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.BEAN_SPECIALIZED_TOO_MANY_TIMES;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.DECORATOR_CLASS_NOT_BEAN_CLASS_OF_DECORATOR;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.DECORATOR_SPECIFIED_TWICE;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.DISPOSAL_METHODS_WITHOUT_PRODUCER;
+import static org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_INTO_NON_BEAN;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_INTO_NON_DEPENDENT_BEAN;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_AMBIGUOUS_DEPENDENCIES;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_NON_PROXYABLE_DEPENDENCIES;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_NON_SERIALIZABLE_DEPENDENCY;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_NULLABLE_DEPENDENCIES;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_UNSATISFIED_DEPENDENCIES;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_HAS_WILDCARD;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_MUST_HAVE_TYPE_PARAMETER;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INJECTION_POINT_WITH_TYPE_VARIABLE;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INTERCEPTOR_NOT_ANNOTATED_OR_REGISTERED;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.INTERCEPTOR_SPECIFIED_TWICE;
+import static org.jboss.weld.logging.messages.ValidatorMessage.NEW_WITH_QUALIFIERS;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.NON_SERIALIZABLE_BEAN_INJECTED_INTO_PASSIVATING_BEAN;
+import static org.jboss.weld.logging.messages.ValidatorMessage.NOT_PROXYABLE;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.PASSIVATING_BEAN_WITH_NONSERIALIZABLE_DECORATOR;
+import static
org.jboss.weld.logging.messages.ValidatorMessage.PASSIVATING_BEAN_WITH_NONSERIALIZABLE_INTERCEPTOR;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.TypeVariable;
+import java.lang.reflect.WildcardType;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.event.Event;
+import javax.enterprise.inject.Alternative;
+import javax.enterprise.inject.Instance;
+import javax.enterprise.inject.New;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.Decorator;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.enterprise.inject.spi.Interceptor;
+
+import org.jboss.interceptor.model.InterceptionModel;
+import org.jboss.weld.bean.AbstractClassBean;
+import org.jboss.weld.bean.AbstractProducerBean;
+import org.jboss.weld.bean.DisposalMethod;
+import org.jboss.weld.bean.InterceptorImpl;
+import org.jboss.weld.bean.NewManagedBean;
+import org.jboss.weld.bean.NewSessionBean;
+import org.jboss.weld.bean.RIBean;
+import org.jboss.weld.bean.WeldDecorator;
+import org.jboss.weld.bootstrap.api.Service;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.DeploymentException;
+import org.jboss.weld.exceptions.IllegalProductException;
+import org.jboss.weld.exceptions.InconsistentSpecializationException;
+import org.jboss.weld.exceptions.NullableDependencyException;
+import org.jboss.weld.exceptions.UnproxyableResolutionException;
+import org.jboss.weld.exceptions.UnserializableDependencyException;
+import org.jboss.weld.introspector.WeldAnnotated;
+import org.jboss.weld.manager.BeanManagerImpl;
+import org.jboss.weld.metadata.cache.MetaAnnotationStore;
+import org.jboss.weld.resolution.ResolvableWeldClass;
+import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
+import org.jboss.weld.util.Beans;
+import org.jboss.weld.util.Proxies;
+import org.jboss.weld.util.reflection.Reflections;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.Multimaps;
+
+/**
+ * Checks a list of beans for DeploymentExceptions and their subclasses
+ *
+ * @author Nicklas Karlsson
+ * @author David Allen
+ */
+public class Validator implements Service
+{
+
+ private void validateBean(Bean<?> bean, BeanManagerImpl beanManager)
+ {
+ for (InjectionPoint ij : bean.getInjectionPoints())
+ {
+ validateInjectionPoint(ij, beanManager);
+ }
+ boolean normalScoped =
beanManager.getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal();
+ if (normalScoped && !Beans.isBeanProxyable(bean))
+ {
+ throw new UnproxyableResolutionException(NOT_PROXYABLE, bean);
+ }
+ }
+
+ /**
+ * Validate an RIBean. This includes validating whether two beans specialize
+ * the same bean
+ *
+ * @param bean the bean to validate
+ * @param beanManager the current manager
+ * @param specializedBeans the existing specialized beans
+ */
+ private void validateRIBean(RIBean<?> bean, BeanManagerImpl beanManager,
Collection<RIBean<?>> specializedBeans)
+ {
+ validateBean(bean, beanManager);
+ if (!(bean instanceof NewManagedBean<?>) && !(bean instanceof
NewSessionBean<?>))
+ {
+ RIBean<?> abstractBean = bean;
+ if (abstractBean.isSpecializing())
+ {
+ if (specializedBeans.contains(abstractBean.getSpecializedBean()))
+ {
+ throw new
InconsistentSpecializationException(BEAN_SPECIALIZED_TOO_MANY_TIMES, bean);
+ }
+ specializedBeans.add(abstractBean.getSpecializedBean());
+ }
+ if ((bean instanceof AbstractClassBean<?>) &&
bean.isPassivationCapableBean())
+ {
+ AbstractClassBean<?> classBean = (AbstractClassBean<?>) bean;
+ if (classBean.hasDecorators())
+ {
+ validateDecorators(beanManager, classBean);
+ }
+ // validate CDI-defined interceptors
+ if (classBean.hasCdiBoundInterceptors())
+ {
+ validateCdiBoundInterceptors(beanManager, classBean);
+ }
+ // validate EJB-defined interceptors
+ if (((AbstractClassBean<?>) bean).hasDirectlyDefinedInterceptors())
+ {
+ validateDirectlyDefinedInterceptorClasses(beanManager, classBean);
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void validateDirectlyDefinedInterceptorClasses(BeanManagerImpl beanManager,
AbstractClassBean<?> classBean)
+ {
+ InterceptionModel<Class<?>, Class<?>> ejbInterceptorModel =
beanManager.getClassDeclaredInterceptorsRegistry().getInterceptionModel(classBean.getType());
+ if (ejbInterceptorModel != null)
+ {
+ Class<?>[] classDeclaredInterceptors =
ejbInterceptorModel.getAllInterceptors().toArray(new
Class<?>[ejbInterceptorModel.getAllInterceptors().size()]);
+ if (classDeclaredInterceptors != null)
+ {
+ for (Class<?> interceptorClass : classDeclaredInterceptors)
+ {
+ if (!Reflections.isSerializable(interceptorClass))
+ {
+ throw new
DeploymentException(PASSIVATING_BEAN_WITH_NONSERIALIZABLE_INTERCEPTOR, this,
interceptorClass.getName());
+ }
+ InjectionTarget<Object> injectionTarget =
(InjectionTarget<Object>)
beanManager.createInjectionTarget(beanManager.createAnnotatedType(interceptorClass));
+ for (InjectionPoint injectionPoint :
injectionTarget.getInjectionPoints())
+ {
+ Bean<?> resolvedBean =
beanManager.resolve(beanManager.getInjectableBeans(injectionPoint));
+ validateInjectionPointPassivationCapable(injectionPoint, resolvedBean,
beanManager);
+ }
+ }
+ }
+ }
+ }
+
+ private void validateCdiBoundInterceptors(BeanManagerImpl beanManager,
AbstractClassBean<?> classBean)
+ {
+ InterceptionModel<Class<?>,
SerializableContextual<Interceptor<?>, ?>> cdiInterceptorModel =
beanManager.getCdiInterceptorsRegistry().getInterceptionModel(classBean.getType());
+ if (cdiInterceptorModel != null)
+ {
+ Collection<SerializableContextual<Interceptor<?>, ?>>
interceptors = cdiInterceptorModel.getAllInterceptors();
+ if (interceptors.size() > 0)
+ {
+ for (SerializableContextual<Interceptor<?>, ?>
serializableContextual : interceptors)
+ {
+ if
(!((InterceptorImpl<?>)serializableContextual.get()).isSerializable())
+ {
+ throw new
DeploymentException(PASSIVATING_BEAN_WITH_NONSERIALIZABLE_INTERCEPTOR, classBean,
serializableContextual.get());
+ }
+ for (InjectionPoint injectionPoint :
serializableContextual.get().getInjectionPoints())
+ {
+ Bean<?> resolvedBean =
beanManager.resolve(beanManager.getInjectableBeans(injectionPoint));
+ validateInjectionPointPassivationCapable(injectionPoint, resolvedBean,
beanManager);
+ }
+ }
+ }
+ }
+ }
+
+ private void validateDecorators(BeanManagerImpl beanManager,
AbstractClassBean<?> classBean)
+ {
+ for (Decorator<?> decorator : classBean.getDecorators())
+ {
+ if (!((WeldDecorator<?>)decorator).getAnnotatedItem().isSerializable())
+ {
+ throw new
UnserializableDependencyException(PASSIVATING_BEAN_WITH_NONSERIALIZABLE_DECORATOR,
classBean, decorator);
+ }
+ for (InjectionPoint ij : decorator.getInjectionPoints())
+ {
+ Bean<?> resolvedBean =
beanManager.resolve(beanManager.getInjectableBeans(ij));
+ validateInjectionPointPassivationCapable(ij, resolvedBean, beanManager);
+ }
+ }
+ }
+
+ /**
+ * Validate an injection point
+ *
+ * @param ij the injection point to validate
+ * @param declaringBean the bean into which the injectionPoint has been
+ * injected, if null, certain validations aren't available
+ * @param beanManager
+ */
+ public void validateInjectionPoint(InjectionPoint ij, BeanManagerImpl beanManager)
+ {
+ if (ij.getAnnotated().getAnnotation(New.class) != null &&
ij.getQualifiers().size() > 1)
+ {
+ throw new DefinitionException(NEW_WITH_QUALIFIERS, ij);
+ }
+ if (ij.getType().equals(InjectionPoint.class) && ij.getBean() == null)
+ {
+ throw new DefinitionException(INJECTION_INTO_NON_BEAN, ij);
+ }
+ if (ij.getType().equals(InjectionPoint.class) &&
!Dependent.class.equals(ij.getBean().getScope()))
+ {
+ throw new DefinitionException(INJECTION_INTO_NON_DEPENDENT_BEAN, ij);
+ }
+ if (ij.getType() instanceof TypeVariable<?>)
+ {
+ throw new DefinitionException(INJECTION_POINT_WITH_TYPE_VARIABLE, ij);
+ }
+ checkFacadeInjectionPoint(ij, Instance.class);
+ checkFacadeInjectionPoint(ij, Event.class);
+ Annotation[] bindings = ij.getQualifiers().toArray(new Annotation[0]);
+ WeldAnnotated<?, ?> annotatedItem = ResolvableWeldClass.of(ij.getType(),
bindings, beanManager);
+ Set<?> resolvedBeans =
beanManager.getBeanResolver().resolve(beanManager.getInjectableBeans(ij));
+ if (resolvedBeans.isEmpty())
+ {
+ throw new DeploymentException(INJECTION_POINT_HAS_UNSATISFIED_DEPENDENCIES, ij,
Arrays.toString(bindings));
+ }
+ if (resolvedBeans.size() > 1)
+ {
+ throw new DeploymentException(INJECTION_POINT_HAS_AMBIGUOUS_DEPENDENCIES, ij,
Arrays.toString(bindings) + "; Possible dependencies: " + resolvedBeans);
+ }
+ Bean<?> resolvedBean = (Bean<?>) resolvedBeans.iterator().next();
+ if
(beanManager.getServices().get(MetaAnnotationStore.class).getScopeModel(resolvedBean.getScope()).isNormal()
&& !Proxies.isTypeProxyable(ij.getType()))
+ {
+ throw new
UnproxyableResolutionException(INJECTION_POINT_HAS_NON_PROXYABLE_DEPENDENCIES, ij);
+ }
+ if (Reflections.isPrimitive(annotatedItem.getJavaClass()) &&
resolvedBean.isNullable())
+ {
+ throw new NullableDependencyException(INJECTION_POINT_HAS_NULLABLE_DEPENDENCIES,
ij);
+ }
+ if (ij.getBean() != null && Beans.isPassivatingScope(ij.getBean(),
beanManager) && (!ij.isTransient()) &&
!Beans.isPassivationCapableBean(resolvedBean))
+ {
+ validateInjectionPointPassivationCapable(ij, resolvedBean, beanManager);
+ }
+ }
+
+ public void validateInjectionPointPassivationCapable(InjectionPoint ij, Bean<?>
resolvedBean, BeanManagerImpl beanManager)
+ {
+ if (!ij.isTransient() &&
!Beans.isPassivationCapableDependency(resolvedBean))
+ {
+ if (resolvedBean.getScope().equals(Dependent.class) && resolvedBean
instanceof AbstractProducerBean<?, ?, ?>)
+ {
+ throw new
IllegalProductException(NON_SERIALIZABLE_BEAN_INJECTED_INTO_PASSIVATING_BEAN,
ij.getBean(), resolvedBean);
+ }
+ throw new
UnserializableDependencyException(INJECTION_POINT_HAS_NON_SERIALIZABLE_DEPENDENCY,
ij.getBean(), resolvedBean);
+ }
+ }
+
+ public void validateDeployment(BeanManagerImpl manager, BeanDeployerEnvironment
environment)
+ {
+ validateBeans(manager.getDecorators(), new ArrayList<RIBean<?>>(),
manager);
+ validateBeans(manager.getBeans(), new ArrayList<RIBean<?>>(),
manager);
+ validateEnabledDecoratorClasses(manager);
+ validateEnabledInterceptorClasses(manager);
+ validateEnabledAlternatives(manager);
+ validateDisposalMethods(environment);
+ validateBeanNames(manager);
+ }
+
+ public void validateBeans(Collection<? extends Bean<?>> beans,
Collection<RIBean<?>> specializedBeans, BeanManagerImpl manager)
+ {
+ for (Bean<?> bean : beans)
+ {
+ if (bean instanceof RIBean<?>)
+ {
+ validateRIBean((RIBean<?>) bean, manager, specializedBeans);
+ }
+ else
+ {
+ validateBean(bean, manager);
+ }
+ }
+ }
+
+ public void validateBeanNames(BeanManagerImpl beanManager)
+ {
+ Multimap<String, Bean<?>> namedAccessibleBeans =
Multimaps.newSetMultimap(new HashMap<String, Collection<Bean<?>>>(), new
Supplier<Set<Bean<?>>>()
+ {
+
+ public Set<Bean<?>> get()
+ {
+ return new HashSet<Bean<?>>();
+ }
+
+ });
+ for (Bean<?> bean : beanManager.getAccessibleBeans())
+ {
+ if (bean.getName() != null)
+ {
+ namedAccessibleBeans.put(bean.getName(), bean);
+ }
+ }
+
+ List<String> accessibleNamespaces = new ArrayList<String>();
+ for (String namespace : beanManager.getAccessibleNamespaces())
+ {
+ accessibleNamespaces.add(namespace);
+ }
+
+ for (String name : namedAccessibleBeans.keySet())
+ {
+ Set<Bean<?>> resolvedBeans =
beanManager.getBeanResolver().resolve(namedAccessibleBeans.get(name));
+ if (resolvedBeans.size() > 1)
+ {
+ throw new DeploymentException(AMBIGUOUS_EL_NAME, name, resolvedBeans);
+ }
+ if (accessibleNamespaces.contains(name))
+ {
+ throw new DeploymentException(BEAN_NAME_IS_PREFIX, name);
+ }
+ }
+ }
+
+ private void validateEnabledInterceptorClasses(BeanManagerImpl beanManager)
+ {
+ Set<Class<?>> interceptorBeanClasses = new
HashSet<Class<?>>();
+ for (Interceptor<?> interceptor : beanManager.getInterceptors())
+ {
+ interceptorBeanClasses.add(interceptor.getBeanClass());
+ }
+ for (Class<?> enabledInterceptorClass :
beanManager.getEnabledInterceptorClasses())
+ {
+ if (beanManager.getEnabledInterceptorClasses().indexOf(enabledInterceptorClass)
< beanManager.getEnabledInterceptorClasses().lastIndexOf(enabledInterceptorClass))
+ {
+ throw new DeploymentException(INTERCEPTOR_SPECIFIED_TWICE,
enabledInterceptorClass + " specified twice");
+ }
+ if (!interceptorBeanClasses.contains(enabledInterceptorClass))
+ {
+ throw new DeploymentException(INTERCEPTOR_NOT_ANNOTATED_OR_REGISTERED,
enabledInterceptorClass);
+ }
+ }
+ }
+
+ private void validateEnabledDecoratorClasses(BeanManagerImpl beanManager)
+ {
+ // TODO Move building this list to the boot or sth
+ Set<Class<?>> decoratorBeanClasses = new
HashSet<Class<?>>();
+ for (Decorator<?> bean : beanManager.getDecorators())
+ {
+ decoratorBeanClasses.add(bean.getBeanClass());
+ }
+ for (Class<?> clazz : beanManager.getEnabledDecoratorClasses())
+ {
+ if (beanManager.getEnabledDecoratorClasses().indexOf(clazz) <
beanManager.getEnabledDecoratorClasses().lastIndexOf(clazz))
+ {
+ throw new DeploymentException(DECORATOR_SPECIFIED_TWICE, clazz);
+ }
+ if (!decoratorBeanClasses.contains(clazz))
+ {
+ throw new DeploymentException(DECORATOR_CLASS_NOT_BEAN_CLASS_OF_DECORATOR,
clazz, decoratorBeanClasses);
+ }
+ }
+ }
+
+ private void validateEnabledAlternatives(BeanManagerImpl beanManager)
+ {
+ List<Class<?>> seenAlternatives = new
ArrayList<Class<?>>();
+ for (Class<? extends Annotation> stereotype :
beanManager.getEnabledAlternativeStereotypes())
+ {
+ if (!stereotype.isAnnotationPresent(Alternative.class))
+ {
+ throw new DeploymentException(ALTERNATIVE_STEREOTYPE_NOT_ANNOTATED,
stereotype);
+ }
+ if (seenAlternatives.contains(stereotype))
+ {
+ throw new
DeploymentException(ALTERNATIVE_STEREOTYPE_SPECIFIED_MULTIPLE_TIMES, stereotype);
+ }
+ seenAlternatives.add(stereotype);
+ }
+ for (Class<?> clazz : beanManager.getEnabledAlternativeClasses())
+ {
+ if (!clazz.isAnnotationPresent(Alternative.class))
+ {
+ throw new DeploymentException(ALTERNATIVE_BEAN_CLASS_NOT_ANNOTATED, clazz);
+ }
+ if (seenAlternatives.contains(clazz))
+ {
+ throw new
DeploymentException(ALTERNATIVE_BEAN_CLASS_SPECIFIED_MULTIPLE_TIMES, clazz);
+ }
+ seenAlternatives.add(clazz);
+ }
+ }
+
+ private void validateDisposalMethods(BeanDeployerEnvironment environment)
+ {
+ Set<DisposalMethod<?, ?>> beans =
environment.getUnresolvedDisposalBeans();
+ if (!beans.isEmpty())
+ {
+ throw new DefinitionException(DISPOSAL_METHODS_WITHOUT_PRODUCER, beans);
+ }
+ }
+
+ private static void checkFacadeInjectionPoint(InjectionPoint injectionPoint,
Class<?> type)
+ {
+ if (injectionPoint.getAnnotated().getBaseType().equals(type))
+ {
+ if (injectionPoint.getType() instanceof ParameterizedType)
+ {
+ ParameterizedType parameterizedType = (ParameterizedType)
injectionPoint.getType();
+ if (parameterizedType.getActualTypeArguments()[0] instanceof
TypeVariable<?>)
+ {
+ throw new DefinitionException(INJECTION_POINT_WITH_TYPE_VARIABLE,
injectionPoint);
+ }
+ if (parameterizedType.getActualTypeArguments()[0] instanceof WildcardType)
+ {
+ throw new DefinitionException(INJECTION_POINT_HAS_WILDCARD, type,
injectionPoint);
+ }
+ }
+ else
+ {
+ throw new DefinitionException(INJECTION_POINT_MUST_HAVE_TYPE_PARAMETER, type,
injectionPoint);
+ }
+ }
+
+ }
+
+ public void cleanup()
+ {
+ }
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/Validator.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/WeldBootstrap.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -38,15 +38,10 @@
import javax.enterprise.inject.spi.Extension;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.ContextualStoreImpl;
-import org.jboss.weld.ForbiddenArgumentException;
-import org.jboss.weld.ForbiddenStateException;
-import org.jboss.weld.Validator;
import org.jboss.weld.Container.Status;
import org.jboss.weld.bean.builtin.BeanManagerBean;
-import org.jboss.weld.bean.builtin.CallableMethodHandler.CallableMethodHandlerCleaner;
import org.jboss.weld.bootstrap.api.Bootstrap;
import org.jboss.weld.bootstrap.api.Environment;
import org.jboss.weld.bootstrap.api.Lifecycle;
@@ -75,8 +70,11 @@
import org.jboss.weld.ejb.EJBApiAbstraction;
import org.jboss.weld.ejb.EjbDescriptors;
import org.jboss.weld.ejb.spi.EjbDescriptor;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.jsf.JsfApiAbstraction;
import org.jboss.weld.logging.messages.VersionMessage;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.persistence.PersistenceApiAbstraction;
@@ -90,6 +88,7 @@
import org.jboss.weld.servlet.ServletApiAbstraction;
import org.jboss.weld.servlet.api.ServletServices;
import org.jboss.weld.transaction.spi.TransactionServices;
+import org.jboss.weld.util.JavassistCleaner;
import org.jboss.weld.util.Names;
import org.jboss.weld.util.collections.Arrays2;
import org.jboss.weld.util.serviceProvider.DefaultServiceLoaderFactory;
@@ -321,7 +320,7 @@
services.add(MetaAnnotationStore.class, new
MetaAnnotationStore(services.get(ClassTransformer.class)));
services.add(ContextualStore.class, new ContextualStoreImpl());
services.add(ServiceLoaderFactory.class, new DefaultServiceLoaderFactory());
- services.add(CallableMethodHandlerCleaner.class, new
CallableMethodHandlerCleaner());
+ services.add(JavassistCleaner.class, new JavassistCleaner());
return services;
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractBeanDiscoveryEvent.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractBeanDiscoveryEvent.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractBeanDiscoveryEvent.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -19,11 +19,11 @@
import java.lang.reflect.Type;
import java.util.Map;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.ExtensionBeanDeployerEnvironment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.util.DeploymentStructures;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractContainerEvent.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractContainerEvent.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractContainerEvent.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -9,9 +9,9 @@
import javax.enterprise.inject.spi.ObserverMethod;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.reflection.ParameterizedTypeImpl;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDefinitionContainerEvent.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDefinitionContainerEvent.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDefinitionContainerEvent.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -18,8 +18,8 @@
import java.lang.reflect.Type;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.DefinitionException;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* @author pmuir
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDeploymentContainerEvent.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDeploymentContainerEvent.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractDeploymentContainerEvent.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -18,8 +18,8 @@
import java.lang.reflect.Type;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.DeploymentException;
+import org.jboss.weld.exceptions.DeploymentException;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* @author pmuir
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessClassBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessClassBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessClassBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -5,8 +5,8 @@
import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.ProcessBean;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.AbstractClassBean;
+import org.jboss.weld.manager.BeanManagerImpl;
public abstract class AbstractProcessClassBean<X, B extends
AbstractClassBean<X>> extends AbstractDefinitionContainerEvent implements
ProcessBean<X>
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessInjectionTarget.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessInjectionTarget.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessInjectionTarget.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -7,8 +7,8 @@
import javax.enterprise.inject.spi.InjectionTarget;
import javax.enterprise.inject.spi.ProcessInjectionTarget;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.AbstractClassBean;
+import org.jboss.weld.manager.BeanManagerImpl;
public abstract class AbstractProcessInjectionTarget<T> extends
AbstractDefinitionContainerEvent
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessProducerBean.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessProducerBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AbstractProcessProducerBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -5,8 +5,8 @@
import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.ProcessBean;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.AbstractProducerBean;
+import org.jboss.weld.manager.BeanManagerImpl;
public abstract class AbstractProcessProducerBean<X, T, B extends
AbstractProducerBean<X, T, ? >> extends AbstractDefinitionContainerEvent
implements ProcessBean<T>
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterBeanDiscoveryImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -27,11 +27,11 @@
import javax.enterprise.inject.spi.Interceptor;
import javax.enterprise.inject.spi.Decorator;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.CustomDecoratorWrapper;
import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.manager.BeanManagerImpl;
public class AfterBeanDiscoveryImpl extends AbstractBeanDiscoveryEvent implements
AfterBeanDiscovery
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterDeploymentValidationImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterDeploymentValidationImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/AfterDeploymentValidationImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -20,9 +20,9 @@
import javax.enterprise.inject.spi.AfterDeploymentValidation;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.manager.BeanManagerImpl;
public class AfterDeploymentValidationImpl extends AbstractDeploymentContainerEvent
implements AfterDeploymentValidation
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeBeanDiscoveryImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -22,7 +22,6 @@
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
@@ -31,6 +30,7 @@
import org.jboss.weld.literal.NormalScopeLiteral;
import org.jboss.weld.literal.ScopeLiteral;
import org.jboss.weld.literal.StereotypeLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
public class BeforeBeanDiscoveryImpl extends AbstractBeanDiscoveryEvent implements
BeforeBeanDiscovery
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeShutdownImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeShutdownImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/BeforeShutdownImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -18,7 +18,7 @@
import javax.enterprise.inject.spi.BeforeShutdown;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* @author pmuir
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessAnnotatedTypeImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessAnnotatedTypeImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessAnnotatedTypeImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -23,9 +23,9 @@
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.ProcessAnnotatedType;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* Container lifecycle event for each Java class or interface discovered by
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessBeanImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessBeanImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessBeanImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -6,8 +6,8 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.ProcessBean;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.introspector.WeldAnnotated;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
public abstract class ProcessBeanImpl<X> extends AbstractDefinitionContainerEvent
implements ProcessBean<X>
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessBeanInjectionTarget.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessBeanInjectionTarget.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessBeanInjectionTarget.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -3,8 +3,8 @@
import javax.enterprise.inject.spi.InjectionTarget;
import javax.enterprise.inject.spi.ProcessInjectionTarget;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.AbstractClassBean;
+import org.jboss.weld.manager.BeanManagerImpl;
public class ProcessBeanInjectionTarget<T> extends
AbstractProcessInjectionTarget<T> implements ProcessInjectionTarget<T>
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessManagedBeanImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessManagedBeanImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessManagedBeanImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -5,8 +5,8 @@
import javax.enterprise.inject.spi.AnnotatedType;
import javax.enterprise.inject.spi.ProcessManagedBean;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.ManagedBean;
+import org.jboss.weld.manager.BeanManagerImpl;
public class ProcessManagedBeanImpl<X> extends AbstractProcessClassBean<X,
ManagedBean<X>> implements ProcessManagedBean<X>
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessObserverMethodImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -25,8 +25,8 @@
import javax.enterprise.inject.spi.ObserverMethod;
import javax.enterprise.inject.spi.ProcessObserverMethod;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.event.ObserverMethodImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* Implementation of the event used to notify observers for each observer
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerFieldImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerFieldImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerFieldImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -5,8 +5,8 @@
import javax.enterprise.inject.spi.AnnotatedField;
import javax.enterprise.inject.spi.ProcessProducerField;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.ProducerField;
+import org.jboss.weld.manager.BeanManagerImpl;
public class ProcessProducerFieldImpl<X, T> extends
AbstractProcessProducerBean<X, T, ProducerField<X, T>> implements
ProcessProducerField<X, T>
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -7,8 +7,8 @@
import javax.enterprise.inject.spi.ProcessProducer;
import javax.enterprise.inject.spi.Producer;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.AbstractProducerBean;
+import org.jboss.weld.manager.BeanManagerImpl;
public class ProcessProducerImpl<X, T> extends AbstractDefinitionContainerEvent
implements ProcessProducer<X, T>
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerMethodImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerMethodImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessProducerMethodImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -6,8 +6,8 @@
import javax.enterprise.inject.spi.AnnotatedParameter;
import javax.enterprise.inject.spi.ProcessProducerMethod;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.ProducerMethod;
+import org.jboss.weld.manager.BeanManagerImpl;
public class ProcessProducerMethodImpl<X, T> extends
AbstractProcessProducerBean<X, T, ProducerMethod<X, T>> implements
ProcessProducerMethod<X, T>
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSessionBeanImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSessionBeanImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSessionBeanImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -8,9 +8,9 @@
import javax.enterprise.inject.spi.ProcessSessionBean;
import javax.enterprise.inject.spi.SessionBeanType;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.bean.SessionBean;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.manager.BeanManagerImpl;
public class ProcessSessionBeanImpl<X> extends AbstractProcessClassBean<Object,
SessionBean<Object>> implements ProcessSessionBean<X>
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSimpleInjectionTarget.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSimpleInjectionTarget.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/bootstrap/events/ProcessSimpleInjectionTarget.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -4,7 +4,7 @@
import javax.enterprise.inject.spi.InjectionTarget;
import javax.enterprise.inject.spi.ProcessInjectionTarget;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
public class ProcessSimpleInjectionTarget<T> extends
AbstractProcessInjectionTarget<T> implements ProcessInjectionTarget<T>
Modified: core/trunk/impl/src/main/java/org/jboss/weld/context/AbstractMapContext.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/context/AbstractMapContext.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/context/AbstractMapContext.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -31,10 +31,10 @@
import javax.enterprise.context.spi.CreationalContext;
import org.jboss.weld.Container;
-import org.jboss.weld.ForbiddenArgumentException;
-import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.context.api.BeanStore;
import org.jboss.weld.context.api.ContextualInstance;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.serialization.spi.ContextualStore;
import org.slf4j.cal10n.LocLogger;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/context/ContextNotActiveException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -17,7 +17,7 @@
package org.jboss.weld.context;
-import org.jboss.weld.WeldExceptionMessage;
+import org.jboss.weld.exceptions.WeldExceptionMessage;
/**
* A localized message version of the
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/context/beanstore/NamingScheme.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/context/beanstore/NamingScheme.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/context/beanstore/NamingScheme.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -18,7 +18,7 @@
import static org.jboss.weld.logging.messages.ContextMessage.DELIMITER_IN_PREFIX;
-import org.jboss.weld.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/conversation/ConversationImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -32,7 +32,7 @@
import javax.inject.Inject;
import javax.inject.Named;
-import org.jboss.weld.ForbiddenStateException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
import org.slf4j.cal10n.LocLogger;
/**
Modified: core/trunk/impl/src/main/java/org/jboss/weld/ejb/EjbDescriptors.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/ejb/EjbDescriptors.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/ejb/EjbDescriptors.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -25,10 +25,10 @@
import java.util.Map;
import java.util.Set;
-import org.jboss.weld.ForbiddenStateException;
-import org.jboss.weld.InvalidOperationException;
import org.jboss.weld.bootstrap.api.Service;
import org.jboss.weld.ejb.spi.EjbDescriptor;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.exceptions.InvalidOperationException;
import com.google.common.base.Supplier;
import com.google.common.collect.Multimaps;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/el/AbstractWeldELResolver.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -27,8 +27,8 @@
import javax.el.ELResolver;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.WeldException;
+import org.jboss.weld.exceptions.WeldException;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* An EL-resolver against the named beans
Modified: core/trunk/impl/src/main/java/org/jboss/weld/el/WeldELResolver.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/el/WeldELResolver.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/el/WeldELResolver.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -18,7 +18,7 @@
import javax.el.ELContext;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* @author pmuir
Modified: core/trunk/impl/src/main/java/org/jboss/weld/el/WeldExpressionFactory.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/el/WeldExpressionFactory.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/el/WeldExpressionFactory.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -23,7 +23,7 @@
import javax.el.MethodExpression;
import javax.el.ValueExpression;
-import org.jboss.weld.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.util.el.ForwardingExpressionFactory;
/**
Modified: core/trunk/impl/src/main/java/org/jboss/weld/event/EventImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/event/EventImpl.java 2010-01-08 12:25:43
UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/event/EventImpl.java 2010-01-08 13:59:36
UTC (rev 5398)
@@ -32,10 +32,10 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.util.TypeLiteral;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.InvalidObjectException;
import org.jboss.weld.bean.builtin.AbstractFacade;
+import org.jboss.weld.exceptions.InvalidObjectException;
import org.jboss.weld.literal.DefaultLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Names;
import org.jboss.weld.util.Observers;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -19,10 +19,10 @@
import javax.enterprise.event.Observes;
import javax.enterprise.event.TransactionPhase;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.transaction.spi.TransactionServices;
/**
Modified: core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -42,14 +42,14 @@
import javax.inject.Inject;
import javax.inject.Qualifier;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.DefinitionException;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bootstrap.events.AbstractContainerEvent;
+import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
/**
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -19,9 +19,9 @@
import javax.enterprise.event.TransactionPhase;
import javax.transaction.Synchronization;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.transaction.spi.TransactionServices;
/**
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/AmbiguousResolutionException.java
(from rev 5388,
core/trunk/impl/src/main/java/org/jboss/weld/AmbiguousResolutionException.java)
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/AmbiguousResolutionException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/AmbiguousResolutionException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * Provides message localization service for the
+ * {@link javax.enterprise.inject.AmbiguousResolutionException}.
+ *
+ * @author David Allen
+ */
+public class AmbiguousResolutionException extends
javax.enterprise.inject.AmbiguousResolutionException
+{
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public AmbiguousResolutionException(Throwable throwable)
+ {
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
+ }
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> AmbiguousResolutionException(E key, Object...
args)
+ {
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/AmbiguousResolutionException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: core/trunk/impl/src/main/java/org/jboss/weld/exceptions/CreationException.java
(from rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/CreationException.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/exceptions/CreationException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/CreationException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * A version of {@link javax.enterprise.inject.CreationException} that supports
+ * message localization.
+ *
+ * @author David Allen
+ */
+public class CreationException extends javax.enterprise.inject.CreationException
+{
+
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> CreationException(E key, Object... args)
+ {
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ /**
+ * Creates a new exception with the given localized message key, the cause
+ * for this exception and optional arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param throwable The cause for this exception
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> CreationException(E key, Throwable throwable,
Object... args)
+ {
+ super(throwable);
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/CreationException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: core/trunk/impl/src/main/java/org/jboss/weld/exceptions/DefinitionException.java
(from rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/DefinitionException.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/exceptions/DefinitionException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/DefinitionException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.exceptions;
+
+import java.util.List;
+
+/**
+ * Thrown if the definition of a bean is incorrect
+ *
+ * @author Pete Muir
+ */
+public class DefinitionException extends WeldException
+{
+ private static final long serialVersionUID = 8014646336322875707L;
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> DefinitionException(E key, Object... args)
+ {
+ super(key, args);
+ }
+
+ /**
+ * Creates a new exception with the given localized message key, the cause
+ * for this exception and optional arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param throwable The cause for this exception
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> DefinitionException(E key, Throwable throwable,
Object... args)
+ {
+ super(throwable);
+ }
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public DefinitionException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+ /**
+ * Creates a new exception based on a list of throwables. The throwables are not
+ * used as the cause, but the message from each throwable is included as the message
+ * for this exception.
+ *
+ * @param errors A list of throwables to use in the message
+ */
+ public DefinitionException(List<Throwable> errors)
+ {
+ super(errors);
+ }
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/DefinitionException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: core/trunk/impl/src/main/java/org/jboss/weld/exceptions/DeploymentException.java
(from rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/DeploymentException.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/exceptions/DeploymentException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/DeploymentException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.exceptions;
+
+import java.util.List;
+
+/**
+ * Thrown if an deployment exception occurs.
+ *
+ * @author Pete Muir
+ */
+public class DeploymentException extends WeldException
+{
+ private static final long serialVersionUID = 8014646336322875707L;
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> DeploymentException(E key, Object... args)
+ {
+ super(key, args);
+ }
+
+ /**
+ * Creates a new exception with the given localized message key, the cause
+ * for this exception and optional arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param throwable The cause for this exception
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> DeploymentException(E key, Throwable throwable,
Object... args)
+ {
+ super(key, throwable, args);
+ }
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public DeploymentException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+ /**
+ * Creates a new exception based on a list of throwables. The throwables are not
+ * used as the cause, but the message from each throwable is included as the message
+ * for this exception.
+ *
+ * @param errors A list of throwables to use in the message
+ */
+ public DeploymentException(List<Throwable> errors)
+ {
+ super(errors);
+ }
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/DeploymentException.java
___________________________________________________________________
Name: svn:eol-style
+ native
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/ForbiddenArgumentException.java
(from rev 5388,
core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenArgumentException.java)
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/ForbiddenArgumentException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/ForbiddenArgumentException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * This exception is used when the specification calls for an
+ * {@link java.lang.IllegalArgumentException}.
+ *
+ * @author David Allen
+ */
+public class ForbiddenArgumentException extends IllegalArgumentException
+{
+
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public ForbiddenArgumentException(Throwable throwable)
+ {
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
+ }
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> ForbiddenArgumentException(E key, Object...
args)
+ {
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/ForbiddenArgumentException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/ForbiddenStateException.java (from
rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/ForbiddenStateException.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/exceptions/ForbiddenStateException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/ForbiddenStateException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * This exception is used when the specification calls for an
+ * {@link java.lang.IllegalStateException}.
+ *
+ * @author David Allen
+ */
+public class ForbiddenStateException extends IllegalStateException
+{
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> ForbiddenStateException(E key, Object... args)
+ {
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public ForbiddenStateException(Throwable cause)
+ {
+ super(cause.getLocalizedMessage(), cause);
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/ForbiddenStateException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/IllegalProductException.java (from
rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/IllegalProductException.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/exceptions/IllegalProductException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/IllegalProductException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * An {@link javax.enterprise.inject.IllegalProductException} with support for
+ * localized messages in Weld.
+ *
+ * @author David Allen
+ */
+public class IllegalProductException extends
javax.enterprise.inject.IllegalProductException
+{
+
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> IllegalProductException(E key, Object... args)
+ {
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/IllegalProductException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InconsistentSpecializationException.java
(from rev 5388,
core/trunk/impl/src/main/java/org/jboss/weld/InconsistentSpecializationException.java)
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InconsistentSpecializationException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InconsistentSpecializationException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,54 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.exceptions;
+
+
+/**
+ *
+ * @author Pete Muir
+ */
+public class InconsistentSpecializationException extends DeploymentException
+{
+
+ private static final long serialVersionUID = 4359656880524913555L;
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> InconsistentSpecializationException(E key,
Object... args)
+ {
+ super(key, args);
+ }
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public InconsistentSpecializationException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InconsistentSpecializationException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InjectionException.java
(from rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/InjectionException.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InjectionException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InjectionException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * Provides message localization service for the
+ * {@link javax.enterprise.inject.InjectionException}.
+ *
+ * @author David Allen
+ */
+public class InjectionException extends javax.enterprise.inject.InjectionException
+{
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public InjectionException(Throwable throwable)
+ {
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
+ }
+
+ /**
+ * Creates a new exception with an arbitrary message and the cause of the
+ * exception. It is not recommended to use this constructor since the message
+ * cannot be localized.
+ *
+ * @param message The error message
+ * @param throwable The cause of the exception or wrapped throwable
+ */
+ public InjectionException(String message, Throwable throwable)
+ {
+ super(throwable);
+ this.message = new WeldExceptionMessage(message);
+ }
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> InjectionException(E key, Object... args)
+ {
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InjectionException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InvalidObjectException.java (from
rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/InvalidObjectException.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InvalidObjectException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InvalidObjectException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * An extended version of {@link java.io.InvalidObjectException} that supports
+ * localization.
+ *
+ * @author David Allen
+ */
+public class InvalidObjectException extends java.io.InvalidObjectException
+{
+
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> InvalidObjectException(E key, Object... args)
+ {
+ super(null);
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InvalidObjectException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InvalidOperationException.java
(from rev 5388,
core/trunk/impl/src/main/java/org/jboss/weld/InvalidOperationException.java)
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InvalidOperationException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InvalidOperationException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * An exception used for unsupported operations or invocations of operations
+ * that are invalid in certain contexts.
+ *
+ * @author David Allen
+ */
+public class InvalidOperationException extends UnsupportedOperationException
+{
+
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with no message. Here the stacktrace serves as the
+ * main information since it has the method which was invoked causing this
+ * exception.
+ */
+ public InvalidOperationException()
+ {
+ super();
+ }
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> InvalidOperationException(E key, Object...
args)
+ {
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/InvalidOperationException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: core/trunk/impl/src/main/java/org/jboss/weld/exceptions/NullInstanceException.java
(from rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/NullInstanceException.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/exceptions/NullInstanceException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/NullInstanceException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * This exception occurs in cases where an object instance was expected, but
+ * the reference was null. A typical example is with a producer method that
+ * is not allowed to return null.
+ *
+ * @author David Allen
+ *
+ */
+public class NullInstanceException extends WeldException
+{
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> NullInstanceException(E key, Object... args)
+ {
+ super(key, args);
+ }
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/NullInstanceException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/NullableDependencyException.java
(from rev 5388,
core/trunk/impl/src/main/java/org/jboss/weld/NullableDependencyException.java)
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/NullableDependencyException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/NullableDependencyException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.exceptions;
+
+
+/**
+ * Thrown if an injection point of primitive type resolves to a bean which may
+ * be null
+ *
+ * @author Pete Muir
+ */
+public class NullableDependencyException extends DeploymentException
+{
+
+ private static final long serialVersionUID = 6877485218767005761L;
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> NullableDependencyException(E key, Object...
args)
+ {
+ super(key, args);
+ }
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public NullableDependencyException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/NullableDependencyException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnproxyableResolutionException.java
(from rev 5388,
core/trunk/impl/src/main/java/org/jboss/weld/UnproxyableResolutionException.java)
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnproxyableResolutionException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnproxyableResolutionException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * Provides message localization service for the
+ * {@link javax.enterprise.inject.UnproxyableResolutionException}.
+ *
+ * @author David Allen
+ */
+public class UnproxyableResolutionException extends
javax.enterprise.inject.UnproxyableResolutionException
+{
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public UnproxyableResolutionException(Throwable throwable)
+ {
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
+ }
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> UnproxyableResolutionException(E key, Object...
args)
+ {
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnproxyableResolutionException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnsatisfiedResolutionException.java
(from rev 5388,
core/trunk/impl/src/main/java/org/jboss/weld/UnsatisfiedResolutionException.java)
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnsatisfiedResolutionException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnsatisfiedResolutionException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+/**
+ * Provides message localization service for the
+ * {@link javax.enterprise.inject.UnsatisfiedResolutionException}.
+ *
+ * @author David Allen
+ */
+public class UnsatisfiedResolutionException extends
javax.enterprise.inject.UnsatisfiedResolutionException
+{
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public UnsatisfiedResolutionException(Throwable throwable)
+ {
+ super(throwable);
+ message = new WeldExceptionMessage(throwable.getLocalizedMessage());
+ }
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> UnsatisfiedResolutionException(E key, Object...
args)
+ {
+ message = new WeldExceptionMessage(key, args);
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnsatisfiedResolutionException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnserializableDependencyException.java
(from rev 5388,
core/trunk/impl/src/main/java/org/jboss/weld/UnserializableDependencyException.java)
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnserializableDependencyException.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnserializableDependencyException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.exceptions;
+
+
+
+/**
+ * Thrown if a simple bean is dependent scoped and injected into a stateful
+ * session bean, into a non-transient field, bean constructor parameter or
+ * initializer method parameter of a bean which declares a passivating scope, or
+ * into a parameter of a producer method which declares a passivating scope
+ *
+ * @author Pete Muir
+ */
+public class UnserializableDependencyException extends DeploymentException
+{
+
+ private static final long serialVersionUID = -6287506607413810688L;
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> UnserializableDependencyException(E key,
Object... args)
+ {
+ super(key, args);
+ }
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public UnserializableDependencyException(Throwable throwable)
+ {
+ super(throwable);
+ }
+
+
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/UnserializableDependencyException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: core/trunk/impl/src/main/java/org/jboss/weld/exceptions/WeldException.java (from
rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/WeldException.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/exceptions/WeldException.java
(rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/exceptions/WeldException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+import java.util.List;
+
+/**
+ * A general run-time exception used by the JSR-299 reference implementation Weld.
+ *
+ * @author David Allen
+ */
+public class WeldException extends RuntimeException
+{
+ private static final long serialVersionUID = 2L;
+
+ private WeldExceptionMessage message;
+
+ /**
+ * Creates a new exception with the given cause.
+ *
+ * @param throwable The cause of the exception
+ */
+ public WeldException(Throwable throwable)
+ {
+ super(throwable);
+ this.message = new WeldExceptionMessage(throwable.getLocalizedMessage());
+ }
+
+ /**
+ * Creates a new exception with the given localized message key and optional
+ * arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> WeldException(E key, Object... args)
+ {
+ this.message = new WeldExceptionMessage(key, args);
+ }
+
+ /**
+ * Creates a new exception with the given localized message key, the cause
+ * for this exception and optional arguments for the message.
+ *
+ * @param <E> The enumeration type for the message keys
+ * @param key The localized message to use
+ * @param throwable The cause for this exception
+ * @param args Optional arguments to insert into the message
+ */
+ public <E extends Enum<?>> WeldException(E key, Throwable throwable,
Object... args)
+ {
+ super(throwable);
+ this.message = new WeldExceptionMessage(key, args);
+ }
+
+ /**
+ * Creates a new exception based on a list of throwables. The throwables are not
+ * used as the cause, but the message from each throwable is included as the message
+ * for this exception.
+ *
+ * @param errors A list of throwables to use in the message
+ */
+ public WeldException(List<Throwable> errors)
+ {
+ super();
+ StringBuilder errorMessage = new StringBuilder();
+ boolean firstError = true;
+ for (Throwable throwable : errors)
+ {
+ if (!firstError)
+ {
+ errorMessage.append('\n');
+ }
+ errorMessage.append(throwable.getLocalizedMessage());
+ }
+ this.message = new WeldExceptionMessage(errorMessage.toString());
+ }
+
+ @Override
+ public String getLocalizedMessage()
+ {
+ return getMessage();
+ }
+
+ @Override
+ public String getMessage()
+ {
+ return message.getAsString();
+ }
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/WeldException.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: core/trunk/impl/src/main/java/org/jboss/weld/exceptions/WeldExceptionMessage.java
(from rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/WeldExceptionMessage.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/exceptions/WeldExceptionMessage.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/WeldExceptionMessage.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat, Inc. and/or its affiliates, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.jboss.weld.exceptions;
+
+import static org.jboss.weld.logging.LoggerFactory.loggerFactory;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * The message for exceptions generated by Weld. Each exception contains one
+ * message object which will handle the generation of the string message at the
+ * time the message is needed. This includes localization of the message based
+ * on the settings in the JVM where the {@link java.lang.Throwable#getMessage()}
+ * or {@link java.lang.Throwable#getLocalizedMessage()} methods are invoked.
+ * </p>
+ *
+ * @author David Allen
+ */
+public class WeldExceptionMessage implements Serializable
+{
+
+ private static final long serialVersionUID = 2L;
+
+ /**
+ * The string version of the message. This is only used when the original
+ * message from a wrapped exception is being used. Since it is already
+ * localized, it will simply be stored here and used as the message.
+ */
+ private String message;
+
+ private Enum<?> messageKey;
+ private Object messageArguments[];
+
+ /**
+ * <p>
+ * Creates a new exception message initialized to a static message. Use this
+ * only for messages generated by third-party software, i.e., those which do
+ * not use enumerated message keys.
+ * </p>
+ *
+ * @param message the static message
+ */
+ public WeldExceptionMessage(String message)
+ {
+ // This will not be further localized
+ this.message = message;
+ }
+
+ /**
+ * <p>
+ * Creates a new exception message based on an enumerated message key. This
+ * message will not be localized until it is actually logged or other
+ * software invokes the {@link #getMessage()} method.
+ * </p>
+ *
+ * @param <E> the message key enumeration
+ * @param key the message key from the above enumeration
+ * @param args optional arguments for the message
+ */
+ public <E extends Enum<?>> WeldExceptionMessage(E key, Object... args)
+ {
+ this.messageKey = key;
+ if ((args != null) && (args.length > 0))
+ {
+ this.messageArguments = new String[args.length];
+ int index = 0;
+ for (Object arg : args)
+ {
+ messageArguments[index++] = arg.toString();
+ }
+ }
+ }
+
+ /**
+ * Generates the localized message for the exception.
+ *
+ * @return exception message as a string
+ */
+ public String getAsString()
+ {
+ String result = message;
+ if (result == null)
+ {
+ try
+ {
+ result = loggerFactory().getMessageConveyor().getMessage(messageKey,
messageArguments);
+ }
+ catch (Exception e)
+ {
+ // We want the using exception to be processed, but also include
+ // this one in its message
+ result = "Exception message for key " + messageKey + " not
found due to " + e.getLocalizedMessage();
+ }
+ if (result == null)
+ {
+ result = "Exception message for key " + messageKey + " not
found";
+ }
+ }
+ return result;
+ }
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/exceptions/WeldExceptionMessage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/injection/ConstructorInjectionPoint.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/injection/ConstructorInjectionPoint.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/injection/ConstructorInjectionPoint.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -36,14 +36,14 @@
import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.InvalidObjectException;
-import org.jboss.weld.InvalidOperationException;
+import org.jboss.weld.exceptions.InvalidObjectException;
+import org.jboss.weld.exceptions.InvalidOperationException;
import org.jboss.weld.introspector.ConstructorSignature;
import org.jboss.weld.introspector.ForwardingWeldConstructor;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldConstructor;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.manager.BeanManagerImpl;
public class ConstructorInjectionPoint<T> extends
ForwardingWeldConstructor<T> implements WeldInjectionPoint<T,
Constructor<T>>, Serializable
{
Modified: core/trunk/impl/src/main/java/org/jboss/weld/injection/Exceptions.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/injection/Exceptions.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/injection/Exceptions.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -20,7 +20,7 @@
import javax.enterprise.inject.CreationException;
-import org.jboss.weld.WeldException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.util.reflection.SecureReflections;
class Exceptions
Modified: core/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -36,10 +36,10 @@
import javax.inject.Inject;
import org.jboss.interceptor.util.InterceptionUtils;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.InvalidObjectException;
+import org.jboss.weld.exceptions.InvalidObjectException;
import org.jboss.weld.introspector.ForwardingWeldField;
import org.jboss.weld.introspector.WeldField;
+import org.jboss.weld.manager.BeanManagerImpl;
public class FieldInjectionPoint<T, X> extends ForwardingWeldField<T, X>
implements WeldInjectionPoint<T, Field>, Serializable
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/injection/InjectionContextImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/injection/InjectionContextImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/injection/InjectionContextImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -18,9 +18,9 @@
import javax.enterprise.inject.spi.InjectionTarget;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.injection.spi.InjectionContext;
import org.jboss.weld.injection.spi.InjectionServices;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* @author pmuir
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/injection/MethodInjectionPoint.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/injection/MethodInjectionPoint.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/injection/MethodInjectionPoint.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -35,12 +35,12 @@
import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.InvalidObjectException;
+import org.jboss.weld.exceptions.InvalidObjectException;
import org.jboss.weld.introspector.ForwardingWeldMethod;
import org.jboss.weld.introspector.MethodSignature;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.manager.BeanManagerImpl;
public class MethodInjectionPoint<T, X> extends ForwardingWeldMethod<T, X>
implements WeldInjectionPoint<T, Method>
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/injection/ParameterInjectionPoint.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/injection/ParameterInjectionPoint.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/injection/ParameterInjectionPoint.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -35,16 +35,16 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.Decorator;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenStateException;
-import org.jboss.weld.InvalidObjectException;
-import org.jboss.weld.InvalidOperationException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.exceptions.InvalidObjectException;
+import org.jboss.weld.exceptions.InvalidOperationException;
import org.jboss.weld.introspector.ConstructorSignature;
import org.jboss.weld.introspector.ForwardingWeldParameter;
import org.jboss.weld.introspector.MethodSignature;
import org.jboss.weld.introspector.WeldConstructor;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.manager.BeanManagerImpl;
public class ParameterInjectionPoint<T, X> extends ForwardingWeldParameter<T,
X> implements WeldInjectionPoint<T, Object>, Serializable
{
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/injection/ProxyClassConstructorInjectionPointWrapper.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/injection/ProxyClassConstructorInjectionPointWrapper.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/injection/ProxyClassConstructorInjectionPointWrapper.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -23,8 +23,8 @@
import java.lang.annotation.Annotation;
import java.util.List;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.introspector.WeldConstructor;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* A wrapper on a {@link ConstructorInjectionPoint}, to be used if a proxy subclass is
instantiated instead of the
Modified: core/trunk/impl/src/main/java/org/jboss/weld/introspector/AnnotationStore.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/introspector/AnnotationStore.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/AnnotationStore.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -32,7 +32,7 @@
import javax.inject.Qualifier;
-import org.jboss.weld.WeldException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.literal.DefaultLiteral;
import org.jboss.weld.logging.messages.ReflectionMessage;
import org.jboss.weld.metadata.TypeStore;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -31,12 +31,12 @@
import javax.enterprise.inject.spi.AnnotatedConstructor;
import javax.enterprise.inject.spi.AnnotatedParameter;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.introspector.AnnotationStore;
import org.jboss.weld.introspector.ConstructorSignature;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldConstructor;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
import org.jboss.weld.util.reflection.Reflections;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -22,7 +22,7 @@
import static org.jboss.weld.logging.messages.UtilMessage.ACCESS_ERROR_ON_FIELD;
import javax.enterprise.inject.spi.AnnotatedField;
-import org.jboss.weld.WeldException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.introspector.AnnotationStore;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldField;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -24,7 +24,7 @@
import javax.enterprise.inject.spi.AnnotatedCallable;
-import org.jboss.weld.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.introspector.AnnotationStore;
import org.jboss.weld.introspector.WeldCallable;
import org.jboss.weld.introspector.WeldParameter;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/jsf/JsfHelper.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/jsf/JsfHelper.java 2010-01-08 12:25:43
UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/jsf/JsfHelper.java 2010-01-08 13:59:36
UTC (rev 5398)
@@ -27,10 +27,10 @@
import javax.servlet.ServletContext;
import javax.servlet.http.HttpSession;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
-import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.conversation.ConversationIdName;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.servlet.ServletHelper;
import org.jboss.weld.util.reflection.SecureReflections;
import org.slf4j.cal10n.LocLogger;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/jsf/WeldPhaseListener.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -37,13 +37,13 @@
import javax.faces.event.PhaseListener;
import javax.servlet.http.HttpSession;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.context.ContextLifecycle;
import org.jboss.weld.context.ConversationContext;
import org.jboss.weld.context.SessionContext;
import org.jboss.weld.conversation.ConversationImpl;
import org.jboss.weld.conversation.ConversationManager;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.servlet.ConversationBeanStore;
import org.jboss.weld.servlet.HttpSessionManager;
import org.slf4j.cal10n.LocLogger;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/logging/messages/ReflectionMessage.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -27,6 +27,7 @@
@MessageId("000605")
MISSING_TARGET_METHOD_FIELD_TYPE_PARAMETER_OR_TARGET_METHOD_TYPE_OR_TARGET_METHOD_OR_TARGET_TYPE_OR_TARGET_FIELD,
@MessageId("000606") UNABLE_TO_GET_PARAMETER_NAME,
@MessageId("000607") ANNOTATION_MAP_NULL,
- @MessageId("000608") DECLARED_ANNOTATION_MAP_NULL;
+ @MessageId("000608") DECLARED_ANNOTATION_MAP_NULL,
+ @MessageId("000609") CLEANING_JAVASSIST_PROXY_CLASS;
}
Copied: core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java (from
rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java
(rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,1571 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.manager;
+
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.AMBIGUOUS_BEANS_FOR_DEPENDENCY;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.CONTEXT_NOT_ACTIVE;
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.DUPLICATE_ACTIVE_CONTEXTS;
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.DUPLICATE_INTERCEPTOR_BINDING;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.DUPLICATE_QUALIFIERS;
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.INTERCEPTOR_BINDINGS_EMPTY;
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.INTERCEPTOR_RESOLUTION_WITH_NONBINDING_TYPE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.INVALID_QUALIFIER;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NON_NORMAL_SCOPE;
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.NOT_INTERCEPTOR_BINDING_TYPE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NOT_PROXYABLE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NOT_STEREOTYPE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.NO_DECORATOR_TYPES;
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.SPECIFIED_TYPE_NOT_BEAN_TYPE;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.TOO_MANY_ACTIVITIES;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.UNPROXYABLE_RESOLUTION;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.UNRESOLVABLE_ELEMENT;
+import static org.jboss.weld.logging.messages.BeanManagerMessage.UNRESOLVABLE_TYPE;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.el.ELResolver;
+import javax.el.ExpressionFactory;
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.AnnotatedType;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.Decorator;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.InjectionTarget;
+import javax.enterprise.inject.spi.InterceptionType;
+import javax.enterprise.inject.spi.Interceptor;
+import javax.enterprise.inject.spi.ObserverMethod;
+import javax.enterprise.inject.spi.PassivationCapable;
+import javax.inject.Qualifier;
+
+import org.jboss.interceptor.registry.InterceptorRegistry;
+import org.jboss.weld.Container;
+import org.jboss.weld.bean.NewBean;
+import org.jboss.weld.bean.RIBean;
+import org.jboss.weld.bean.SessionBean;
+import org.jboss.weld.bean.builtin.AbstractBuiltInBean;
+import org.jboss.weld.bean.builtin.ExtensionBean;
+import org.jboss.weld.bean.proxy.ClientProxyProvider;
+import org.jboss.weld.bootstrap.Validator;
+import org.jboss.weld.bootstrap.api.ServiceRegistry;
+import org.jboss.weld.bootstrap.events.AbstractProcessInjectionTarget;
+import org.jboss.weld.context.ContextNotActiveException;
+import org.jboss.weld.context.CreationalContextImpl;
+import org.jboss.weld.context.WeldCreationalContext;
+import org.jboss.weld.ejb.EjbDescriptors;
+import org.jboss.weld.ejb.spi.EjbDescriptor;
+import org.jboss.weld.el.Namespace;
+import org.jboss.weld.el.WeldELResolver;
+import org.jboss.weld.el.WeldExpressionFactory;
+import org.jboss.weld.exceptions.AmbiguousResolutionException;
+import org.jboss.weld.exceptions.DeploymentException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.exceptions.InjectionException;
+import org.jboss.weld.exceptions.UnproxyableResolutionException;
+import org.jboss.weld.exceptions.UnsatisfiedResolutionException;
+import org.jboss.weld.introspector.WeldAnnotated;
+import org.jboss.weld.literal.AnyLiteral;
+import org.jboss.weld.manager.api.WeldManager;
+import org.jboss.weld.metadata.cache.MetaAnnotationStore;
+import org.jboss.weld.metadata.cache.ScopeModel;
+import org.jboss.weld.resolution.NameBasedResolver;
+import org.jboss.weld.resolution.Resolvable;
+import org.jboss.weld.resolution.ResolvableFactory;
+import org.jboss.weld.resolution.ResolvableWeldClass;
+import org.jboss.weld.resolution.TypeSafeBeanResolver;
+import org.jboss.weld.resolution.TypeSafeDecoratorResolver;
+import org.jboss.weld.resolution.TypeSafeInterceptorResolver;
+import org.jboss.weld.resolution.TypeSafeObserverResolver;
+import org.jboss.weld.resolution.TypeSafeResolver;
+import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.serialization.spi.ContextualStore;
+import org.jboss.weld.serialization.spi.helpers.SerializableContextual;
+import org.jboss.weld.util.Beans;
+import org.jboss.weld.util.Observers;
+import org.jboss.weld.util.Proxies;
+import org.jboss.weld.util.reflection.HierarchyDiscovery;
+import org.jboss.weld.util.reflection.Reflections;
+
+import com.google.common.base.Function;
+import com.google.common.base.Supplier;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.ListMultimap;
+import com.google.common.collect.Multimaps;
+
+/**
+ * Implementation of the Bean Manager.
+ *
+ * Essentially a singleton for registering Beans, Contexts, Observers,
+ * Interceptors etc. as well as providing resolution
+ *
+ * @author Pete Muir
+ * @author Marius Bogoevici
+ */
+public class BeanManagerImpl implements WeldManager, Serializable
+{
+
+
+ private static class CurrentActivity
+ {
+
+ private final Context context;
+ private final BeanManagerImpl manager;
+
+ public CurrentActivity(Context context, BeanManagerImpl manager)
+ {
+ this.context = context;
+ this.manager = manager;
+ }
+
+ public Context getContext()
+ {
+ return context;
+ }
+
+ public BeanManagerImpl getManager()
+ {
+ return manager;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof CurrentActivity)
+ {
+ return this.getContext().equals(((CurrentActivity) obj).getContext());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getContext().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return getContext() + " -> " + getManager();
+ }
+ }
+
+ private static final long serialVersionUID = 3021562879133838561L;
+
+ public static final InjectionPoint DUMMY_INJECTION_POINT = new InjectionPoint()
+ {
+
+ public boolean isTransient()
+ {
+ return true;
+ }
+
+ public boolean isDelegate()
+ {
+ return false;
+ }
+
+ public Type getType()
+ {
+ return InjectionPoint.class;
+ }
+
+ public Set<Annotation> getQualifiers()
+ {
+ return Collections.emptySet();
+ }
+
+ public Member getMember()
+ {
+ return null;
+ }
+
+ public Bean<?> getBean()
+ {
+ return null;
+ }
+
+ public Annotated getAnnotated()
+ {
+ return null;
+ }
+ };
+
+ /*
+ * Application scoped services
+ * ***************************
+ */
+ private transient final ServiceRegistry services;
+
+ /*
+ * Application scoped data structures
+ * ***********************************
+ */
+
+ // Contexts are shared across the application
+ private transient final ListMultimap<Class<? extends Annotation>, Context>
contexts;
+
+ // Client proxies can be used application wide
+ private transient final ClientProxyProvider clientProxyProvider;
+
+ // TODO review this structure
+ private transient final Map<EjbDescriptor<?>, SessionBean<?>>
enterpriseBeans;
+
+ // TODO This isn't right, specialization should follow accessibility rules, but I
think we can enforce these in resolve()
+ private transient final Map<Contextual<?>, Contextual<?>>
specializedBeans;
+
+ /*
+ * Archive scoped data structures
+ * ******************************
+ */
+
+ /* These data structures are all non-transitive in terms of bean deployment
+ * archive accessibility, and the configuration for this bean deployment
+ * archive
+ */
+ private transient Collection<Class<?>> enabledAlternativeClasses;
+ private transient Collection<Class<? extends Annotation>>
enabledAlternativeStereotypes;
+ private transient List<Class<?>> enabledDecoratorClasses;
+ private transient List<Class<?>> enabledInterceptorClasses;
+ private transient final Set<CurrentActivity> currentActivities;
+
+ /*
+ * Activity scoped services
+ * *************************
+ */
+
+ /* These services are scoped to this activity only, but use data
+ * structures that are transitive accessible from other bean deployment
+ * archives
+ */
+ private transient final TypeSafeBeanResolver<Bean<?>> beanResolver;
+ private transient final TypeSafeResolver<? extends Resolvable,
Decorator<?>> decoratorResolver;
+ private transient final TypeSafeResolver<? extends Resolvable,
Interceptor<?>> interceptorResolver;
+ private transient final TypeSafeResolver<? extends Resolvable,
ObserverMethod<?>> observerResolver;
+ private transient final NameBasedResolver nameBasedResolver;
+ private transient final ELResolver weldELResolver;
+ private transient Namespace rootNamespace;
+
+ /*
+ * Activity scoped data structures
+ * ********************************
+ */
+
+ /* These data structures are scoped to this bean deployment archive activity
+ * only and represent the beans, decorators, interceptors, namespaces and
+ * observers deployed in this bean deployment archive activity
+ */
+ private transient final List<Bean<?>> beans;
+ private transient final List<Bean<?>> transitiveBeans;
+ private transient final List<Decorator<?>> decorators;
+ private transient final List<Interceptor<?>> interceptors;
+ private transient final List<String> namespaces;
+ private transient final List<ObserverMethod<?>> observers;
+
+ /*
+ * These data structures represent the managers *accessible* from this bean
+ * deployment archive activity
+ */
+ private transient final HashSet<BeanManagerImpl> accessibleManagers;
+
+ /*
+ * This data structures represents child activities for this activity, it is
+ * not transitively accessible
+ */
+ private transient final Set<BeanManagerImpl> childActivities;
+
+ private final AtomicInteger childIds;
+ private final String id;
+
+ /*
+ * Runtime data transfer
+ * *********************
+ */
+ private transient final ThreadLocal<Stack<InjectionPoint>>
currentInjectionPoint;
+
+ /**
+ * Interception model
+ */
+ private transient final InterceptorRegistry<Class<?>,
SerializableContextual<Interceptor<?>, ?>> boundInterceptorsRegistry = new
InterceptorRegistry<Class<?>,
SerializableContextual<Interceptor<?>,?>>();
+ private transient final InterceptorRegistry<Class<?>, Class<?>>
declaredInterceptorsRegistry = new InterceptorRegistry<Class<?>,
Class<?>>();
+
+ /**
+ * Create a new, root, manager
+ *
+ * @param serviceRegistry
+ * @return
+ */
+ public static BeanManagerImpl newRootManager(String id, ServiceRegistry
serviceRegistry)
+ {
+ ListMultimap<Class<? extends Annotation>, Context> contexts =
Multimaps.newListMultimap(new ConcurrentHashMap<Class<? extends Annotation>,
Collection<Context>>(), new Supplier<List<Context>>()
+ {
+
+ public List<Context> get()
+ {
+ return new CopyOnWriteArrayList<Context>();
+ }
+
+ });
+
+ return new BeanManagerImpl(
+ serviceRegistry,
+ new CopyOnWriteArrayList<Bean<?>>(),
+ new CopyOnWriteArrayList<Bean<?>>(),
+ new CopyOnWriteArrayList<Decorator<?>>(),
+ new CopyOnWriteArrayList<Interceptor<?>>(),
+ new CopyOnWriteArrayList<ObserverMethod<?>>(),
+ new CopyOnWriteArrayList<String>(),
+ new ConcurrentHashMap<EjbDescriptor<?>, SessionBean<?>>(),
+ new ClientProxyProvider(),
+ contexts,
+ new CopyOnWriteArraySet<CurrentActivity>(),
+ new HashMap<Contextual<?>, Contextual<?>>(),
+ new ArrayList<Class<?>>(),
+ new ArrayList<Class<? extends Annotation>>(),
+ new ArrayList<Class<?>>(),
+ new ArrayList<Class<?>>(),
+ id,
+ new AtomicInteger());
+ }
+
+ /**
+ * Create a new, root, manager
+ *
+ * @param serviceRegistry
+ * @return
+ */
+ public static BeanManagerImpl newManager(BeanManagerImpl rootManager, String id,
ServiceRegistry services)
+ {
+ return new BeanManagerImpl(
+ services,
+ new CopyOnWriteArrayList<Bean<?>>(),
+ new CopyOnWriteArrayList<Bean<?>>(),
+ new CopyOnWriteArrayList<Decorator<?>>(),
+ new CopyOnWriteArrayList<Interceptor<?>>(),
+ new CopyOnWriteArrayList<ObserverMethod<?>>(),
+ new CopyOnWriteArrayList<String>(),
+ rootManager.getEnterpriseBeans(),
+ rootManager.getClientProxyProvider(),
+ rootManager.getContexts(),
+ new CopyOnWriteArraySet<CurrentActivity>(),
+ new HashMap<Contextual<?>, Contextual<?>>(),
+ new ArrayList<Class<?>>(),
+ new ArrayList<Class<? extends Annotation>>(),
+ new ArrayList<Class<?>>(),
+ new ArrayList<Class<?>>(),
+ id,
+ new AtomicInteger());
+ }
+
+ /**
+ * Create a new child manager
+ *
+ * @param parentManager
+ * @return
+ */
+ public static BeanManagerImpl newChildActivityManager(BeanManagerImpl parentManager)
+ {
+ List<Bean<?>> beans = new CopyOnWriteArrayList<Bean<?>>();
+ beans.addAll(parentManager.getBeans());
+ List<Bean<?>> transitiveBeans = new
CopyOnWriteArrayList<Bean<?>>();
+ beans.addAll(parentManager.getTransitiveBeans());
+
+ List<ObserverMethod<?>> registeredObservers = new
CopyOnWriteArrayList<ObserverMethod<?>>();
+ registeredObservers.addAll(parentManager.getObservers());
+ List<String> namespaces = new CopyOnWriteArrayList<String>();
+ namespaces.addAll(parentManager.getNamespaces());
+
+ return new BeanManagerImpl(
+ parentManager.getServices(),
+ beans,
+ transitiveBeans,
+ parentManager.getDecorators(),
+ parentManager.getInterceptors(),
+ registeredObservers,
+ namespaces,
+ parentManager.getEnterpriseBeans(),
+ parentManager.getClientProxyProvider(),
+ parentManager.getContexts(),
+ parentManager.getCurrentActivities(),
+ parentManager.getSpecializedBeans(),
+ parentManager.getEnabledAlternativeClasses(),
+ parentManager.getEnabledAlternativeStereotypes(),
+ parentManager.getEnabledDecoratorClasses(),
+ parentManager.getEnabledInterceptorClasses(),
+ new
StringBuilder().append(parentManager.getChildIds().incrementAndGet()).toString(),
+ parentManager.getChildIds());
+ }
+
+ /**
+ * Create a new manager
+ * @param enabledDecoratorClasses
+ *
+ * @param ejbServices the ejbResolver to use
+ */
+ private BeanManagerImpl(
+ ServiceRegistry serviceRegistry,
+ List<Bean<?>> beans,
+ List<Bean<?>> transitiveBeans,
+ List<Decorator<?>> decorators,
+ List<Interceptor<?>> interceptors,
+ List<ObserverMethod<?>> observers,
+ List<String> namespaces,
+ Map<EjbDescriptor<?>, SessionBean<?>> enterpriseBeans,
+ ClientProxyProvider clientProxyProvider,
+ ListMultimap<Class<? extends Annotation>, Context> contexts,
+ Set<CurrentActivity> currentActivities,
+ Map<Contextual<?>, Contextual<?>> specializedBeans,
+ Collection<Class<?>> enabledAlternativeClasses,
+ Collection<Class<? extends Annotation>>
enabledAlternativeStereotypes,
+ List<Class<?>> enabledDecoratorClasses,
+ List<Class<?>> enabledInterceptorClasses,
+ String id,
+ AtomicInteger childIds)
+ {
+ this.services = serviceRegistry;
+ this.beans = beans;
+ this.transitiveBeans = transitiveBeans;
+ this.decorators = decorators;
+ this.interceptors = interceptors;
+ this.enterpriseBeans = enterpriseBeans;
+ this.clientProxyProvider = clientProxyProvider;
+ this.contexts = contexts;
+ this.currentActivities = currentActivities;
+ this.specializedBeans = specializedBeans;
+ this.observers = observers;
+ this.enabledAlternativeClasses = enabledAlternativeClasses;
+ this.enabledAlternativeStereotypes = enabledAlternativeStereotypes;
+ setEnabledDecoratorClasses(enabledDecoratorClasses);
+ setEnabledInterceptorClasses(enabledInterceptorClasses);
+ this.namespaces = namespaces;
+ this.id = id;
+ this.childIds = new AtomicInteger();
+
+ // Set up the structure to store accessible managers in
+ this.accessibleManagers = new HashSet<BeanManagerImpl>();
+
+
+
+ // TODO Currently we build the accessible bean list on the fly, we need to set it
in stone once bootstrap is finished...
+ Transform<Bean<?>> beanTransform = new Transform.BeanTransform(this);
+ this.beanResolver = new TypeSafeBeanResolver<Bean<?>>(this,
createDynamicAccessibleIterable(beanTransform));
+ this.decoratorResolver = new TypeSafeDecoratorResolver(this,
createDynamicAccessibleIterable(Transform.DECORATOR_BEAN));
+ this.interceptorResolver = new TypeSafeInterceptorResolver(this,
createDynamicAccessibleIterable(Transform.INTERCEPTOR_BEAN));
+ this.observerResolver = new TypeSafeObserverResolver(this,
createDynamicAccessibleIterable(Transform.EVENT_OBSERVER));
+ this.nameBasedResolver = new NameBasedResolver(this,
createDynamicAccessibleIterable(beanTransform));
+ this.weldELResolver = new WeldELResolver(this);
+ this.childActivities = new CopyOnWriteArraySet<BeanManagerImpl>();
+
+ this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
+ {
+ @Override
+ protected Stack<InjectionPoint> initialValue()
+ {
+ return new Stack<InjectionPoint>();
+ }
+ };
+ }
+
+ private <T> Set<Iterable<T>>
buildAccessibleClosure(Collection<BeanManagerImpl> hierarchy, Transform<T>
transform)
+ {
+ Set<Iterable<T>> result = new HashSet<Iterable<T>>();
+ hierarchy.add(this);
+ result.add(transform.transform(this));
+ for (BeanManagerImpl beanManager : accessibleManagers)
+ {
+ // Only add if we aren't already in the tree (remove cycles)
+ if (!hierarchy.contains(beanManager))
+ {
+ result.addAll(beanManager.buildAccessibleClosure(new
ArrayList<BeanManagerImpl>(hierarchy), transform));
+ }
+ }
+ return result;
+ }
+
+ private <T> Iterable<T> createDynamicAccessibleIterable(final
Transform<T> transform)
+ {
+ return new Iterable<T>()
+ {
+
+ private Function<Iterable<T>, Iterator<T>> function = new
Function<Iterable<T>, Iterator<T>>()
+ {
+
+ public Iterator<T> apply(Iterable<T> iterable)
+ {
+ return iterable.iterator();
+ }
+
+ };
+
+ public Iterator<T> iterator()
+ {
+ Set<Iterable<T>> iterable = buildAccessibleClosure(new
ArrayList<BeanManagerImpl>(), transform);
+ return Iterators.concat(Iterators.transform(iterable.iterator(), function));
+ }
+
+ };
+ }
+
+ private <T> Iterable<T> createStaticAccessibleIterable(final
Transform<T> transform)
+ {
+ Set<Iterable<T>> iterable = buildAccessibleClosure(new
ArrayList<BeanManagerImpl>(), transform);
+ return Iterables.concat(iterable);
+ }
+
+ private static interface Transform<T>
+ {
+
+ public static class BeanTransform implements Transform<Bean<?>>
+ {
+
+ private final BeanManagerImpl declaringBeanManager;
+
+ public BeanTransform(BeanManagerImpl declaringBeanManager)
+ {
+ this.declaringBeanManager = declaringBeanManager;
+ }
+
+ public Iterable<Bean<?>> transform(BeanManagerImpl beanManager)
+ {
+ // New beans and built in beans aren't resolvable transitively
+ if (beanManager.equals(declaringBeanManager))
+ {
+ return beanManager.getBeans();
+ }
+ else
+ {
+ return beanManager.getTransitiveBeans();
+ }
+ }
+
+ };
+
+ public static Transform<Decorator<?>> DECORATOR_BEAN = new
Transform<Decorator<?>>()
+ {
+
+ public Iterable<Decorator<?>> transform(BeanManagerImpl
beanManager)
+ {
+ return beanManager.getDecorators();
+ }
+
+ };
+
+ public static Transform<Interceptor<?>> INTERCEPTOR_BEAN = new
Transform<Interceptor<?>>()
+ {
+
+ public Iterable<Interceptor<?>> transform(BeanManagerImpl
beanManager)
+ {
+ return beanManager.getInterceptors();
+ }
+
+ };
+
+ public static Transform<ObserverMethod<?>> EVENT_OBSERVER = new
Transform<ObserverMethod<?>>()
+ {
+
+ public Iterable<ObserverMethod<?>> transform(BeanManagerImpl
beanManager)
+ {
+ return beanManager.getObservers();
+ }
+
+ };
+
+ public static Transform<String> NAMESPACE = new Transform<String>()
+ {
+
+ public Iterable<String> transform(BeanManagerImpl beanManager)
+ {
+ return beanManager.getNamespaces();
+ }
+
+ };
+
+ public Iterable<T> transform(BeanManagerImpl beanManager);
+
+ }
+
+ public void addAccessibleBeanManager(BeanManagerImpl accessibleBeanManager)
+ {
+ accessibleManagers.add(accessibleBeanManager);
+ beanResolver.clear();
+ }
+
+ public void addBean(Bean<?> bean)
+ {
+ if (beans.contains(bean))
+ {
+ return;
+ }
+ if (bean.getClass().equals(SessionBean.class))
+ {
+ SessionBean<?> enterpriseBean = (SessionBean<?>) bean;
+ enterpriseBeans.put(enterpriseBean.getEjbDescriptor(), enterpriseBean);
+ }
+ if (bean instanceof PassivationCapable)
+ {
+
Container.instance().deploymentServices().get(ContextualStore.class).putIfAbsent(bean);
+ }
+ registerBeanNamespace(bean);
+ for (BeanManagerImpl childActivity : childActivities)
+ {
+ childActivity.addBean(bean);
+ }
+ // New beans and most built in beans aren't resolvable transtively
+ if (bean instanceof ExtensionBean || (!(bean instanceof NewBean) && !(bean
instanceof AbstractBuiltInBean<?>)))
+ {
+ this.transitiveBeans.add(bean);
+ }
+ this.beans.add(bean);
+ beanResolver.clear();
+ }
+
+ public void addDecorator(Decorator<?> bean)
+ {
+ decorators.add(bean);
+ getServices().get(ContextualStore.class).putIfAbsent(bean);
+ decoratorResolver.clear();
+ }
+
+ public <T> Set<ObserverMethod<? super T>> resolveObserverMethods(T
event, Annotation... bindings)
+ {
+ Observers.checkEventObjectType(event);
+ return this.<T>resolveObserverMethods(event.getClass(), bindings);
+ }
+
+ public void addInterceptor(Interceptor<?> bean)
+ {
+ interceptors.add(bean);
+ getServices().get(ContextualStore.class).putIfAbsent(bean);
+ interceptorResolver.clear();
+ }
+
+
+ @SuppressWarnings("unchecked")
+ public <T> Set<ObserverMethod<? super T>>
resolveObserverMethods(Type eventType, Annotation... bindings)
+ {
+ checkBindingTypes(Arrays.asList(bindings));
+ HashSet<Annotation> bindingAnnotations = new
HashSet<Annotation>(Arrays.asList(bindings));
+ bindingAnnotations.add(new AnyLiteral());
+ Set<ObserverMethod<? super T>> observers = new
HashSet<ObserverMethod<? super T>>();
+ Set<ObserverMethod<?>> eventObservers =
observerResolver.resolve(ResolvableFactory.of(new
HierarchyDiscovery(eventType).getTypeClosure(), bindingAnnotations, null));
+ for (ObserverMethod<?> observer : eventObservers)
+ {
+ observers.add((ObserverMethod<T>) observer);
+ }
+ return observers;
+ }
+
+ private void checkBindingTypes(Collection<Annotation> bindings)
+ {
+ HashSet<Annotation> bindingAnnotations = new
HashSet<Annotation>(bindings);
+ for (Annotation annotation : bindings)
+ {
+ if
(!getServices().get(MetaAnnotationStore.class).getBindingTypeModel(annotation.annotationType()).isValid())
+ {
+ throw new ForbiddenArgumentException(INVALID_QUALIFIER, annotation);
+ }
+ }
+ if (bindingAnnotations.size() < bindings.size())
+ {
+ throw new ForbiddenArgumentException(DUPLICATE_QUALIFIERS, bindings);
+ }
+
+ }
+
+ /**
+ * A collection of enabled alternative classes
+ *
+ */
+ public Collection<Class<?>> getEnabledAlternativeClasses()
+ {
+ return Collections.unmodifiableCollection(enabledAlternativeClasses);
+ }
+
+ /**
+ * @return the enabled alternative stereotypes
+ */
+ public Collection<Class<? extends Annotation>>
getEnabledAlternativeStereotypes()
+ {
+ return Collections.unmodifiableCollection(enabledAlternativeStereotypes);
+ }
+
+ public boolean isBeanEnabled(Bean<?> bean)
+ {
+ return Beans.isBeanEnabled(bean, getEnabledAlternativeClasses(),
getEnabledAlternativeStereotypes());
+ }
+
+ /**
+ * @return the enabledDecoratorClasses
+ */
+ public List<Class<?>> getEnabledDecoratorClasses()
+ {
+ return Collections.unmodifiableList(enabledDecoratorClasses);
+ }
+
+ /**
+ * @return the enabledInterceptorClasses
+ */
+ public List<Class<?>> getEnabledInterceptorClasses()
+ {
+ return Collections.unmodifiableList(enabledInterceptorClasses);
+ }
+
+ public void setEnabledAlternativeClasses(Collection<Class<?>>
enabledAlternativeClasses)
+ {
+ this.enabledAlternativeClasses = enabledAlternativeClasses;
+ }
+
+ public void setEnabledAlternativeStereotypes(Collection<Class<? extends
Annotation>> enabledAlternativeSterotypes)
+ {
+ this.enabledAlternativeStereotypes = enabledAlternativeSterotypes;
+ }
+
+ public void setEnabledDecoratorClasses(List<Class<?>>
enabledDecoratorClasses)
+ {
+ this.enabledDecoratorClasses = enabledDecoratorClasses;
+ }
+
+ public void setEnabledInterceptorClasses(List<Class<?>>
enabledInterceptorClasses)
+ {
+ this.enabledInterceptorClasses = enabledInterceptorClasses;
+ }
+
+ public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
+ {
+ return getBeans(ResolvableWeldClass.of(beanType, bindings, this), bindings);
+ }
+
+ public Set<Bean<?>> getBeans(WeldAnnotated<?, ?> element,
Annotation... bindings)
+ {
+ for (Annotation annotation : element.getAnnotations())
+ {
+ if
(!getServices().get(MetaAnnotationStore.class).getBindingTypeModel(annotation.annotationType()).isValid())
+ {
+ throw new ForbiddenArgumentException(INVALID_QUALIFIER, annotation);
+ }
+ }
+// for (Type type : element.getActualTypeArguments())
+// {
+// if (type instanceof WildcardType)
+// {
+// throw new IllegalArgumentException("Cannot resolve a type
parameterized with a wildcard " + element);
+// }
+// if (type instanceof TypeVariable<?>)
+// {
+// throw new IllegalArgumentException("Cannot resolve a type
parameterized with a type parameter " + element);
+// }
+// }
+ if (bindings != null && bindings.length >
element.getMetaAnnotations(Qualifier.class).size())
+ {
+ throw new ForbiddenArgumentException(DUPLICATE_QUALIFIERS,
Arrays.asList(bindings));
+ }
+ return beanResolver.resolve(ResolvableFactory.of(element));
+ }
+
+ public Set<Bean<?>> getInjectableBeans(InjectionPoint injectionPoint)
+ {
+ boolean registerInjectionPoint =
!injectionPoint.getType().equals(InjectionPoint.class);
+ try
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().push(injectionPoint);
+ }
+ // TODO Do this properly
+ Set<Bean<?>> beans =
getBeans(ResolvableWeldClass.of(injectionPoint.getType(),
injectionPoint.getQualifiers().toArray(new Annotation[0]), this));
+ Set<Bean<?>> injectableBeans = new HashSet<Bean<?>>();
+ for (Bean<?> bean : beans)
+ {
+ if (!(bean instanceof Decorator || bean instanceof Interceptor))
+ {
+ injectableBeans.add(bean);
+ }
+ }
+ return injectableBeans;
+ }
+ finally
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+ }
+
+ protected void registerBeanNamespace(Bean<?> bean)
+ {
+ if (bean.getName() != null && bean.getName().indexOf('.') > 0)
+ {
+ namespaces.add(bean.getName().substring(0,
bean.getName().lastIndexOf('.')));
+ }
+ }
+
+ /**
+ * Gets the class-mapped beans. For internal use.
+ *
+ * @return The bean map
+ */
+ public Map<EjbDescriptor<?>, SessionBean<?>> getEnterpriseBeans()
+ {
+ return enterpriseBeans;
+ }
+
+ /**
+ * The beans registered with the Web Bean manager which are resolvable. Does
+ * not include interceptor and decorator beans
+ *
+ * @return The list of known beans
+ */
+ public List<Bean<?>> getBeans()
+ {
+ return Collections.unmodifiableList(beans);
+ }
+
+ private List<Bean<?>> getTransitiveBeans()
+ {
+ return Collections.unmodifiableList(transitiveBeans);
+ }
+
+ public List<Decorator<?>> getDecorators()
+ {
+ return Collections.unmodifiableList(decorators);
+ }
+
+ public List<Interceptor<?>> getInterceptors()
+ {
+ return Collections.unmodifiableList(interceptors);
+ }
+
+ public Iterable<Bean<?>> getAccessibleBeans()
+ {
+ return createDynamicAccessibleIterable(new Transform.BeanTransform(this));
+ }
+
+ public void addContext(Context context)
+ {
+ contexts.put(context.getScope(), context);
+ }
+
+ /**
+ * Does the actual observer registration
+ *
+ * @param observer
+= */
+ public void addObserver(ObserverMethod<?> observer)
+ {
+ //checkEventType(observer.getObservedType());
+ observers.add(observer);
+ for (BeanManagerImpl childActivity : childActivities)
+ {
+ childActivity.addObserver(observer);
+ }
+ }
+
+ /**
+ * Fires an event object with given event object for given bindings
+ *
+ * @param event The event object to pass along
+ * @param bindings The binding types to match
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#fireEvent(java.lang.Object,
+ * java.lang.annotation.Annotation[])
+ */
+ public void fireEvent(Object event, Annotation... qualifiers)
+ {
+ fireEvent(event.getClass(), event, qualifiers);
+ }
+
+ public void fireEvent(Type eventType, Object event, Annotation... qualifiers)
+ {
+ Observers.checkEventObjectType(event);
+ notifyObservers(event, resolveObserverMethods(eventType, qualifiers));
+ }
+
+ private <T> void notifyObservers(final T event, final Set<ObserverMethod<?
super T>> observers)
+ {
+ for (ObserverMethod<? super T> observer : observers)
+ {
+ observer.notify(event);
+ }
+ }
+
+ /**
+ * Gets an active context of the given scope. Throws an exception if there
+ * are no active contexts found or if there are too many matches
+ *
+ * @param scopeType The scope to match
+ * @return A single active context of the given scope
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#getContext(java.lang.Class)
+ */
+ public Context getContext(Class<? extends Annotation> scopeType)
+ {
+ List<Context> activeContexts = new ArrayList<Context>();
+ for (Context context : contexts.get(scopeType))
+ {
+ if (context.isActive())
+ {
+ activeContexts.add(context);
+ }
+ }
+ if (activeContexts.isEmpty())
+ {
+ throw new ContextNotActiveException(CONTEXT_NOT_ACTIVE, scopeType.getName());
+ }
+ if (activeContexts.size() > 1)
+ {
+ throw new ForbiddenStateException(DUPLICATE_ACTIVE_CONTEXTS,
scopeType.getName());
+ }
+ return activeContexts.iterator().next();
+
+ }
+
+ public Object getReference(Bean<?> bean, CreationalContext<?>
creationalContext, boolean delegate)
+ {
+ bean = getMostSpecializedBean(bean);
+ if (creationalContext instanceof WeldCreationalContext<?>)
+ {
+ creationalContext = ((WeldCreationalContext<?>)
creationalContext).getCreationalContext(bean);
+ }
+ if (!delegate && isProxyRequired(bean))
+ {
+ if (creationalContext != null || getContext(bean.getScope()).get(bean) != null)
+ {
+ return clientProxyProvider.getClientProxy(this, bean);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ return getContext(bean.getScope()).get((Contextual) bean, creationalContext);
+ }
+ }
+
+ private boolean isProxyRequired(Bean<?> bean)
+ {
+ if
(getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal())
+ {
+ return true;
+ }
+ else if (bean instanceof RIBean<?>)
+ {
+ return ((RIBean<?>) bean).isProxyRequired();
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public Object getReference(Bean<?> bean, Type beanType,
CreationalContext<?> creationalContext)
+ {
+ if (!Reflections.isAssignableFrom(bean.getTypes(), beanType))
+ {
+ throw new ForbiddenArgumentException(SPECIFIED_TYPE_NOT_BEAN_TYPE, beanType,
bean );
+ }
+ return getReference(bean, creationalContext, false);
+ }
+
+
+ /**
+ * Get a reference, registering the injection point used.
+ *
+ * @param injectionPoint the injection point to register
+ * @param resolvedBean the bean to get a reference to
+ * @param creationalContext the creationalContext
+ * @return
+ */
+ public Object getReference(InjectionPoint injectionPoint, Bean<?> resolvedBean,
CreationalContext<?> creationalContext)
+ {
+ boolean registerInjectionPoint = (injectionPoint != null &&
!injectionPoint.getType().equals(InjectionPoint.class));
+ boolean delegateInjectionPoint = injectionPoint != null &&
injectionPoint.isDelegate();
+ try
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().push(injectionPoint);
+ }
+ if
(getServices().get(MetaAnnotationStore.class).getScopeModel(resolvedBean.getScope()).isNormal()
&& !Proxies.isTypeProxyable(injectionPoint.getType()))
+ {
+ throw new UnproxyableResolutionException(UNPROXYABLE_RESOLUTION,
resolvedBean, injectionPoint);
+ }
+ // TODO Can we move this logic to getReference?
+ if (creationalContext instanceof WeldCreationalContext<?>)
+ {
+ WeldCreationalContext<?> wbCreationalContext =
(WeldCreationalContext<?>) creationalContext;
+ if (wbCreationalContext.containsIncompleteInstance(resolvedBean))
+ {
+ return wbCreationalContext.getIncompleteInstance(resolvedBean);
+ }
+ else
+ {
+ return getReference(resolvedBean, wbCreationalContext,
delegateInjectionPoint);
+ }
+ }
+ else
+ {
+ return getReference(resolvedBean, creationalContext,
delegateInjectionPoint);
+ }
+ }
+ finally
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+ }
+
+
+ public Object getInjectableReference(InjectionPoint injectionPoint,
CreationalContext<?> creationalContext)
+ {
+ WeldAnnotated<?, ?> element =
ResolvableWeldClass.of(injectionPoint.getType(),
injectionPoint.getQualifiers().toArray(new Annotation[0]), this);
+ Bean<?> resolvedBean = getBean(element, element.getBindingsAsArray());
+ return getReference(injectionPoint, resolvedBean, creationalContext);
+ }
+
+ /**
+ * Returns an instance by API type and binding types
+ *
+ * @param beanType The API type to match
+ * @param bindings The binding types to match
+ * @return An instance of the bean
+ *
+ */
+ @Deprecated
+ public <T> T getInstanceByType(Class<T> beanType, Annotation... bindings)
+ {
+ Set<Bean<?>> beans = getBeans(beanType, bindings);
+ Bean<?> bean = resolve(beans);
+ if (bean == null)
+ {
+ throw new UnsatisfiedResolutionException(UNRESOLVABLE_TYPE, beanType,
Arrays.toString(bindings));
+ }
+ Object reference = getReference(bean, beanType, createCreationalContext(bean));
+
+ @SuppressWarnings("unchecked")
+ T instance = (T) reference;
+
+ return instance;
+ }
+
+ public <T> Bean<T> getBean(WeldAnnotated<T, ?> element,
Annotation... bindings)
+ {
+ Bean<T> bean = (Bean<T>) resolve(getBeans(element, bindings));
+ if (bean == null)
+ {
+ throw new UnsatisfiedResolutionException(UNRESOLVABLE_ELEMENT, element);
+ }
+
+ boolean normalScoped =
getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal();
+ if (normalScoped && !Beans.isBeanProxyable(bean))
+ {
+ throw new UnproxyableResolutionException(NOT_PROXYABLE, bean);
+ }
+ return bean;
+ }
+
+ public Set<Bean<?>> getBeans(String name)
+ {
+ return nameBasedResolver.resolve(name);
+ }
+
+ /**
+ * Resolves a list of decorators based on API types and binding types
+ *
+ * @param types The set of API types to match
+ * @param bindings The binding types to match
+ * @return A list of matching decorators
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#resolveDecorators(java.util.Set,
+ * java.lang.annotation.Annotation[])
+ */
+ public List<Decorator<?>> resolveDecorators(Set<Type> types,
Annotation... bindings)
+ {
+ checkResolveDecoratorsArguments(types, Arrays.asList(bindings));
+ // TODO Fix this cast and make the resolver return a list
+ return new
ArrayList<Decorator<?>>(decoratorResolver.resolve(ResolvableFactory.of(types,
null, bindings)));
+ }
+
+ public List<Decorator<?>> resolveDecorators(Set<Type> types,
Set<Annotation> bindings)
+ {
+ checkResolveDecoratorsArguments(types, bindings);
+ // TODO Fix this cast and make the resolver return a list
+ return new
ArrayList<Decorator<?>>(decoratorResolver.resolve(ResolvableFactory.of(types,
bindings, null)));
+ }
+
+ private void checkResolveDecoratorsArguments(Set<Type> types,
Collection<Annotation> bindings)
+ {
+ if (types.isEmpty())
+ {
+ throw new ForbiddenArgumentException(NO_DECORATOR_TYPES);
+ }
+ checkBindingTypes(bindings);
+ }
+
+ /**
+ * Resolves a list of interceptors based on interception type and interceptor
+ * bindings
+ *
+ * @param type The interception type to resolve
+ * @param interceptorBindings The binding types to match
+ * @return A list of matching interceptors
+ *
+ * @see
javax.enterprise.inject.spi.BeanManager#resolveInterceptors(javax.enterprise.inject.spi.InterceptionType,
+ * java.lang.annotation.Annotation[])
+ */
+ public List<Interceptor<?>> resolveInterceptors(InterceptionType type,
Annotation... interceptorBindings)
+ {
+ if (interceptorBindings.length == 0)
+ throw new ForbiddenArgumentException(INTERCEPTOR_BINDINGS_EMPTY);
+ Set<Class<?>> uniqueInterceptorBindings = new
HashSet<Class<?>>();
+ for (Annotation interceptorBinding: interceptorBindings)
+ {
+ if (uniqueInterceptorBindings.contains(interceptorBinding.annotationType()))
+ throw new ForbiddenArgumentException(DUPLICATE_INTERCEPTOR_BINDING,
interceptorBinding.annotationType());
+ if (!isInterceptorBinding(interceptorBinding.annotationType()))
+ throw new
ForbiddenArgumentException(INTERCEPTOR_RESOLUTION_WITH_NONBINDING_TYPE,
interceptorBinding.annotationType());
+ uniqueInterceptorBindings.add(interceptorBinding.annotationType());
+ }
+ return new
ArrayList<Interceptor<?>>(interceptorResolver.resolve(ResolvableFactory.of(type,interceptorBindings)));
+ }
+
+ /**
+ * Get the web bean resolver. For internal use
+ *
+ * @return The resolver
+ */
+ public TypeSafeBeanResolver<Bean<?>> getBeanResolver()
+ {
+ return beanResolver;
+ }
+
+ /**
+ * Gets a string representation
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("Manager\n");
+ buffer.append("Enabled alternatives: " + getEnabledAlternativeClasses() +
" " + getEnabledAlternativeStereotypes() + "\n");
+ buffer.append("Registered contexts: " + contexts.keySet() +
"\n");
+ buffer.append("Registered beans: " + getBeans().size() +
"\n");
+ buffer.append("Specialized beans: " + specializedBeans.size() +
"\n");
+ return buffer.toString();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof BeanManagerImpl)
+ {
+ BeanManagerImpl that = (BeanManagerImpl) obj;
+ return this.getId().equals(that.getId());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getId().hashCode();
+ }
+
+ public BeanManagerImpl createActivity()
+ {
+ BeanManagerImpl childActivity = newChildActivityManager(this);
+ childActivities.add(childActivity);
+ Container.instance().addActivity(childActivity);
+ return childActivity;
+ }
+
+ public BeanManagerImpl setCurrent(Class<? extends Annotation> scopeType)
+ {
+ if
(!getServices().get(MetaAnnotationStore.class).getScopeModel(scopeType).isNormal())
+ {
+ throw new ForbiddenArgumentException(NON_NORMAL_SCOPE, scopeType);
+ }
+ currentActivities.add(new CurrentActivity(getContext(scopeType), this));
+ return this;
+ }
+
+ public BeanManagerImpl getCurrent()
+ {
+ List<CurrentActivity> activeCurrentActivities = new
ArrayList<CurrentActivity>();
+ for (CurrentActivity currentActivity : currentActivities)
+ {
+ if (currentActivity.getContext().isActive())
+ {
+ activeCurrentActivities.add(currentActivity);
+ }
+ }
+ if (activeCurrentActivities.size() == 0)
+ {
+ return this;
+ }
+ else if (activeCurrentActivities.size() == 1)
+ {
+ return activeCurrentActivities.get(0).getManager();
+ }
+ throw new ForbiddenStateException(TOO_MANY_ACTIVITIES, currentActivities);
+ }
+
+ public ServiceRegistry getServices()
+ {
+ return services;
+ }
+
+ /**
+ * The injection point being operated on for this thread
+ *
+ * @return the current injection point
+ */
+ public InjectionPoint getCurrentInjectionPoint()
+ {
+ if (!currentInjectionPoint.get().empty())
+ {
+ return currentInjectionPoint.get().peek();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ * Replaces (or adds) the current injection point. If a current injection
+ * point exists, it will be replaced. If no current injection point exists,
+ * one will be added.
+ *
+ * @param injectionPoint the injection point to use
+ * @return the injection point added, or null if non previous existed
+ */
+ public InjectionPoint replaceOrPushCurrentInjectionPoint(InjectionPoint
injectionPoint)
+ {
+ InjectionPoint originalInjectionPoint = null;
+ if (!currentInjectionPoint.get().empty())
+ {
+ originalInjectionPoint = currentInjectionPoint.get().pop();
+ }
+ currentInjectionPoint.get().push(injectionPoint);
+ return originalInjectionPoint;
+ }
+
+ public void pushDummyInjectionPoint()
+ {
+ currentInjectionPoint.get().push(DUMMY_INJECTION_POINT);
+ }
+
+ public void popDummyInjectionPoint()
+ {
+ if (!currentInjectionPoint.get().isEmpty() &&
DUMMY_INJECTION_POINT.equals(currentInjectionPoint.get().peek()))
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Map<Contextual<?>, Contextual<?>> getSpecializedBeans()
+ {
+ // TODO make this unmodifiable after deploy!
+ return specializedBeans;
+ }
+
+ // Serialization
+
+ protected Object readResolve()
+ {
+ return Container.instance().activityManager(id);
+ }
+
+ protected ClientProxyProvider getClientProxyProvider()
+ {
+ return clientProxyProvider;
+ }
+
+ protected ListMultimap<Class<? extends Annotation>, Context>
getContexts()
+ {
+ return contexts;
+ }
+
+ /**
+ * @return the namespaces
+ */
+ protected List<String> getNamespaces()
+ {
+ return namespaces;
+ }
+
+ public Iterable<String> getAccessibleNamespaces()
+ {
+ // TODO Cache this
+ return createDynamicAccessibleIterable(Transform.NAMESPACE);
+ }
+
+ private Set<CurrentActivity> getCurrentActivities()
+ {
+ return currentActivities;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public AtomicInteger getChildIds()
+ {
+ return childIds;
+ }
+
+ public List<ObserverMethod<?>> getObservers()
+ {
+ return observers;
+ }
+
+ public Namespace getRootNamespace()
+ {
+ // TODO I don't like this lazy init
+ if (rootNamespace == null)
+ {
+ rootNamespace = new
Namespace(createDynamicAccessibleIterable(Transform.NAMESPACE));
+ }
+ return rootNamespace;
+ }
+
+ public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T>
type)
+ {
+ return new
SimpleInjectionTarget<T>(getServices().get(ClassTransformer.class).loadClass(type),
this);
+ }
+
+ public <T> InjectionTarget<T> createInjectionTarget(EjbDescriptor<T>
descriptor)
+ {
+ return getBean(descriptor).getInjectionTarget();
+ }
+
+ public <X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean)
+ {
+ Contextual<?> key = bean;
+ while (specializedBeans.containsKey(key))
+ {
+ if (key == null)
+ {
+ System.out.println("null key " + bean);
+ }
+ key = specializedBeans.get(key);
+ }
+ return (Bean<X>) key;
+ }
+
+ public void validate(InjectionPoint ij)
+ {
+ try
+ {
+ getServices().get(Validator.class).validateInjectionPoint(ij, this);
+ }
+ catch (DeploymentException e)
+ {
+ throw new InjectionException(e.getLocalizedMessage(), e.getCause());
+ }
+ }
+
+ public Set<Annotation> getInterceptorBindingDefinition(Class<? extends
Annotation> bindingType)
+ {
+ if
(getServices().get(MetaAnnotationStore.class).getInterceptorBindingModel(bindingType).isValid())
+ {
+ return
getServices().get(MetaAnnotationStore.class).getInterceptorBindingModel(bindingType).getMetaAnnotations();
+ }
+ else
+ {
+ throw new ForbiddenArgumentException(NOT_INTERCEPTOR_BINDING_TYPE,
bindingType);
+ }
+ }
+
+ public Bean<?> getPassivationCapableBean(String id)
+ {
+ return getServices().get(ContextualStore.class).<Bean<Object>,
Object>getContextual(id);
+ }
+
+ public Set<Annotation> getStereotypeDefinition(Class<? extends Annotation>
stereotype)
+ {
+ if
(getServices().get(MetaAnnotationStore.class).getStereotype(stereotype).isValid())
+ {
+ return
getServices().get(MetaAnnotationStore.class).getStereotype(stereotype).getMetaAnnotations();
+ }
+ else
+ {
+ throw new ForbiddenArgumentException(NOT_STEREOTYPE, stereotype);
+ }
+ }
+
+ public boolean isQualifier(Class<? extends Annotation> annotationType)
+ {
+ return
getServices().get(MetaAnnotationStore.class).getBindingTypeModel(annotationType).isValid();
+ }
+
+ public boolean isInterceptorBinding(Class<? extends Annotation> annotationType)
+ {
+ return
getServices().get(MetaAnnotationStore.class).getInterceptorBindingModel(annotationType).isValid();
+ }
+
+ public boolean isNormalScope(Class<? extends Annotation> annotationType)
+ {
+ ScopeModel<?> scope =
getServices().get(MetaAnnotationStore.class).getScopeModel(annotationType);
+ return scope.isValid() && scope.isNormal();
+ }
+
+ public boolean isPassivatingScope(Class<? extends Annotation> annotationType)
+ {
+ ScopeModel<?> scope =
getServices().get(MetaAnnotationStore.class).getScopeModel(annotationType);
+ return scope.isValid() && scope.isPassivating();
+ }
+
+ public boolean isScope(Class<? extends Annotation> annotationType)
+ {
+ return
getServices().get(MetaAnnotationStore.class).getScopeModel(annotationType).isValid();
+ }
+
+ public boolean isStereotype(Class<? extends Annotation> annotationType)
+ {
+ return
getServices().get(MetaAnnotationStore.class).getStereotype(annotationType).isValid();
+ }
+
+ public ELResolver getELResolver()
+ {
+ return weldELResolver;
+ }
+
+ public ExpressionFactory wrapExpressionFactory(ExpressionFactory expressionFactory)
+ {
+ return new WeldExpressionFactory(expressionFactory);
+ }
+
+ public <T> WeldCreationalContext<T>
createCreationalContext(Contextual<T> contextual)
+ {
+ return new CreationalContextImpl<T>(contextual);
+ }
+
+ public <T> AnnotatedType<T> createAnnotatedType(Class<T> type)
+ {
+ return getServices().get(ClassTransformer.class).loadClass(type);
+ }
+
+ public <X> Bean<? extends X> resolve(Set<Bean<? extends X>>
beans)
+ {
+ Set<Bean<? extends X>> resolvedBeans = beanResolver.resolve(beans);
+ if (resolvedBeans.size() == 0)
+ {
+ return null;
+ }
+ if (resolvedBeans.size() == 1)
+ {
+ return resolvedBeans.iterator().next();
+ }
+ else
+ {
+ throw new AmbiguousResolutionException(AMBIGUOUS_BEANS_FOR_DEPENDENCY, beans);
+ }
+ }
+
+ public <T> EjbDescriptor<T> getEjbDescriptor(String beanName)
+ {
+ return getServices().get(EjbDescriptors.class).get(beanName);
+ }
+
+ public <T> SessionBean<T> getBean(EjbDescriptor<T> descriptor)
+ {
+ return (SessionBean<T>) getEnterpriseBeans().get(descriptor);
+ }
+
+ public void cleanup()
+ {
+ services.cleanup();
+ this.currentInjectionPoint.remove();
+ this.accessibleManagers.clear();
+ this.beanResolver.clear();
+ this.beans.clear();
+ this.childActivities.clear();
+ this.clientProxyProvider.clear();
+ this.contexts.clear();
+ this.currentActivities.clear();
+ this.decoratorResolver.clear();
+ this.decorators.clear();
+ this.enabledDecoratorClasses.clear();
+ this.enabledInterceptorClasses.clear();
+ this.enabledAlternativeClasses.clear();
+ this.enabledAlternativeStereotypes.clear();
+ this.enterpriseBeans.clear();
+ this.interceptorResolver.clear();
+ this.interceptors.clear();
+ this.nameBasedResolver.clear();
+ this.namespaces.clear();
+ this.observerResolver.clear();
+ this.observers.clear();
+ this.specializedBeans.clear();
+ }
+
+ public InterceptorRegistry<Class<?>,
SerializableContextual<Interceptor<?>, ?>> getCdiInterceptorsRegistry()
+ {
+ return boundInterceptorsRegistry;
+ }
+
+ public InterceptorRegistry<Class<?>, Class<?>>
getClassDeclaredInterceptorsRegistry()
+ {
+ return declaredInterceptorsRegistry;
+ }
+
+ public <X> InjectionTarget<X>
fireProcessInjectionTarget(AnnotatedType<X> annotatedType)
+ {
+ return AbstractProcessInjectionTarget.fire(this, annotatedType,
createInjectionTarget(annotatedType));
+ }
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/manager/BeanManagerImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied: core/trunk/impl/src/main/java/org/jboss/weld/manager/SimpleInjectionTarget.java
(from rev 5388, core/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java)
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/manager/SimpleInjectionTarget.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/manager/SimpleInjectionTarget.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,169 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.manager;
+
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.ERROR_INVOKING_POST_CONSTRUCT;
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.ERROR_INVOKING_PRE_DESTROY;
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.INJECTION_ON_NON_CONTEXTUAL;
+import static
org.jboss.weld.logging.messages.BeanManagerMessage.MISSING_BEAN_CONSTRUCTOR_FOUND;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.InjectionTarget;
+
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.exceptions.WeldException;
+import org.jboss.weld.injection.ConstructorInjectionPoint;
+import org.jboss.weld.injection.FieldInjectionPoint;
+import org.jboss.weld.injection.InjectionContextImpl;
+import org.jboss.weld.injection.MethodInjectionPoint;
+import org.jboss.weld.injection.WeldInjectionPoint;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.util.Beans;
+
+/**
+ * @author pmuir
+ *
+ */
+public class SimpleInjectionTarget<T> implements InjectionTarget<T>
+{
+
+ private final BeanManagerImpl beanManager;
+ private final WeldClass<T> type;
+ private final ConstructorInjectionPoint<T> constructor;
+ private final List<Set<FieldInjectionPoint<?, ?>>>
injectableFields;
+ private final List<Set<MethodInjectionPoint<?, ?>>>
initializerMethods;
+ private final WeldMethod<?, ?> postConstruct;
+ private final WeldMethod<?, ?> preDestroy;
+ private final Set<InjectionPoint> injectionPoints;
+ private final Set<WeldInjectionPoint<?, ?>> ejbInjectionPoints;
+ private final Set<WeldInjectionPoint<?, ?>>
persistenceContextInjectionPoints;
+ private final Set<WeldInjectionPoint<?, ?>>
persistenceUnitInjectionPoints;
+ private final Set<WeldInjectionPoint<?, ?>> resourceInjectionPoints;
+
+ public SimpleInjectionTarget(WeldClass<T> type, BeanManagerImpl beanManager)
+ {
+ this.beanManager = beanManager;
+ this.type = type;
+ this.injectionPoints = new HashSet<InjectionPoint>();
+ ConstructorInjectionPoint<T> constructor = null;
+ try
+ {
+ constructor = Beans.getBeanConstructor(null, type);
+ this.injectionPoints.addAll(Beans.getParameterInjectionPoints(null,
constructor));
+ }
+ catch (Exception e)
+ {
+ // this means the bean of a type that cannot be produce()d, but that is
non-fatal
+ // unless someone calls produce()
+ }
+ this.constructor = constructor;
+ this.injectableFields = Beans.getFieldInjectionPoints(null, type);
+ this.injectionPoints.addAll(Beans.getFieldInjectionPoints(null,
this.injectableFields));
+ this.initializerMethods = Beans.getInitializerMethods(null, type);
+ this.injectionPoints.addAll(Beans.getParameterInjectionPoints(null,
initializerMethods));
+ this.postConstruct = Beans.getPostConstruct(type);
+ this.preDestroy = Beans.getPreDestroy(type);
+ this.ejbInjectionPoints = Beans.getEjbInjectionPoints(null, type, beanManager);
+ this.persistenceContextInjectionPoints =
Beans.getPersistenceContextInjectionPoints(null, type, beanManager);
+ this.persistenceUnitInjectionPoints = Beans.getPersistenceUnitInjectionPoints(null,
type, beanManager);
+ this.resourceInjectionPoints = Beans.getResourceInjectionPoints(null, type,
beanManager);
+ for (InjectionPoint ip : this.injectionPoints)
+ {
+ if (ip.getType().equals(InjectionPoint.class))
+ {
+ throw new DefinitionException(INJECTION_ON_NON_CONTEXTUAL, type, ip);
+ }
+ }
+ }
+
+ public T produce(CreationalContext<T> ctx)
+ {
+ if (constructor == null)
+ {
+ // this means we couldn't find a constructor on instantiation, which
+ // means there isn't one that's spec-compliant
+ // try again so the correct DefinitionException is thrown
+ Beans.getBeanConstructor(null, type);
+ // should not be reached
+ throw new ForbiddenStateException(MISSING_BEAN_CONSTRUCTOR_FOUND);
+ }
+ return constructor.newInstance(beanManager, ctx);
+ }
+
+ public void inject(final T instance, final CreationalContext<T> ctx)
+ {
+ new InjectionContextImpl<T>(beanManager, this, instance)
+ {
+
+ public void proceed()
+ {
+ Beans.injectEEFields(instance, beanManager, ejbInjectionPoints,
persistenceContextInjectionPoints, persistenceUnitInjectionPoints,
resourceInjectionPoints);
+ Beans.injectFieldsAndInitializers(instance, ctx, beanManager,
injectableFields, initializerMethods);
+ }
+
+ }.run();
+
+ }
+
+ public void postConstruct(T instance)
+ {
+ if (postConstruct == null)
+ return;
+
+ try
+ {
+ postConstruct.invoke(instance);
+ }
+ catch (Exception e)
+ {
+ throw new WeldException(ERROR_INVOKING_POST_CONSTRUCT, e, postConstruct);
+ }
+ }
+
+ public void preDestroy(T instance)
+ {
+ if (preDestroy == null)
+ return;
+
+ try
+ {
+ preDestroy.invoke(instance);
+ }
+ catch (Exception e)
+ {
+ throw new WeldException(ERROR_INVOKING_PRE_DESTROY, e, preDestroy);
+ }
+ }
+
+ public void dispose(T instance)
+ {
+ // No-op
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return injectionPoints;
+ }
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/manager/SimpleInjectionTarget.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Copied:
core/trunk/impl/src/main/java/org/jboss/weld/manager/SingleThreadExecutorServices.java
(from rev 5388,
core/trunk/impl/src/main/java/org/jboss/weld/SingleThreadExecutorServices.java)
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/manager/SingleThreadExecutorServices.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/manager/SingleThreadExecutorServices.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.weld.manager;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.jboss.weld.manager.api.ExecutorServices;
+
+/**
+ * @author pmuir
+ *
+ */
+public class SingleThreadExecutorServices implements ExecutorServices
+{
+
+ private transient final ExecutorService taskExecutor =
Executors.newSingleThreadExecutor();
+
+
+ /**
+ * Provides access to the executor service used for asynchronous tasks.
+ *
+ * @return the ExecutorService for this manager
+ */
+ public ExecutorService getTaskExecutor()
+ {
+ return taskExecutor;
+ }
+
+ public void cleanup()
+ {
+ taskExecutor.shutdown();
+ try
+ {
+ // Wait a while for existing tasks to terminate
+ if (!taskExecutor.awaitTermination(60, TimeUnit.SECONDS))
+ {
+ taskExecutor.shutdownNow(); // Cancel currently executing tasks
+ // Wait a while for tasks to respond to being cancelled
+ if (!taskExecutor.awaitTermination(60, TimeUnit.SECONDS))
+ {
+ // Log the error here
+ }
+ }
+ }
+ catch (InterruptedException ie)
+ {
+ // (Re-)Cancel if current thread also interrupted
+ taskExecutor.shutdownNow();
+ // Preserve interrupt status
+ Thread.currentThread().interrupt();
+ }
+ }
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/manager/SingleThreadExecutorServices.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -25,7 +25,7 @@
import java.lang.annotation.RetentionPolicy;
import java.util.Set;
-import org.jboss.weld.DefinitionException;
+import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.introspector.WeldAnnotation;
import org.jboss.weld.logging.messages.MetadataMessage;
import org.jboss.weld.resources.ClassTransformer;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/BindingTypeModel.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/BindingTypeModel.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/BindingTypeModel.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -27,7 +27,7 @@
import javax.enterprise.util.Nonbinding;
import javax.inject.Qualifier;
-import org.jboss.weld.WeldException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.collections.Arrays2;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -33,8 +33,8 @@
import javax.enterprise.util.Nonbinding;
import javax.interceptor.InterceptorBinding;
-import org.jboss.weld.DefinitionException;
-import org.jboss.weld.WeldException;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.collections.Arrays2;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/MergedStereotypes.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/MergedStereotypes.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/MergedStereotypes.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -22,8 +22,8 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenStateException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* Meta model for the merged stereotype for a bean
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/StereotypeModel.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/StereotypeModel.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/StereotypeModel.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -40,7 +40,7 @@
import javax.inject.Scope;
import javax.interceptor.InterceptorBinding;
-import org.jboss.weld.DefinitionException;
+import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.util.collections.Arrays2;
import org.slf4j.cal10n.LocLogger;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/resolution/NameBasedResolver.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/resolution/NameBasedResolver.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/resolution/NameBasedResolver.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -22,7 +22,7 @@
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.collections.ConcurrentCache;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWeldClass.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWeldClass.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWeldClass.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -34,14 +34,14 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.util.TypeLiteral;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenArgumentException;
-import org.jboss.weld.InvalidOperationException;
import org.jboss.weld.bean.AbstractClassBean;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.InvalidOperationException;
import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.introspector.AnnotationStore;
import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.introspector.jlr.AbstractWeldAnnotated;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.util.Names;
import org.jboss.weld.util.reflection.Reflections;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeBeanResolver.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -23,9 +23,9 @@
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.builtin.EventBean;
import org.jboss.weld.bean.builtin.InstanceBean;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.collections.ConcurrentCache;
import org.jboss.weld.util.reflection.Reflections;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDecoratorResolver.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDecoratorResolver.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDecoratorResolver.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -24,8 +24,8 @@
import javax.enterprise.inject.spi.Decorator;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.DecoratorImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.reflection.Reflections;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDisposerResolver.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDisposerResolver.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeDisposerResolver.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -19,8 +19,8 @@
import java.util.Collections;
import java.util.Set;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.DisposalMethod;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.reflection.Reflections;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeInterceptorResolver.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeInterceptorResolver.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeInterceptorResolver.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -25,8 +25,8 @@
import javax.enterprise.inject.spi.Interceptor;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.InterceptorImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
/**
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeObserverResolver.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeObserverResolver.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/resolution/TypeSafeObserverResolver.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -21,7 +21,7 @@
import javax.enterprise.inject.spi.ObserverMethod;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.reflection.Reflections;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/resources/ManagerObjectFactory.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/resources/ManagerObjectFactory.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/resources/ManagerObjectFactory.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -27,9 +27,9 @@
import javax.naming.NamingException;
import javax.naming.spi.ObjectFactory;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.manager.BeanManagerImpl;
import ch.qos.cal10n.IMessageConveyor;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletHelper.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletHelper.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletHelper.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -22,8 +22,8 @@
import javax.enterprise.inject.spi.BeanManager;
import javax.servlet.ServletContext;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* @author pmuir
Modified: core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/servlet/ServletLifecycle.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -28,11 +28,11 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
-import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.context.ContextLifecycle;
import org.jboss.weld.context.api.BeanStore;
import org.jboss.weld.context.api.helpers.ConcurrentHashMapBeanStore;
import org.jboss.weld.conversation.ConversationManager;
+import org.jboss.weld.exceptions.ForbiddenStateException;
/**
* Implementation of the Weld lifecycle that can react to servlet events
Modified: core/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/servlet/WeldListener.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -37,11 +37,11 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSessionEvent;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
-import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.context.ContextLifecycle;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.servlet.api.ServletServices;
import org.jboss.weld.servlet.api.helpers.AbstractServletListener;
import org.slf4j.cal10n.LocLogger;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/ApiAbstraction.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -20,7 +20,7 @@
import java.lang.annotation.Annotation;
-import org.jboss.weld.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.resources.spi.ResourceLoader;
import org.jboss.weld.resources.spi.ResourceLoadingException;
import org.jboss.weld.util.reflection.SecureReflections;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java 2010-01-08 12:25:43 UTC
(rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java 2010-01-08 13:59:36 UTC
(rev 5398)
@@ -66,14 +66,13 @@
import org.jboss.interceptor.model.InterceptionType;
import org.jboss.interceptor.model.InterceptionTypeRegistry;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
-import org.jboss.weld.DefinitionException;
-import org.jboss.weld.ForbiddenArgumentException;
import org.jboss.weld.bean.DecoratorImpl;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bean.SessionBean;
import org.jboss.weld.ejb.EJBApiAbstraction;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.injection.ConstructorInjectionPoint;
import org.jboss.weld.injection.FieldInjectionPoint;
import org.jboss.weld.injection.MethodInjectionPoint;
@@ -90,6 +89,7 @@
import org.jboss.weld.introspector.WeldMember;
import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.cache.BindingTypeModel;
import org.jboss.weld.metadata.cache.InterceptorBindingModel;
import org.jboss.weld.metadata.cache.MergedStereotypes;
Added: core/trunk/impl/src/main/java/org/jboss/weld/util/CleanableMethodHandler.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/CleanableMethodHandler.java
(rev 0)
+++
core/trunk/impl/src/main/java/org/jboss/weld/util/CleanableMethodHandler.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,41 @@
+package org.jboss.weld.util;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.Serializable;
+import java.lang.reflect.Method;
+
+import javassist.util.proxy.MethodHandler;
+
+import org.jboss.weld.Container;
+
+public class CleanableMethodHandler implements MethodHandler, Serializable
+{
+
+ private static final long serialVersionUID = 2140367342468307705L;
+
+ private MethodHandler delegate;
+
+ public CleanableMethodHandler(MethodHandler delegate)
+ {
+ this.delegate = delegate;
+ Container.instance().deploymentServices().get(JavassistCleaner.class).add(this);
+ }
+
+ public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args)
throws Throwable
+ {
+ return delegate.invoke(self, thisMethod, proceed, args);
+ }
+
+ public void clean()
+ {
+ this.delegate = null;
+ }
+
+ private void readObject(ObjectInputStream in) throws IOException,
ClassNotFoundException
+ {
+ in.defaultReadObject();
+ Container.instance().deploymentServices().get(JavassistCleaner.class).add(this);
+ }
+
+}
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/util/CleanableMethodHandler.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Deployers.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Deployers.java 2010-01-08 12:25:43
UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Deployers.java 2010-01-08 13:59:36
UTC (rev 5398)
@@ -17,11 +17,11 @@
package org.jboss.weld.util;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenStateException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
import org.jboss.weld.introspector.MethodSignature;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.manager.BeanManagerImpl;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/DeploymentStructures.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/DeploymentStructures.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/DeploymentStructures.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -4,11 +4,11 @@
import java.util.Map;
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.ForbiddenStateException;
import org.jboss.weld.bootstrap.BeanDeployment;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.manager.BeanManagerImpl;
public class DeploymentStructures
{
Added: core/trunk/impl/src/main/java/org/jboss/weld/util/JavassistCleaner.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/JavassistCleaner.java
(rev 0)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/JavassistCleaner.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -0,0 +1,32 @@
+package org.jboss.weld.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.jboss.weld.bootstrap.api.Service;
+
+public class JavassistCleaner implements Service
+{
+
+ private final Collection<CleanableMethodHandler> cleanableMethodHandlers;
+
+ public JavassistCleaner()
+ {
+ this.cleanableMethodHandlers = new ArrayList<CleanableMethodHandler>();
+ }
+
+ public void add(CleanableMethodHandler cleanableMethodHandler)
+ {
+ cleanableMethodHandlers.add(cleanableMethodHandler);
+ }
+
+ public void cleanup()
+ {
+ for (CleanableMethodHandler cleanableMethodHandler : cleanableMethodHandlers)
+ {
+ cleanableMethodHandler.clean();
+ }
+ cleanableMethodHandlers.clear();
+ }
+
+}
\ No newline at end of file
Property changes on:
core/trunk/impl/src/main/java/org/jboss/weld/util/JavassistCleaner.java
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Observers.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Observers.java 2010-01-08 12:25:43
UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Observers.java 2010-01-08 13:59:36
UTC (rev 5398)
@@ -23,7 +23,7 @@
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
-import org.jboss.weld.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
import org.jboss.weld.util.reflection.HierarchyDiscovery;
/**
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java 2010-01-08 12:25:43 UTC
(rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/Proxies.java 2010-01-08 13:59:36 UTC
(rev 5398)
@@ -31,7 +31,8 @@
import javassist.util.proxy.ProxyFactory;
import javassist.util.proxy.ProxyObject;
-import org.jboss.weld.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.ForbiddenArgumentException;
+import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.util.reflection.Reflections;
import org.jboss.weld.util.reflection.SecureReflections;
@@ -138,27 +139,54 @@
}
+ private static final String DEFAULT_INTERCEPTOR = "default_interceptor";
+
+ /**
+ * Create a proxy with a handler, registering the proxy for cleanup
+ *
+ * @param <T>
+ * @param methodHandler
+ * @param typeInfo
+ * @return
+ * @throws IllegalAccessException
+ * @throws InstantiationException
+ */
public static <T> T createProxy(MethodHandler methodHandler, TypeInfo typeInfo)
throws IllegalAccessException, InstantiationException
{
return
SecureReflections.newInstance(Proxies.<T>createProxyClass(methodHandler,
typeInfo));
}
+ /**
+ * Create a proxy class
+ *
+ * You will need to manually register the proxy instances for cleanup
+ *
+ * @param <T>
+ * @param typeInfo
+ * @return
+ */
public static <T> Class<T> createProxyClass(TypeInfo typeInfo)
{
return createProxyClass(null, typeInfo);
}
+ /**
+ * Create a proxy class
+ *
+ * You will need to manually register the proxy instances for cleanup
+ *
+ * @param <T>
+ * @param methodHandler
+ * @param typeInfo
+ * @return
+ */
public static <T> Class<T> createProxyClass(MethodHandler methodHandler,
TypeInfo typeInfo)
{
ProxyFactory proxyFactory = typeInfo.createProxyFactory();
- if (methodHandler != null)
- {
- proxyFactory.setHandler(methodHandler);
- }
+ attachMethodHandler(proxyFactory, methodHandler);
@SuppressWarnings("unchecked")
Class<T> clazz = proxyFactory.createClass();
-
return clazz;
}
@@ -263,11 +291,23 @@
return instance.getClass().getName().indexOf("_$$_javassist_") > 0;
}
+ public static ProxyFactory attachMethodHandler(ProxyFactory proxyFactory,
MethodHandler methodHandler)
+ {
+ if (methodHandler != null)
+ {
+ proxyFactory.setHandler(new CleanableMethodHandler(methodHandler));
+ }
+ return proxyFactory;
+ }
+
public static <T> T attachMethodHandler(T instance, MethodHandler
methodHandler)
{
if (instance instanceof ProxyObject)
{
- ((ProxyObject) instance).setHandler(methodHandler);
+ if (methodHandler != null)
+ {
+ ((ProxyObject) instance).setHandler(new
CleanableMethodHandler(methodHandler));
+ }
return instance;
}
else
@@ -276,6 +316,30 @@
}
}
+
+ public static void clean(Class<?> clazz)
+ {
+ if (!ProxyObject.class.isAssignableFrom(clazz))
+ {
+ throw new ForbiddenArgumentException(INSTANCE_NOT_A_PROXY, clazz);
+ }
+ else
+ {
+ // Clear the default handler
+ try
+ {
+ SecureReflections.getDeclaredField(clazz, DEFAULT_INTERCEPTOR).set(null,
null);
+ }
+ catch (IllegalAccessException e)
+ {
+ throw new WeldException(e);
+ }
+ catch (NoSuchFieldException e)
+ {
+ throw new WeldException(e);
+ }
+ }
+ }
}
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ConcurrentCache.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ConcurrentCache.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/util/collections/ConcurrentCache.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -23,7 +23,7 @@
import java.util.concurrent.Future;
import java.util.concurrent.FutureTask;
-import org.jboss.weld.ForbiddenStateException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
import com.google.common.collect.ForwardingMap;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/util/dom/NodeListIterator.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/util/dom/NodeListIterator.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/util/dom/NodeListIterator.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -20,7 +20,7 @@
import java.util.Iterator;
-import org.jboss.weld.InvalidOperationException;
+import org.jboss.weld.exceptions.InvalidOperationException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/SecureReflections.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/SecureReflections.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/SecureReflections.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -24,7 +24,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
-import org.jboss.weld.DeploymentException;
+import org.jboss.weld.exceptions.DeploymentException;
/**
*
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/util/serviceProvider/DefaultServiceLoader.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/util/serviceProvider/DefaultServiceLoader.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/java/org/jboss/weld/util/serviceProvider/DefaultServiceLoader.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -29,8 +29,8 @@
import java.util.Iterator;
import java.util.Set;
-import org.jboss.weld.ForbiddenStateException;
-import org.jboss.weld.InvalidOperationException;
+import org.jboss.weld.exceptions.ForbiddenStateException;
+import org.jboss.weld.exceptions.InvalidOperationException;
import org.jboss.weld.util.reflection.Reflections;
import org.jboss.weld.util.reflection.SecureReflections;
import org.slf4j.Logger;
Modified: core/trunk/impl/src/main/java/org/jboss/weld/xml/WeldXmlException.java
===================================================================
--- core/trunk/impl/src/main/java/org/jboss/weld/xml/WeldXmlException.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/impl/src/main/java/org/jboss/weld/xml/WeldXmlException.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -19,7 +19,7 @@
import javax.enterprise.inject.InjectionException;
-import org.jboss.weld.WeldExceptionMessage;
+import org.jboss.weld.exceptions.WeldExceptionMessage;
/**
* Used for exceptions from the Weld XML parser and provides localization
Modified:
core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties
===================================================================
---
core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/impl/src/main/resources/org/jboss/weld/messages/reflection_en.properties 2010-01-08
13:59:36 UTC (rev 5398)
@@ -7,3 +7,4 @@
UNABLE_TO_GET_PARAMETER_NAME=Unable to determine name of parameter
ANNOTATION_MAP_NULL=annotationMap cannot be null
DECLARED_ANNOTATION_MAP_NULL=declaredAnnotationMap cannot be null
+CLEANING_JAVASSIST_PROXY_CLASS=Cleaning Javassist proxy. Class {0}
\ No newline at end of file
Modified: core/trunk/jboss-as/build.properties
===================================================================
--- core/trunk/jboss-as/build.properties 2010-01-08 12:25:43 UTC (rev 5397)
+++ core/trunk/jboss-as/build.properties 2010-01-08 13:59:36 UTC (rev 5398)
@@ -6,7 +6,7 @@
# org.jboss.testharness.container.shutdownDelay=15000
# maximum number of TCK tests to deploy before restarting JBoss AS
-# jboss.deployments.restart = 25
+# max.deployments.restart = 25
weld-deployer.version=5.2.0-SNAPSHOT
weld.version=1.0.1-SNAPSHOT
jboss-ejb3.version=1.0.0
Modified: core/trunk/jboss-tck-runner/pom.xml
===================================================================
--- core/trunk/jboss-tck-runner/pom.xml 2010-01-08 12:25:43 UTC (rev 5397)
+++ core/trunk/jboss-tck-runner/pom.xml 2010-01-08 13:59:36 UTC (rev 5398)
@@ -94,7 +94,7 @@
<suiteXmlFiles>
<suiteXmlFile>src/test/resources/tck-tests.xml</suiteXmlFile>
</suiteXmlFiles>
- <argLine>-Xmx748m</argLine>
+ <argLine>-Xmx1024m</argLine>
<forkMode>once</forkMode>
</configuration>
</plugin>
Modified: core/trunk/porting-package/src/main/java/org/jboss/weld/tck/ELImpl.java
===================================================================
--- core/trunk/porting-package/src/main/java/org/jboss/weld/tck/ELImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/porting-package/src/main/java/org/jboss/weld/tck/ELImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -5,7 +5,7 @@
import org.jboss.jsr299.tck.api.JSR299Configuration;
import org.jboss.testharness.api.Configurable;
import org.jboss.testharness.api.Configuration;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.mock.el.EL;
public class ELImpl implements org.jboss.jsr299.tck.spi.EL, Configurable
Modified: core/trunk/porting-package/src/main/java/org/jboss/weld/tck/ManagersImpl.java
===================================================================
---
core/trunk/porting-package/src/main/java/org/jboss/weld/tck/ManagersImpl.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/porting-package/src/main/java/org/jboss/weld/tck/ManagersImpl.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -4,8 +4,8 @@
import javax.enterprise.inject.spi.BeanManager;
import org.jboss.jsr299.tck.spi.Managers;
-import org.jboss.weld.DefinitionException;
-import org.jboss.weld.DeploymentException;
+import org.jboss.weld.exceptions.DefinitionException;
+import org.jboss.weld.exceptions.DeploymentException;
import org.jboss.weld.test.BeanManagerLocator;
public class ManagersImpl implements Managers
Modified: core/trunk/tests/src/main/java/org/jboss/weld/mock/TestContainer.java
===================================================================
--- core/trunk/tests/src/main/java/org/jboss/weld/mock/TestContainer.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/tests/src/main/java/org/jboss/weld/mock/TestContainer.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -4,8 +4,8 @@
import java.util.Arrays;
import java.util.Collection;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.manager.BeanManagerImpl;
/**
* Control of the container, used for tests. Wraps up common operations.
Modified:
core/trunk/tests/src/main/java/org/jboss/weld/mock/cluster/AbstractClusterTest.java
===================================================================
---
core/trunk/tests/src/main/java/org/jboss/weld/mock/cluster/AbstractClusterTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/main/java/org/jboss/weld/mock/cluster/AbstractClusterTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -7,10 +7,10 @@
import java.io.ObjectOutputStream;
import java.util.Collection;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.api.SingletonProvider;
import org.jboss.weld.context.ContextLifecycle;
import org.jboss.weld.context.api.BeanStore;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.mock.MockEELifecycle;
import org.jboss.weld.mock.TestContainer;
import org.testng.annotations.AfterClass;
Modified: core/trunk/tests/src/main/java/org/jboss/weld/mock/el/EL.java
===================================================================
--- core/trunk/tests/src/main/java/org/jboss/weld/mock/el/EL.java 2010-01-08 12:25:43 UTC
(rev 5397)
+++ core/trunk/tests/src/main/java/org/jboss/weld/mock/el/EL.java 2010-01-08 13:59:36 UTC
(rev 5398)
@@ -30,9 +30,9 @@
import javax.el.ResourceBundleELResolver;
import javax.el.VariableMapper;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.el.WeldELContextListener;
import org.jboss.weld.el.WeldExpressionFactory;
+import org.jboss.weld.manager.BeanManagerImpl;
import com.sun.el.ExpressionFactoryImpl;
import com.sun.el.lang.FunctionMapperImpl;
Modified: core/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWeldTest.java
===================================================================
--- core/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWeldTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/tests/src/main/java/org/jboss/weld/test/AbstractWeldTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -20,7 +20,7 @@
import org.jboss.testharness.AbstractTest;
import org.jboss.testharness.impl.runner.servlet.ServletTestRunner;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.mock.el.EL;
import org.jboss.weld.util.collections.EnumerationList;
import org.testng.ITestContext;
Modified: core/trunk/tests/src/main/java/org/jboss/weld/test/BeanManagerLocator.java
===================================================================
--- core/trunk/tests/src/main/java/org/jboss/weld/test/BeanManagerLocator.java 2010-01-08
12:25:43 UTC (rev 5397)
+++ core/trunk/tests/src/main/java/org/jboss/weld/test/BeanManagerLocator.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,9 +1,9 @@
package org.jboss.weld.test;
import org.jboss.testharness.impl.runner.servlet.ServletTestRunner;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.servlet.ServletHelper;
public class BeanManagerLocator
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/ActivitiesTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/ActivitiesTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/ActivitiesTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -19,9 +19,9 @@
import javax.enterprise.util.AnnotationLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.ForwardingBean;
import org.jboss.weld.literal.DefaultLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/child/SameBeanTypeInChildActivityTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/child/SameBeanTypeInChildActivityTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/child/SameBeanTypeInChildActivityTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -15,8 +15,8 @@
import javax.enterprise.util.AnnotationLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.literal.DefaultLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/ELCurrentActivityTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/ELCurrentActivityTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/ELCurrentActivityTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -16,7 +16,7 @@
import javax.enterprise.util.AnnotationLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/InstanceCurrentActivityTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/InstanceCurrentActivityTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/activities/current/InstanceCurrentActivityTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -16,7 +16,7 @@
import javax.enterprise.util.AnnotationLiteral;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/beanManager/serializability/ManagerTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/beanManager/serializability/ManagerTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/beanManager/serializability/ManagerTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -13,8 +13,8 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.literal.DefaultLiteral;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/abstractDecorator/broken/SimpleAbstractDecoratorWithInvalidAbstractMethodTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/abstractDecorator/broken/SimpleAbstractDecoratorWithInvalidAbstractMethodTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/abstractDecorator/broken/SimpleAbstractDecoratorWithInvalidAbstractMethodTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -20,7 +20,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.weld.DefinitionException;
+import org.jboss.weld.exceptions.DefinitionException;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/custom/CustomDecoratorTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/custom/CustomDecoratorTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/custom/CustomDecoratorTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -23,13 +23,13 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.context.spi.CreationalContext;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.mock.TestContainer;
import org.jboss.weld.mock.MockServletLifecycle;
import org.jboss.weld.mock.MockBeanDeploymentArchive;
import org.jboss.weld.mock.MockDeployment;
import org.jboss.weld.util.serviceProvider.ServiceLoaderFactory;
import org.jboss.weld.util.serviceProvider.PackageServiceLoaderFactory;
-import org.jboss.weld.BeanManagerImpl;
import org.testng.annotations.Test;
Modified: core/trunk/tests/src/test/java/org/jboss/weld/tests/event/SimpleEventTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/event/SimpleEventTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/event/SimpleEventTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -7,7 +7,7 @@
import javax.inject.Inject;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/passivation/broken/interceptorWithNonSerializableField/InterceptorWithNonSerializableFieldOnPassivatingBean.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/passivation/broken/interceptorWithNonSerializableField/InterceptorWithNonSerializableFieldOnPassivatingBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/passivation/broken/interceptorWithNonSerializableField/InterceptorWithNonSerializableFieldOnPassivatingBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -21,7 +21,7 @@
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.weld.DeploymentException;
+import org.jboss.weld.exceptions.DeploymentException;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/passivation/broken/nonSerializableInterceptor/NonPassivatingInterceptorOnPassivatingBean.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/passivation/broken/nonSerializableInterceptor/NonPassivatingInterceptorOnPassivatingBean.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/interceptors/passivation/broken/nonSerializableInterceptor/NonPassivatingInterceptorOnPassivatingBean.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -21,7 +21,7 @@
import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
import org.jboss.testharness.impl.packaging.IntegrationTest;
import org.jboss.testharness.impl.packaging.jsr299.BeansXml;
-import org.jboss.weld.DeploymentException;
+import org.jboss.weld.exceptions.DeploymentException;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/cluster/NaiveClusterTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/cluster/NaiveClusterTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/cluster/NaiveClusterTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -5,7 +5,7 @@
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.mock.TestContainer;
import org.jboss.weld.mock.cluster.AbstractClusterTest;
import org.testng.annotations.Test;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/extensions/NonBdaExtensionTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/extensions/NonBdaExtensionTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/extensions/NonBdaExtensionTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -2,9 +2,9 @@
import javax.enterprise.inject.spi.Extension;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.mock.AbstractMockDeployment;
import org.jboss.weld.mock.MockBeanDeploymentArchive;
import org.jboss.weld.mock.MockServletLifecycle;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/nonTransitiveResolution/TransitiveResolutionTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/nonTransitiveResolution/TransitiveResolutionTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/nonTransitiveResolution/TransitiveResolutionTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -1,8 +1,8 @@
package org.jboss.weld.tests.unit.deployment.structure.nonTransitiveResolution;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.Deployment;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.mock.AbstractMockDeployment;
import org.jboss.weld.mock.MockBeanDeploymentArchive;
import org.jboss.weld.mock.MockDeployment;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/resolution/AccessibleManagerResolutionTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/resolution/AccessibleManagerResolutionTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/deployment/structure/resolution/AccessibleManagerResolutionTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -4,7 +4,6 @@
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.ContextualStoreImpl;
import org.jboss.weld.bean.ManagedBean;
@@ -15,6 +14,7 @@
import org.jboss.weld.ejb.EjbDescriptors;
import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.introspector.jlr.WeldClassImpl;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.resources.ClassTransformer;
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/environments/servlet/ServletEnvironmentTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/environments/servlet/ServletEnvironmentTest.java 2010-01-08
12:25:43 UTC (rev 5397)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/unit/environments/servlet/ServletEnvironmentTest.java 2010-01-08
13:59:36 UTC (rev 5398)
@@ -8,9 +8,9 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.util.AnnotationLiteral;
-import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.ManagedBean;
import org.jboss.weld.bean.RIBean;
+import org.jboss.weld.manager.BeanManagerImpl;
import org.jboss.weld.mock.MockServletLifecycle;
import org.jboss.weld.mock.TestContainer;
import org.testng.annotations.AfterClass;