[webbeans-commits] Webbeans SVN: r2798 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 18 other directories.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Tue Jun 9 10:49:53 EDT 2009
Author: pete.muir at jboss.org
Date: 2009-06-09 10:49:53 -0400 (Tue, 09 Jun 2009)
New Revision: 2798
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractResourceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceContextBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceUnitBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/RemoteEjbBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/ResourceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/WebServiceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyProvider.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlEnvironment.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
Log:
Rename ManagerImpl
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java (from rev 2797, ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -0,0 +1,1158 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans;
+
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.lang.reflect.TypeVariable;
+import java.lang.reflect.WildcardType;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.Stack;
+import java.util.TreeSet;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.el.ELResolver;
+import javax.enterprise.context.ContextNotActiveException;
+import javax.enterprise.context.ScopeType;
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.AmbiguousResolutionException;
+import javax.enterprise.inject.BindingType;
+import javax.enterprise.inject.UnproxyableResolutionException;
+import javax.enterprise.inject.UnsatisfiedResolutionException;
+import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.deployment.Standard;
+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.ManagedBean;
+import javax.enterprise.inject.spi.ObserverMethod;
+import javax.event.Observer;
+import javax.inject.DeploymentException;
+import javax.inject.DuplicateBindingTypeException;
+
+import org.jboss.webbeans.bean.DisposalMethodBean;
+import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.bean.NewEnterpriseBean;
+import org.jboss.webbeans.bean.RIBean;
+import org.jboss.webbeans.bean.proxy.ClientProxyProvider;
+import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
+import org.jboss.webbeans.context.ApplicationContext;
+import org.jboss.webbeans.context.CreationalContextImpl;
+import org.jboss.webbeans.el.Namespace;
+import org.jboss.webbeans.el.WebBeansELResolverImpl;
+import org.jboss.webbeans.event.EventManager;
+import org.jboss.webbeans.event.EventObserver;
+import org.jboss.webbeans.event.ObserverImpl;
+import org.jboss.webbeans.injection.NonContextualInjector;
+import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
+import org.jboss.webbeans.injection.resolution.Resolver;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.log.Log;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.util.Beans;
+import org.jboss.webbeans.util.Proxies;
+import org.jboss.webbeans.util.Reflections;
+import org.jboss.webbeans.util.collections.multi.ConcurrentListHashMultiMap;
+import org.jboss.webbeans.util.collections.multi.ConcurrentListMultiMap;
+import org.jboss.webbeans.util.collections.multi.ConcurrentSetHashMultiMap;
+import org.jboss.webbeans.util.collections.multi.ConcurrentSetMultiMap;
+
+/**
+ * Implementation of the Web Beans Manager.
+ *
+ * Essentially a singleton for registering Beans, Contexts, Observers,
+ * Interceptors etc. as well as providing resolution
+ *
+ * @author Pete Muir
+ *
+ */
+public class BeanManagerImpl implements WebBeansManager, 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 Log log = Logging.getLog(BeanManagerImpl.class);
+
+ private static final long serialVersionUID = 3021562879133838561L;
+
+ // The JNDI key to place the manager under
+ public static final String JNDI_KEY = "java:app/Manager";
+
+ /*
+ * Application scoped services
+ * ****************************
+ */
+ private transient final ExecutorService taskExecutor = Executors.newSingleThreadExecutor();
+ private transient final ServiceRegistry services;
+
+ /*
+ * Application scoped data structures
+ * ***********************************
+ */
+ private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
+ private transient final ConcurrentListMultiMap<Class<? extends Annotation>, Context> contexts;
+ private final transient Set<CurrentActivity> currentActivities;
+ private transient final ClientProxyProvider clientProxyProvider;
+ private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans;
+ private transient final Map<String, RIBean<?>> riBeans;
+ private final transient Map<Bean<?>, Bean<?>> specializedBeans;
+ private final transient AtomicInteger ids;
+
+ /*
+ * Activity scoped services
+ * *************************
+ */
+ private transient final EventManager eventManager;
+ private transient final Resolver resolver;
+ private final transient NonContextualInjector nonContextualInjector;
+ private final transient ELResolver webbeansELResolver;
+
+ /*
+ * Activity scoped data structures
+ * ********************************
+ */
+ private transient final ThreadLocal<Stack<InjectionPoint>> currentInjectionPoint;
+ private transient List<Bean<?>> beanWithManagers;
+ private final transient Namespace rootNamespace;
+ private final transient ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers;
+ private final transient Set<BeanManagerImpl> childActivities;
+ private final Integer id;
+
+
+ /**
+ * Create a new, root, manager
+ *
+ * @param serviceRegistry
+ * @return
+ */
+ public static BeanManagerImpl newRootManager(ServiceRegistry serviceRegistry)
+ {
+ List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ defaultEnabledDeploymentTypes.add(0, Standard.class);
+ defaultEnabledDeploymentTypes.add(1, Production.class);
+
+ return new BeanManagerImpl(
+ serviceRegistry,
+ new CopyOnWriteArrayList<Bean<?>>(),
+ new ConcurrentSetHashMultiMap<Type, EventObserver<?>>(),
+ new Namespace(),
+ new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>(),
+ new ConcurrentHashMap<String, RIBean<?>>(),
+ new ClientProxyProvider(),
+ new ConcurrentListHashMultiMap<Class<? extends Annotation>, Context>(),
+ new CopyOnWriteArraySet<CurrentActivity>(),
+ new HashMap<Bean<?>, Bean<?>>(),
+ defaultEnabledDeploymentTypes,
+ new AtomicInteger()
+ );
+ }
+
+ /**
+ * Create a new child manager
+ *
+ * @param parentManager
+ * @return
+ */
+ public static BeanManagerImpl newChildManager(BeanManagerImpl parentManager)
+ {
+ List<Bean<?>> beans = new CopyOnWriteArrayList<Bean<?>>();
+ beans.addAll(parentManager.getBeans());
+
+ ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers = new ConcurrentSetHashMultiMap<Type, EventObserver<?>>();
+ registeredObservers.deepPutAll(parentManager.getRegisteredObservers());
+ Namespace rootNamespace = new Namespace(parentManager.getRootNamespace());
+
+ return new BeanManagerImpl(
+ parentManager.getServices(),
+ beans,
+ registeredObservers,
+ rootNamespace,
+ parentManager.getNewEnterpriseBeanMap(),
+ parentManager.getRiBeans(),
+ parentManager.getClientProxyProvider(),
+ parentManager.getContexts(),
+ parentManager.getCurrentActivities(),
+ parentManager.getSpecializedBeans(),
+ parentManager.getEnabledDeploymentTypes(),
+ parentManager.getIds()
+ );
+ }
+
+ /**
+ * Create a new manager
+ *
+ * @param ejbServices the ejbResolver to use
+ */
+ private BeanManagerImpl(
+ ServiceRegistry serviceRegistry,
+ List<Bean<?>> beans,
+ ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers,
+ Namespace rootNamespace,
+ Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans,
+ Map<String, RIBean<?>> riBeans,
+ ClientProxyProvider clientProxyProvider,
+ ConcurrentListMultiMap<Class<? extends Annotation>, Context> contexts,
+ Set<CurrentActivity> currentActivities,
+ Map<Bean<?>, Bean<?>> specializedBeans,
+ List<Class<? extends Annotation>> enabledDeploymentTypes,
+ AtomicInteger ids
+ )
+ {
+ this.services = serviceRegistry;
+ this.beanWithManagers = beans;
+ this.newEnterpriseBeans = newEnterpriseBeans;
+ this.riBeans = riBeans;
+ this.clientProxyProvider = clientProxyProvider;
+ this.contexts = contexts;
+ this.currentActivities = currentActivities;
+ this.specializedBeans = specializedBeans;
+ this.registeredObservers = registeredObservers;
+ setEnabledDeploymentTypes(enabledDeploymentTypes);
+ this.rootNamespace = rootNamespace;
+ this.ids = ids;
+ this.id = ids.incrementAndGet();
+
+ this.resolver = new Resolver(this);
+ this.eventManager = new EventManager(this);
+ this.nonContextualInjector = new NonContextualInjector(this);
+ this.webbeansELResolver = new WebBeansELResolverImpl(this);
+ this.childActivities = new CopyOnWriteArraySet<BeanManagerImpl>();
+ this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
+ {
+ @Override
+ protected Stack<InjectionPoint> initialValue()
+ {
+ return new Stack<InjectionPoint>();
+ }
+ };
+ }
+
+ /**
+ * Set up the enabled deployment types, if none are specified by the user,
+ * the default @Production and @Standard are used. For internal use.
+ *
+ * @param enabledDeploymentTypes The enabled deployment types from
+ * web-beans.xml
+ */
+ protected void checkEnabledDeploymentTypes()
+ {
+ if (!this.enabledDeploymentTypes.get(0).equals(Standard.class))
+ {
+ throw new DeploymentException("@Standard must be the lowest precedence deployment type");
+ }
+ }
+
+ protected void addWebBeansDeploymentTypes()
+ {
+ if (!this.enabledDeploymentTypes.contains(WebBean.class))
+ {
+ this.enabledDeploymentTypes.add(1, WebBean.class);
+ }
+ }
+
+ /**
+ * Registers a bean with the manager
+ *
+ * @param bean The bean to register
+ * @return A reference to manager
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#addBean(javax.inject.manager.Bean)
+ */
+ public void addBean(Bean<?> bean)
+ {
+ if (beanWithManagers.contains(bean))
+ {
+ return;
+ }
+ resolver.clear();
+ beanWithManagers.add(bean);
+ registerBeanNamespace(bean);
+ for (BeanManagerImpl childActivity : childActivities)
+ {
+ childActivity.addBean(bean);
+ }
+ return;
+ }
+
+ /**
+ * Resolve the disposal method for the given producer method. For internal
+ * use.
+ *
+ * @param apiType The API type to match
+ * @param bindings The binding types to match
+ * @return The set of matching disposal methods
+ */
+ public <T> Set<DisposalMethodBean<T>> resolveDisposalBeans(Class<T> apiType, Annotation... bindings)
+ {
+ // Correct?
+ Set<Bean<?>> beans = getBeans(apiType, bindings);
+ Set<DisposalMethodBean<T>> disposalBeans = new HashSet<DisposalMethodBean<T>>();
+ for (Bean<?> bean : beans)
+ {
+ if (bean instanceof DisposalMethodBean)
+ {
+ disposalBeans.add((DisposalMethodBean<T>) bean);
+ }
+ }
+ return disposalBeans;
+ }
+
+ public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
+ {
+ Class<?> clazz = event.getClass();
+ for (Annotation annotation : bindings)
+ {
+ if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
+ {
+ throw new IllegalArgumentException("Not a binding type " + annotation);
+ }
+ }
+ HashSet<Annotation> bindingAnnotations = new HashSet<Annotation>(Arrays.asList(bindings));
+ if (bindingAnnotations.size() < bindings.length)
+ {
+ throw new DuplicateBindingTypeException("Duplicate binding types: " + bindings);
+ }
+ checkEventType(clazz);
+ return eventManager.getObservers(event, bindings);
+ }
+
+ private void checkEventType(Type eventType)
+ {
+ Type[] types;
+ if (eventType instanceof Class)
+ {
+ types = Reflections.getActualTypeArguments((Class<?>) eventType);
+ }
+ else if (eventType instanceof ParameterizedType)
+ {
+ types = ((ParameterizedType) eventType).getActualTypeArguments();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Event type " + eventType + " isn't a concrete type");
+ }
+ for (Type type : types)
+ {
+ if (type instanceof WildcardType)
+ {
+ throw new IllegalArgumentException("Cannot provide an event type parameterized with a wildcard " + eventType);
+ }
+ if (type instanceof TypeVariable)
+ {
+ throw new IllegalArgumentException("Cannot provide an event type parameterized with a type parameter " + eventType);
+ }
+ }
+ }
+
+ /**
+ * A strongly ordered, unmodifiable list of enabled deployment types
+ *
+ * @return The ordered enabled deployment types known to the manager
+ */
+ public List<Class<? extends Annotation>> getEnabledDeploymentTypes()
+ {
+ return Collections.unmodifiableList(enabledDeploymentTypes);
+ }
+
+ /**
+ * Set the enabled deployment types
+ *
+ * @param enabledDeploymentTypes
+ */
+ public void setEnabledDeploymentTypes(List<Class<? extends Annotation>> enabledDeploymentTypes)
+ {
+ this.enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>(enabledDeploymentTypes);
+ checkEnabledDeploymentTypes();
+ addWebBeansDeploymentTypes();
+ }
+
+
+ public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
+ {
+ return getBeans(ResolvableAnnotatedClass.of(beanType, bindings), bindings);
+ }
+
+ public Set<Bean<?>> getBeans(AnnotatedItem<?, ?> element, Annotation... bindings)
+ {
+ for (Annotation annotation : element.getAnnotationsAsSet())
+ {
+ if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
+ {
+ throw new IllegalArgumentException("Not a binding type " + 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(BindingType.class).size())
+ {
+ throw new DuplicateBindingTypeException("Duplicate bindings (" + Arrays.asList(bindings) + ") type passed " + element.toString());
+ }
+ return resolver.get(element);
+ }
+
+ public Set<Bean<?>> getBeans(InjectionPoint injectionPoint)
+ {
+ boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
+ try
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().push(injectionPoint);
+ }
+ // TODO Do this properly
+ return getBeans(ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0])));
+ }
+ finally
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+ }
+
+ /**
+ * Wraps a collection of beans into a thread safe list. Since this overwrites
+ * any existing list of beans in the manager, this should only be done on
+ * startup and other controlled situations. Also maps the beans by
+ * implementation class. For internal use.
+ *
+ * @param beans The set of beans to add
+ * @return A reference to the manager
+ */
+ // TODO Build maps in the deployer :-)
+ public void setBeans(Set<RIBean<?>> beans)
+ {
+ synchronized (beans)
+ {
+ this.beanWithManagers = new CopyOnWriteArrayList<Bean<?>>(beans);
+ for (RIBean<?> bean : beans)
+ {
+ if (bean instanceof NewEnterpriseBean)
+ {
+ newEnterpriseBeans.put(bean.getType(), (EnterpriseBean<?>) bean);
+ }
+ riBeans.put(bean.getId(), bean);
+ registerBeanNamespace(bean);
+ }
+ resolver.clear();
+ }
+ }
+
+ protected void registerBeanNamespace(Bean<?> bean)
+ {
+ if (bean.getName() != null && bean.getName().indexOf('.') > 0)
+ {
+ String name = bean.getName().substring(0, bean.getName().lastIndexOf('.'));
+ String[] hierarchy = name.split("\\.");
+ Namespace namespace = getRootNamespace();
+ for (String s : hierarchy)
+ {
+ namespace = namespace.putIfAbsent(s);
+ }
+ }
+ }
+
+ /**
+ * Gets the class-mapped beans. For internal use.
+ *
+ * @return The bean map
+ */
+ public Map<Class<?>, EnterpriseBean<?>> getNewEnterpriseBeanMap()
+ {
+ return newEnterpriseBeans;
+ }
+
+ /**
+ * The beans registered with the Web Bean manager. For internal use
+ *
+ * @return The list of known beans
+ */
+ public List<Bean<?>> getBeans()
+ {
+ return Collections.unmodifiableList(beanWithManagers);
+ }
+
+ public Map<String, RIBean<?>> getRiBeans()
+ {
+ return Collections.unmodifiableMap(riBeans);
+ }
+
+ /**
+ * Registers a context with the manager
+ *
+ * @param context The context to add
+ * @return A reference to the manager
+ *
+ * @see javax.enterprise.inject.spi.BeanManager#addContext(javax.enterprise.context.spi.Context)
+ */
+ public void addContext(Context context)
+ {
+ contexts.put(context.getScopeType(), context);
+ }
+
+
+ public void addObserver(Observer<?> observer, Annotation... bindings)
+ {
+ addObserver(observer,eventManager.getTypeOfObserver(observer),bindings);
+ }
+
+ /**
+ * Shortcut to register an ObserverImpl
+ *
+ * @param <T>
+ * @param observer
+ */
+ public <T> void addObserver(ObserverImpl<T> observer)
+ {
+ addObserver(observer, observer.getEventType(), observer.getBindingsAsArray());
+ }
+
+ public void addObserver(ObserverMethod<?, ?> observerMethod)
+ {
+ addObserver((Observer<?>)observerMethod, observerMethod.getObservedEventType(),
+ new ArrayList<Annotation>(observerMethod.getObservedEventBindings()).toArray(new Annotation[0]));
+
+ }
+
+
+ /**
+ * Does the actual observer registration
+ *
+ * @param observer
+ * @param eventType
+ * @param bindings
+ * @return
+ */
+ public void addObserver(Observer<?> observer, Type eventType, Annotation... bindings)
+ {
+ checkEventType(eventType);
+ this.eventManager.addObserver(observer, eventType, bindings);
+ for (BeanManagerImpl childActivity : childActivities)
+ {
+ childActivity.addObserver(observer, eventType, bindings);
+ }
+ }
+
+ public void removeObserver(Observer<?> observer)
+ {
+ eventManager.removeObserver(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... bindings)
+ {
+ // Check the event object for template parameters which are not allowed by
+ // the spec.
+ if (Reflections.isParameterizedType(event.getClass()))
+ {
+ throw new IllegalArgumentException("Event type " + event.getClass().getName() + " is not allowed because it is a generic");
+ }
+ // Also check that the binding types are truly binding types
+ for (Annotation binding : bindings)
+ {
+ if (!Reflections.isBindings(binding))
+ {
+ throw new IllegalArgumentException("Event type " + event.getClass().getName() + " cannot be fired with non-binding type " + binding.getClass().getName() + " specified");
+ }
+ }
+
+ // Get the observers for this event. Although resolveObservers is
+ // parameterized, this method is not, so we have to use
+ // Observer<Object> for observers.
+ Set<Observer<Object>> observers = resolveObservers(event, bindings);
+ eventManager.notifyObservers(observers, 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("No active contexts for scope type " + scopeType.getName());
+ }
+ if (activeContexts.size() > 1)
+ {
+ throw new IllegalStateException("More than one context active for scope type " + scopeType.getName());
+ }
+ return activeContexts.iterator().next();
+
+ }
+
+ public Object getInjectableReference(Bean<?> bean, CreationalContext<?> creationalContext)
+ {
+ bean = getMostSpecializedBean(bean);
+ if (getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal())
+ {
+ if (creationalContext != null || (creationalContext == null && getContext(bean.getScopeType()).get(bean) != null))
+ {
+ return clientProxyProvider.getClientProxy(this, bean);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ return getContext(bean.getScopeType()).get((Bean) bean, creationalContext);
+ }
+ }
+
+
+ /*
+ * TODO this is not correct, as the current implementation of getInstance does not
+ * pay attention to what type the resulting instance needs to implement
+ */
+ public Object getReference(Bean<?> bean, Type beanType)
+ {
+ return getInjectableReference(bean, CreationalContextImpl.of(bean));
+ }
+
+ @SuppressWarnings("unchecked")
+ public Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
+ {
+ boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
+ try
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().push(injectionPoint);
+ }
+ AnnotatedItem<?, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]));
+ Bean<?> resolvedBean = getBean(element, element.getBindingsAsArray());
+ if (getServices().get(MetaDataCache.class).getScopeModel(resolvedBean.getScopeType()).isNormal() && !Proxies.isTypeProxyable(injectionPoint.getType()))
+ {
+ throw new UnproxyableResolutionException("Attempting to inject an unproxyable normal scoped bean " + resolvedBean + " into " + injectionPoint);
+ }
+ if (creationalContext instanceof CreationalContextImpl)
+ {
+ CreationalContextImpl<?> ctx = (CreationalContextImpl<?>) creationalContext;
+ if (ctx.containsIncompleteInstance(resolvedBean))
+ {
+ return ctx.getIncompleteInstance(resolvedBean);
+ }
+ else
+ {
+ return getInjectableReference(resolvedBean, ctx.getCreationalContext(resolvedBean));
+ }
+ }
+ else
+ {
+ return getInjectableReference(resolvedBean, creationalContext);
+ }
+ }
+ finally
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+ }
+
+ /**
+ * Returns an instance by API type and binding types
+ *
+ * @param type The API type to match
+ * @param bindings The binding types to match
+ * @return An instance of the bean
+ *
+ * @deprecated replace with non-contextual injection
+ *
+ */
+ @Deprecated
+ public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
+ {
+ AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(type, bindings);
+ return (T) getReference(getBean(element, bindings), type);
+ }
+
+ public <T> Bean<T> getBean(AnnotatedItem<T, ?> element, Annotation... bindings)
+ {
+ Set<Bean<?>> beans = getBeans(element, bindings);
+ if (beans.size() == 0)
+ {
+ throw new UnsatisfiedResolutionException(element + "Unable to resolve any Web Beans");
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousResolutionException(element + "Resolved multiple Web Beans");
+ }
+ Bean<T> bean = (Bean<T>) beans.iterator().next();
+ boolean normalScoped = getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal();
+ if (normalScoped && !Beans.isBeanProxyable(bean))
+ {
+ throw new UnproxyableResolutionException("Normal scoped bean " + bean + " is not proxyable");
+ }
+ return bean;
+ }
+
+ public Set<Bean<?>> getBeans(String name)
+ {
+ return resolver.get(name);
+ }
+
+ /**
+ * Resolves a list of decorators based on API types and binding types Os
+ *
+ * @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)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * 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)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Get the web bean resolver. For internal use
+ *
+ * @return The resolver
+ */
+ public Resolver getResolver()
+ {
+ return resolver;
+ }
+
+ /**
+ * Gets a string representation
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("Manager\n");
+ buffer.append("Enabled deployment types: " + getEnabledDeploymentTypes() + "\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();
+ }
+
+ public BeanManagerImpl createActivity()
+ {
+ BeanManagerImpl childActivity = newChildManager(this);
+ childActivities.add(childActivity);
+ CurrentManager.add(childActivity);
+ return childActivity;
+ }
+
+ public BeanManagerImpl setCurrent(Class<? extends Annotation> scopeType)
+ {
+ if (!getServices().get(MetaDataCache.class).getScopeModel(scopeType).isNormal())
+ {
+ throw new IllegalArgumentException("Scope must be a normal scope type " + 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 CurrentManager.rootManager();
+ }
+ else if (activeCurrentActivities.size() == 1)
+ {
+ return activeCurrentActivities.get(0).getManager();
+ }
+ throw new IllegalStateException("More than one current activity for an active context " + currentActivities);
+ }
+
+ public ServiceRegistry getServices()
+ {
+ return services;
+ }
+
+ /**
+ * Accesses the factory used to create each instance of InjectionPoint that
+ * is injected into web beans.
+ *
+ * @return the factory
+ */
+ public InjectionPoint getInjectionPoint()
+ {
+ if (!currentInjectionPoint.get().empty())
+ {
+ return currentInjectionPoint.get().peek();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ /**
+ *
+ * @return
+ */
+ public Map<Bean<?>, Bean<?>> getSpecializedBeans()
+ {
+ // TODO make this unmodifiable after deploy!
+ return specializedBeans;
+ }
+
+ // Serialization
+
+ protected Object readResolve()
+ {
+ return CurrentManager.get(id);
+ }
+
+ /**
+ * Provides access to the executor service used for asynchronous tasks.
+ *
+ * @return the ExecutorService for this manager
+ */
+ public ExecutorService getTaskExecutor()
+ {
+ return taskExecutor;
+ }
+
+ public void shutdown()
+ {
+ log.trace("Ending application");
+ shutdownExecutors();
+ ApplicationContext.instance().destroy();
+ ApplicationContext.instance().setActive(false);
+ ApplicationContext.instance().setBeanStore(null);
+ CurrentManager.cleanup();
+ }
+
+ /**
+ * Shuts down any executor services in the manager.
+ */
+ protected void shutdownExecutors()
+ {
+ 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();
+ }
+ }
+
+ protected ClientProxyProvider getClientProxyProvider()
+ {
+ return clientProxyProvider;
+ }
+
+ protected ConcurrentListMultiMap<Class<? extends Annotation>, Context> getContexts()
+ {
+ return contexts;
+ }
+
+ protected AtomicInteger getIds()
+ {
+ return ids;
+ }
+
+ protected Set<CurrentActivity> getCurrentActivities()
+ {
+ return currentActivities;
+ }
+
+ public Integer getId()
+ {
+ return id;
+ }
+
+ public ConcurrentSetMultiMap<Type, EventObserver<?>> getRegisteredObservers()
+ {
+ return registeredObservers;
+ }
+
+ public Namespace getRootNamespace()
+ {
+ return rootNamespace;
+ }
+
+
+ public <T> InjectionTarget<T> createInjectionTarget(Class<T> type)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> ManagedBean<T> createManagedBean(Class<T> type)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> ManagedBean<T> createManagedBean(AnnotatedType<T> type)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+
+
+ public <X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean)
+ {
+ Bean<?> 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 injectionPoint)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+
+ public Set<Annotation> getInterceptorBindingTypeDefinition(
+ Class<? extends Annotation> bindingType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Bean<?> getPassivationCapableBean(String id)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public ScopeType getScopeDefinition(Class<? extends Annotation> scopeType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Set<Annotation> getStereotypeDefinition(
+ Class<? extends Annotation> stereotype)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public boolean isBindingType(Class<? extends Annotation> annotationType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public boolean isInterceptorBindingType(
+ Class<? extends Annotation> annotationType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public boolean isScopeType(Class<? extends Annotation> annotationType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public boolean isStereotype(Class<? extends Annotation> annotationType)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <X> Bean<? extends X> getHighestPrecedenceBean(Set<Bean<? extends X>> beans)
+ {
+ if (beans.size() == 1)
+ {
+ return beans.iterator().next();
+ }
+ else if (beans.isEmpty())
+ {
+ return null;
+ }
+
+ // make a copy so that the sort is stable with respect to new deployment types added through the SPI
+ // TODO This code needs to be in Resolver
+ // TODO This needs caching
+ final List<Class<? extends Annotation>> enabledDeploymentTypes = getEnabledDeploymentTypes();
+
+ SortedSet<Bean<? extends X>> sortedBeans = new TreeSet<Bean<? extends X>>(new Comparator<Bean<? extends X>>()
+ {
+ public int compare(Bean<? extends X> o1, Bean<? extends X> o2)
+ {
+ int diff = enabledDeploymentTypes.indexOf(o1) - enabledDeploymentTypes.indexOf(o2);
+ if (diff == 0)
+ {
+ throw new AmbiguousResolutionException();
+ }
+ return diff;
+ }
+ });
+ sortedBeans.addAll(beans);
+ return sortedBeans.last();
+ }
+
+ public ELResolver getELResolver()
+ {
+ return webbeansELResolver;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -63,9 +63,9 @@
public class BeanValidator
{
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
- public BeanValidator(ManagerImpl manager)
+ public BeanValidator(BeanManagerImpl manager)
{
this.manager = manager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -41,12 +41,12 @@
public class CurrentManager
{
- private static class IntegerMangerImplMap extends TypeLiteral<Map<Integer, ManagerImpl>> {}
+ private static class IntegerMangerImplMap extends TypeLiteral<Map<Integer, BeanManagerImpl>> {}
// The root manager instance
- private static Singleton<ManagerImpl> rootManager = SingletonProvider.instance().create(ManagerImpl.class);
+ private static Singleton<BeanManagerImpl> rootManager = SingletonProvider.instance().create(BeanManagerImpl.class);
- private final static Singleton<Map<Integer, ManagerImpl>> managers = SingletonProvider.instance().create(new IntegerMangerImplMap().getRawType());
+ private final static Singleton<Map<Integer, BeanManagerImpl>> managers = SingletonProvider.instance().create(new IntegerMangerImplMap().getRawType());
public static void cleanup()
{
@@ -59,7 +59,7 @@
*
* @return The root manager
*/
- public static ManagerImpl rootManager()
+ public static BeanManagerImpl rootManager()
{
return rootManager.get();
}
@@ -69,22 +69,22 @@
*
* @param managerImpl The root manager
*/
- public static void setRootManager(ManagerImpl managerImpl)
+ public static void setRootManager(BeanManagerImpl managerImpl)
{
rootManager.set(managerImpl);
if (managers.get() == null)
{
- managers.set(new ConcurrentHashMap<Integer, ManagerImpl>());
+ managers.set(new ConcurrentHashMap<Integer, BeanManagerImpl>());
}
managers.get().put(managerImpl.getId(), managerImpl);
}
- public static ManagerImpl get(Integer key)
+ public static BeanManagerImpl get(Integer key)
{
return managers.get().get(key);
}
- public static Integer add(ManagerImpl manager)
+ public static Integer add(BeanManagerImpl manager)
{
Integer id = manager.getId();
managers.get().put(id, manager);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/FacadeImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -45,7 +45,7 @@
// The binding types the helper operates on
private final Set<? extends Annotation> bindings;
// The Web Beans manager
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
// The type of the operation
private final Type type;
@@ -55,7 +55,7 @@
* @param manager The Web Beans manager
* @param bindings The binding types
*/
- protected FacadeImpl(Type type, ManagerImpl manager, Set<? extends Annotation> bindings)
+ protected FacadeImpl(Type type, BeanManagerImpl manager, Set<? extends Annotation> bindings)
{
this.manager = manager;
this.type = type;
@@ -92,7 +92,7 @@
return result.toArray(EMPTY_BINDINGS);
}
- protected ManagerImpl getManager()
+ protected BeanManagerImpl getManager()
{
return manager.getCurrent();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -38,12 +38,12 @@
private static final long serialVersionUID = -376721889693284887L;
- public static <I> Instance<I> of(Type type, ManagerImpl manager, Set<Annotation> annotations)
+ public static <I> Instance<I> of(Type type, BeanManagerImpl manager, Set<Annotation> annotations)
{
return new InstanceImpl<I>(type, manager, annotations);
}
- private InstanceImpl(Type type, ManagerImpl manager, Set<Annotation> bindings)
+ private InstanceImpl(Type type, BeanManagerImpl manager, Set<Annotation> bindings)
{
super(type, manager, bindings);
}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -1,1158 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans;
-
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.lang.reflect.TypeVariable;
-import java.lang.reflect.WildcardType;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.Stack;
-import java.util.TreeSet;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.el.ELResolver;
-import javax.enterprise.context.ContextNotActiveException;
-import javax.enterprise.context.ScopeType;
-import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.AmbiguousResolutionException;
-import javax.enterprise.inject.BindingType;
-import javax.enterprise.inject.UnproxyableResolutionException;
-import javax.enterprise.inject.UnsatisfiedResolutionException;
-import javax.enterprise.inject.deployment.Production;
-import javax.enterprise.inject.deployment.Standard;
-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.ManagedBean;
-import javax.enterprise.inject.spi.ObserverMethod;
-import javax.event.Observer;
-import javax.inject.DeploymentException;
-import javax.inject.DuplicateBindingTypeException;
-
-import org.jboss.webbeans.bean.DisposalMethodBean;
-import org.jboss.webbeans.bean.EnterpriseBean;
-import org.jboss.webbeans.bean.NewEnterpriseBean;
-import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.bean.proxy.ClientProxyProvider;
-import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
-import org.jboss.webbeans.context.ApplicationContext;
-import org.jboss.webbeans.context.CreationalContextImpl;
-import org.jboss.webbeans.el.Namespace;
-import org.jboss.webbeans.el.WebBeansELResolverImpl;
-import org.jboss.webbeans.event.EventManager;
-import org.jboss.webbeans.event.EventObserver;
-import org.jboss.webbeans.event.ObserverImpl;
-import org.jboss.webbeans.injection.NonContextualInjector;
-import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
-import org.jboss.webbeans.injection.resolution.Resolver;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.log.Log;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.manager.api.WebBeansManager;
-import org.jboss.webbeans.metadata.MetaDataCache;
-import org.jboss.webbeans.util.Beans;
-import org.jboss.webbeans.util.Proxies;
-import org.jboss.webbeans.util.Reflections;
-import org.jboss.webbeans.util.collections.multi.ConcurrentListHashMultiMap;
-import org.jboss.webbeans.util.collections.multi.ConcurrentListMultiMap;
-import org.jboss.webbeans.util.collections.multi.ConcurrentSetHashMultiMap;
-import org.jboss.webbeans.util.collections.multi.ConcurrentSetMultiMap;
-
-/**
- * Implementation of the Web Beans Manager.
- *
- * Essentially a singleton for registering Beans, Contexts, Observers,
- * Interceptors etc. as well as providing resolution
- *
- * @author Pete Muir
- *
- */
-public class ManagerImpl implements WebBeansManager, Serializable
-{
-
- private static class CurrentActivity
- {
-
- private final Context context;
- private final ManagerImpl manager;
-
- public CurrentActivity(Context context, ManagerImpl manager)
- {
- this.context = context;
- this.manager = manager;
- }
-
- public Context getContext()
- {
- return context;
- }
-
- public ManagerImpl 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 Log log = Logging.getLog(ManagerImpl.class);
-
- private static final long serialVersionUID = 3021562879133838561L;
-
- // The JNDI key to place the manager under
- public static final String JNDI_KEY = "java:app/Manager";
-
- /*
- * Application scoped services
- * ****************************
- */
- private transient final ExecutorService taskExecutor = Executors.newSingleThreadExecutor();
- private transient final ServiceRegistry services;
-
- /*
- * Application scoped data structures
- * ***********************************
- */
- private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
- private transient final ConcurrentListMultiMap<Class<? extends Annotation>, Context> contexts;
- private final transient Set<CurrentActivity> currentActivities;
- private transient final ClientProxyProvider clientProxyProvider;
- private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans;
- private transient final Map<String, RIBean<?>> riBeans;
- private final transient Map<Bean<?>, Bean<?>> specializedBeans;
- private final transient AtomicInteger ids;
-
- /*
- * Activity scoped services
- * *************************
- */
- private transient final EventManager eventManager;
- private transient final Resolver resolver;
- private final transient NonContextualInjector nonContextualInjector;
- private final transient ELResolver webbeansELResolver;
-
- /*
- * Activity scoped data structures
- * ********************************
- */
- private transient final ThreadLocal<Stack<InjectionPoint>> currentInjectionPoint;
- private transient List<Bean<?>> beanWithManagers;
- private final transient Namespace rootNamespace;
- private final transient ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers;
- private final transient Set<ManagerImpl> childActivities;
- private final Integer id;
-
-
- /**
- * Create a new, root, manager
- *
- * @param serviceRegistry
- * @return
- */
- public static ManagerImpl newRootManager(ServiceRegistry serviceRegistry)
- {
- List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
- defaultEnabledDeploymentTypes.add(0, Standard.class);
- defaultEnabledDeploymentTypes.add(1, Production.class);
-
- return new ManagerImpl(
- serviceRegistry,
- new CopyOnWriteArrayList<Bean<?>>(),
- new ConcurrentSetHashMultiMap<Type, EventObserver<?>>(),
- new Namespace(),
- new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>(),
- new ConcurrentHashMap<String, RIBean<?>>(),
- new ClientProxyProvider(),
- new ConcurrentListHashMultiMap<Class<? extends Annotation>, Context>(),
- new CopyOnWriteArraySet<CurrentActivity>(),
- new HashMap<Bean<?>, Bean<?>>(),
- defaultEnabledDeploymentTypes,
- new AtomicInteger()
- );
- }
-
- /**
- * Create a new child manager
- *
- * @param parentManager
- * @return
- */
- public static ManagerImpl newChildManager(ManagerImpl parentManager)
- {
- List<Bean<?>> beans = new CopyOnWriteArrayList<Bean<?>>();
- beans.addAll(parentManager.getBeans());
-
- ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers = new ConcurrentSetHashMultiMap<Type, EventObserver<?>>();
- registeredObservers.deepPutAll(parentManager.getRegisteredObservers());
- Namespace rootNamespace = new Namespace(parentManager.getRootNamespace());
-
- return new ManagerImpl(
- parentManager.getServices(),
- beans,
- registeredObservers,
- rootNamespace,
- parentManager.getNewEnterpriseBeanMap(),
- parentManager.getRiBeans(),
- parentManager.getClientProxyProvider(),
- parentManager.getContexts(),
- parentManager.getCurrentActivities(),
- parentManager.getSpecializedBeans(),
- parentManager.getEnabledDeploymentTypes(),
- parentManager.getIds()
- );
- }
-
- /**
- * Create a new manager
- *
- * @param ejbServices the ejbResolver to use
- */
- private ManagerImpl(
- ServiceRegistry serviceRegistry,
- List<Bean<?>> beans,
- ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers,
- Namespace rootNamespace,
- Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans,
- Map<String, RIBean<?>> riBeans,
- ClientProxyProvider clientProxyProvider,
- ConcurrentListMultiMap<Class<? extends Annotation>, Context> contexts,
- Set<CurrentActivity> currentActivities,
- Map<Bean<?>, Bean<?>> specializedBeans,
- List<Class<? extends Annotation>> enabledDeploymentTypes,
- AtomicInteger ids
- )
- {
- this.services = serviceRegistry;
- this.beanWithManagers = beans;
- this.newEnterpriseBeans = newEnterpriseBeans;
- this.riBeans = riBeans;
- this.clientProxyProvider = clientProxyProvider;
- this.contexts = contexts;
- this.currentActivities = currentActivities;
- this.specializedBeans = specializedBeans;
- this.registeredObservers = registeredObservers;
- setEnabledDeploymentTypes(enabledDeploymentTypes);
- this.rootNamespace = rootNamespace;
- this.ids = ids;
- this.id = ids.incrementAndGet();
-
- this.resolver = new Resolver(this);
- this.eventManager = new EventManager(this);
- this.nonContextualInjector = new NonContextualInjector(this);
- this.webbeansELResolver = new WebBeansELResolverImpl(this);
- this.childActivities = new CopyOnWriteArraySet<ManagerImpl>();
- this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
- {
- @Override
- protected Stack<InjectionPoint> initialValue()
- {
- return new Stack<InjectionPoint>();
- }
- };
- }
-
- /**
- * Set up the enabled deployment types, if none are specified by the user,
- * the default @Production and @Standard are used. For internal use.
- *
- * @param enabledDeploymentTypes The enabled deployment types from
- * web-beans.xml
- */
- protected void checkEnabledDeploymentTypes()
- {
- if (!this.enabledDeploymentTypes.get(0).equals(Standard.class))
- {
- throw new DeploymentException("@Standard must be the lowest precedence deployment type");
- }
- }
-
- protected void addWebBeansDeploymentTypes()
- {
- if (!this.enabledDeploymentTypes.contains(WebBean.class))
- {
- this.enabledDeploymentTypes.add(1, WebBean.class);
- }
- }
-
- /**
- * Registers a bean with the manager
- *
- * @param bean The bean to register
- * @return A reference to manager
- *
- * @see javax.enterprise.inject.spi.BeanManager#addBean(javax.inject.manager.Bean)
- */
- public void addBean(Bean<?> bean)
- {
- if (beanWithManagers.contains(bean))
- {
- return;
- }
- resolver.clear();
- beanWithManagers.add(bean);
- registerBeanNamespace(bean);
- for (ManagerImpl childActivity : childActivities)
- {
- childActivity.addBean(bean);
- }
- return;
- }
-
- /**
- * Resolve the disposal method for the given producer method. For internal
- * use.
- *
- * @param apiType The API type to match
- * @param bindings The binding types to match
- * @return The set of matching disposal methods
- */
- public <T> Set<DisposalMethodBean<T>> resolveDisposalBeans(Class<T> apiType, Annotation... bindings)
- {
- // Correct?
- Set<Bean<?>> beans = getBeans(apiType, bindings);
- Set<DisposalMethodBean<T>> disposalBeans = new HashSet<DisposalMethodBean<T>>();
- for (Bean<?> bean : beans)
- {
- if (bean instanceof DisposalMethodBean)
- {
- disposalBeans.add((DisposalMethodBean<T>) bean);
- }
- }
- return disposalBeans;
- }
-
- public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
- {
- Class<?> clazz = event.getClass();
- for (Annotation annotation : bindings)
- {
- if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
- {
- throw new IllegalArgumentException("Not a binding type " + annotation);
- }
- }
- HashSet<Annotation> bindingAnnotations = new HashSet<Annotation>(Arrays.asList(bindings));
- if (bindingAnnotations.size() < bindings.length)
- {
- throw new DuplicateBindingTypeException("Duplicate binding types: " + bindings);
- }
- checkEventType(clazz);
- return eventManager.getObservers(event, bindings);
- }
-
- private void checkEventType(Type eventType)
- {
- Type[] types;
- if (eventType instanceof Class)
- {
- types = Reflections.getActualTypeArguments((Class<?>) eventType);
- }
- else if (eventType instanceof ParameterizedType)
- {
- types = ((ParameterizedType) eventType).getActualTypeArguments();
- }
- else
- {
- throw new IllegalArgumentException("Event type " + eventType + " isn't a concrete type");
- }
- for (Type type : types)
- {
- if (type instanceof WildcardType)
- {
- throw new IllegalArgumentException("Cannot provide an event type parameterized with a wildcard " + eventType);
- }
- if (type instanceof TypeVariable)
- {
- throw new IllegalArgumentException("Cannot provide an event type parameterized with a type parameter " + eventType);
- }
- }
- }
-
- /**
- * A strongly ordered, unmodifiable list of enabled deployment types
- *
- * @return The ordered enabled deployment types known to the manager
- */
- public List<Class<? extends Annotation>> getEnabledDeploymentTypes()
- {
- return Collections.unmodifiableList(enabledDeploymentTypes);
- }
-
- /**
- * Set the enabled deployment types
- *
- * @param enabledDeploymentTypes
- */
- public void setEnabledDeploymentTypes(List<Class<? extends Annotation>> enabledDeploymentTypes)
- {
- this.enabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>(enabledDeploymentTypes);
- checkEnabledDeploymentTypes();
- addWebBeansDeploymentTypes();
- }
-
-
- public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
- {
- return getBeans(ResolvableAnnotatedClass.of(beanType, bindings), bindings);
- }
-
- public Set<Bean<?>> getBeans(AnnotatedItem<?, ?> element, Annotation... bindings)
- {
- for (Annotation annotation : element.getAnnotationsAsSet())
- {
- if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
- {
- throw new IllegalArgumentException("Not a binding type " + 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(BindingType.class).size())
- {
- throw new DuplicateBindingTypeException("Duplicate bindings (" + Arrays.asList(bindings) + ") type passed " + element.toString());
- }
- return resolver.get(element);
- }
-
- public Set<Bean<?>> getBeans(InjectionPoint injectionPoint)
- {
- boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
- try
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().push(injectionPoint);
- }
- // TODO Do this properly
- return getBeans(ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0])));
- }
- finally
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().pop();
- }
- }
- }
-
- /**
- * Wraps a collection of beans into a thread safe list. Since this overwrites
- * any existing list of beans in the manager, this should only be done on
- * startup and other controlled situations. Also maps the beans by
- * implementation class. For internal use.
- *
- * @param beans The set of beans to add
- * @return A reference to the manager
- */
- // TODO Build maps in the deployer :-)
- public void setBeans(Set<RIBean<?>> beans)
- {
- synchronized (beans)
- {
- this.beanWithManagers = new CopyOnWriteArrayList<Bean<?>>(beans);
- for (RIBean<?> bean : beans)
- {
- if (bean instanceof NewEnterpriseBean)
- {
- newEnterpriseBeans.put(bean.getType(), (EnterpriseBean<?>) bean);
- }
- riBeans.put(bean.getId(), bean);
- registerBeanNamespace(bean);
- }
- resolver.clear();
- }
- }
-
- protected void registerBeanNamespace(Bean<?> bean)
- {
- if (bean.getName() != null && bean.getName().indexOf('.') > 0)
- {
- String name = bean.getName().substring(0, bean.getName().lastIndexOf('.'));
- String[] hierarchy = name.split("\\.");
- Namespace namespace = getRootNamespace();
- for (String s : hierarchy)
- {
- namespace = namespace.putIfAbsent(s);
- }
- }
- }
-
- /**
- * Gets the class-mapped beans. For internal use.
- *
- * @return The bean map
- */
- public Map<Class<?>, EnterpriseBean<?>> getNewEnterpriseBeanMap()
- {
- return newEnterpriseBeans;
- }
-
- /**
- * The beans registered with the Web Bean manager. For internal use
- *
- * @return The list of known beans
- */
- public List<Bean<?>> getBeans()
- {
- return Collections.unmodifiableList(beanWithManagers);
- }
-
- public Map<String, RIBean<?>> getRiBeans()
- {
- return Collections.unmodifiableMap(riBeans);
- }
-
- /**
- * Registers a context with the manager
- *
- * @param context The context to add
- * @return A reference to the manager
- *
- * @see javax.enterprise.inject.spi.BeanManager#addContext(javax.enterprise.context.spi.Context)
- */
- public void addContext(Context context)
- {
- contexts.put(context.getScopeType(), context);
- }
-
-
- public void addObserver(Observer<?> observer, Annotation... bindings)
- {
- addObserver(observer,eventManager.getTypeOfObserver(observer),bindings);
- }
-
- /**
- * Shortcut to register an ObserverImpl
- *
- * @param <T>
- * @param observer
- */
- public <T> void addObserver(ObserverImpl<T> observer)
- {
- addObserver(observer, observer.getEventType(), observer.getBindingsAsArray());
- }
-
- public void addObserver(ObserverMethod<?, ?> observerMethod)
- {
- addObserver((Observer<?>)observerMethod, observerMethod.getObservedEventType(),
- new ArrayList<Annotation>(observerMethod.getObservedEventBindings()).toArray(new Annotation[0]));
-
- }
-
-
- /**
- * Does the actual observer registration
- *
- * @param observer
- * @param eventType
- * @param bindings
- * @return
- */
- public void addObserver(Observer<?> observer, Type eventType, Annotation... bindings)
- {
- checkEventType(eventType);
- this.eventManager.addObserver(observer, eventType, bindings);
- for (ManagerImpl childActivity : childActivities)
- {
- childActivity.addObserver(observer, eventType, bindings);
- }
- }
-
- public void removeObserver(Observer<?> observer)
- {
- eventManager.removeObserver(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... bindings)
- {
- // Check the event object for template parameters which are not allowed by
- // the spec.
- if (Reflections.isParameterizedType(event.getClass()))
- {
- throw new IllegalArgumentException("Event type " + event.getClass().getName() + " is not allowed because it is a generic");
- }
- // Also check that the binding types are truly binding types
- for (Annotation binding : bindings)
- {
- if (!Reflections.isBindings(binding))
- {
- throw new IllegalArgumentException("Event type " + event.getClass().getName() + " cannot be fired with non-binding type " + binding.getClass().getName() + " specified");
- }
- }
-
- // Get the observers for this event. Although resolveObservers is
- // parameterized, this method is not, so we have to use
- // Observer<Object> for observers.
- Set<Observer<Object>> observers = resolveObservers(event, bindings);
- eventManager.notifyObservers(observers, 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("No active contexts for scope type " + scopeType.getName());
- }
- if (activeContexts.size() > 1)
- {
- throw new IllegalStateException("More than one context active for scope type " + scopeType.getName());
- }
- return activeContexts.iterator().next();
-
- }
-
- public Object getInjectableReference(Bean<?> bean, CreationalContext<?> creationalContext)
- {
- bean = getMostSpecializedBean(bean);
- if (getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal())
- {
- if (creationalContext != null || (creationalContext == null && getContext(bean.getScopeType()).get(bean) != null))
- {
- return clientProxyProvider.getClientProxy(this, bean);
- }
- else
- {
- return null;
- }
- }
- else
- {
- return getContext(bean.getScopeType()).get((Bean) bean, creationalContext);
- }
- }
-
-
- /*
- * TODO this is not correct, as the current implementation of getInstance does not
- * pay attention to what type the resulting instance needs to implement
- */
- public Object getReference(Bean<?> bean, Type beanType)
- {
- return getInjectableReference(bean, CreationalContextImpl.of(bean));
- }
-
- @SuppressWarnings("unchecked")
- public Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
- {
- boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
- try
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().push(injectionPoint);
- }
- AnnotatedItem<?, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]));
- Bean<?> resolvedBean = getBean(element, element.getBindingsAsArray());
- if (getServices().get(MetaDataCache.class).getScopeModel(resolvedBean.getScopeType()).isNormal() && !Proxies.isTypeProxyable(injectionPoint.getType()))
- {
- throw new UnproxyableResolutionException("Attempting to inject an unproxyable normal scoped bean " + resolvedBean + " into " + injectionPoint);
- }
- if (creationalContext instanceof CreationalContextImpl)
- {
- CreationalContextImpl<?> ctx = (CreationalContextImpl<?>) creationalContext;
- if (ctx.containsIncompleteInstance(resolvedBean))
- {
- return ctx.getIncompleteInstance(resolvedBean);
- }
- else
- {
- return getInjectableReference(resolvedBean, ctx.getCreationalContext(resolvedBean));
- }
- }
- else
- {
- return getInjectableReference(resolvedBean, creationalContext);
- }
- }
- finally
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().pop();
- }
- }
- }
-
- /**
- * Returns an instance by API type and binding types
- *
- * @param type The API type to match
- * @param bindings The binding types to match
- * @return An instance of the bean
- *
- * @deprecated replace with non-contextual injection
- *
- */
- @Deprecated
- public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
- {
- AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(type, bindings);
- return (T) getReference(getBean(element, bindings), type);
- }
-
- public <T> Bean<T> getBean(AnnotatedItem<T, ?> element, Annotation... bindings)
- {
- Set<Bean<?>> beans = getBeans(element, bindings);
- if (beans.size() == 0)
- {
- throw new UnsatisfiedResolutionException(element + "Unable to resolve any Web Beans");
- }
- else if (beans.size() > 1)
- {
- throw new AmbiguousResolutionException(element + "Resolved multiple Web Beans");
- }
- Bean<T> bean = (Bean<T>) beans.iterator().next();
- boolean normalScoped = getServices().get(MetaDataCache.class).getScopeModel(bean.getScopeType()).isNormal();
- if (normalScoped && !Beans.isBeanProxyable(bean))
- {
- throw new UnproxyableResolutionException("Normal scoped bean " + bean + " is not proxyable");
- }
- return bean;
- }
-
- public Set<Bean<?>> getBeans(String name)
- {
- return resolver.get(name);
- }
-
- /**
- * Resolves a list of decorators based on API types and binding types Os
- *
- * @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)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * 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)
- {
- throw new UnsupportedOperationException();
- }
-
- /**
- * Get the web bean resolver. For internal use
- *
- * @return The resolver
- */
- public Resolver getResolver()
- {
- return resolver;
- }
-
- /**
- * Gets a string representation
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("Manager\n");
- buffer.append("Enabled deployment types: " + getEnabledDeploymentTypes() + "\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();
- }
-
- public ManagerImpl createActivity()
- {
- ManagerImpl childActivity = newChildManager(this);
- childActivities.add(childActivity);
- CurrentManager.add(childActivity);
- return childActivity;
- }
-
- public ManagerImpl setCurrent(Class<? extends Annotation> scopeType)
- {
- if (!getServices().get(MetaDataCache.class).getScopeModel(scopeType).isNormal())
- {
- throw new IllegalArgumentException("Scope must be a normal scope type " + scopeType);
- }
- currentActivities.add(new CurrentActivity(getContext(scopeType), this));
- return this;
- }
-
- public ManagerImpl getCurrent()
- {
- List<CurrentActivity> activeCurrentActivities = new ArrayList<CurrentActivity>();
- for (CurrentActivity currentActivity : currentActivities)
- {
- if (currentActivity.getContext().isActive())
- {
- activeCurrentActivities.add(currentActivity);
- }
- }
- if (activeCurrentActivities.size() == 0)
- {
- return CurrentManager.rootManager();
- }
- else if (activeCurrentActivities.size() == 1)
- {
- return activeCurrentActivities.get(0).getManager();
- }
- throw new IllegalStateException("More than one current activity for an active context " + currentActivities);
- }
-
- public ServiceRegistry getServices()
- {
- return services;
- }
-
- /**
- * Accesses the factory used to create each instance of InjectionPoint that
- * is injected into web beans.
- *
- * @return the factory
- */
- public InjectionPoint getInjectionPoint()
- {
- if (!currentInjectionPoint.get().empty())
- {
- return currentInjectionPoint.get().peek();
- }
- else
- {
- return null;
- }
- }
-
- /**
- *
- * @return
- */
- public Map<Bean<?>, Bean<?>> getSpecializedBeans()
- {
- // TODO make this unmodifiable after deploy!
- return specializedBeans;
- }
-
- // Serialization
-
- protected Object readResolve()
- {
- return CurrentManager.get(id);
- }
-
- /**
- * Provides access to the executor service used for asynchronous tasks.
- *
- * @return the ExecutorService for this manager
- */
- public ExecutorService getTaskExecutor()
- {
- return taskExecutor;
- }
-
- public void shutdown()
- {
- log.trace("Ending application");
- shutdownExecutors();
- ApplicationContext.instance().destroy();
- ApplicationContext.instance().setActive(false);
- ApplicationContext.instance().setBeanStore(null);
- CurrentManager.cleanup();
- }
-
- /**
- * Shuts down any executor services in the manager.
- */
- protected void shutdownExecutors()
- {
- 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();
- }
- }
-
- protected ClientProxyProvider getClientProxyProvider()
- {
- return clientProxyProvider;
- }
-
- protected ConcurrentListMultiMap<Class<? extends Annotation>, Context> getContexts()
- {
- return contexts;
- }
-
- protected AtomicInteger getIds()
- {
- return ids;
- }
-
- protected Set<CurrentActivity> getCurrentActivities()
- {
- return currentActivities;
- }
-
- public Integer getId()
- {
- return id;
- }
-
- public ConcurrentSetMultiMap<Type, EventObserver<?>> getRegisteredObservers()
- {
- return registeredObservers;
- }
-
- public Namespace getRootNamespace()
- {
- return rootNamespace;
- }
-
-
- public <T> InjectionTarget<T> createInjectionTarget(Class<T> type)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public <T> InjectionTarget<T> createInjectionTarget(AnnotatedType<T> type)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public <T> ManagedBean<T> createManagedBean(Class<T> type)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public <T> ManagedBean<T> createManagedBean(AnnotatedType<T> type)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
-
-
- public <X> Bean<? extends X> getMostSpecializedBean(Bean<X> bean)
- {
- Bean<?> 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 injectionPoint)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
-
- public Set<Annotation> getInterceptorBindingTypeDefinition(
- Class<? extends Annotation> bindingType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public Bean<?> getPassivationCapableBean(String id)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public ScopeType getScopeDefinition(Class<? extends Annotation> scopeType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public Set<Annotation> getStereotypeDefinition(
- Class<? extends Annotation> stereotype)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public boolean isBindingType(Class<? extends Annotation> annotationType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public boolean isInterceptorBindingType(
- Class<? extends Annotation> annotationType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public boolean isScopeType(Class<? extends Annotation> annotationType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public boolean isStereotype(Class<? extends Annotation> annotationType)
- {
- throw new UnsupportedOperationException("Not yet implemented");
- }
-
- public <X> Bean<? extends X> getHighestPrecedenceBean(Set<Bean<? extends X>> beans)
- {
- if (beans.size() == 1)
- {
- return beans.iterator().next();
- }
- else if (beans.isEmpty())
- {
- return null;
- }
-
- // make a copy so that the sort is stable with respect to new deployment types added through the SPI
- // TODO This code needs to be in Resolver
- // TODO This needs caching
- final List<Class<? extends Annotation>> enabledDeploymentTypes = getEnabledDeploymentTypes();
-
- SortedSet<Bean<? extends X>> sortedBeans = new TreeSet<Bean<? extends X>>(new Comparator<Bean<? extends X>>()
- {
- public int compare(Bean<? extends X> o1, Bean<? extends X> o2)
- {
- int diff = enabledDeploymentTypes.indexOf(o1) - enabledDeploymentTypes.indexOf(o2);
- if (diff == 0)
- {
- throw new AmbiguousResolutionException();
- }
- return diff;
- }
- });
- sortedBeans.addAll(beans);
- return sortedBeans.last();
- }
-
- public ELResolver getELResolver()
- {
- return webbeansELResolver;
- }
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -34,7 +34,7 @@
import javax.event.Event;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.DependentInstancesStore;
import org.jboss.webbeans.conversation.ConversationImpl;
@@ -64,7 +64,7 @@
private static final Annotation ANY_BINDING = new AnyLiteral();
@SuppressWarnings("unchecked")
- private static Set<Class<?>> STANDARD_WEB_BEAN_CLASSES = new HashSet<Class<?>>(Arrays.asList(Event.class, ManagerImpl.class, ConversationImpl.class));
+ private static Set<Class<?>> STANDARD_WEB_BEAN_CLASSES = new HashSet<Class<?>>(Arrays.asList(Event.class, BeanManagerImpl.class, ConversationImpl.class));
private boolean proxyable;
@@ -114,7 +114,7 @@
// If the type a primitive?
private boolean primitive;
// The Web Beans manager
- protected ManagerImpl manager;
+ protected BeanManagerImpl manager;
protected boolean _serializable;
@@ -130,7 +130,7 @@
*
* @param manager The Web Beans manager
*/
- public AbstractBean(ManagerImpl manager)
+ public AbstractBean(BeanManagerImpl manager)
{
super(manager);
this.manager = manager;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -32,7 +32,7 @@
import javax.event.Observes;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.FieldInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
@@ -74,7 +74,7 @@
* @param type The type
* @param manager The Web Beans manager
*/
- protected AbstractClassBean(AnnotatedClass<T> type, ManagerImpl manager)
+ protected AbstractClassBean(AnnotatedClass<T> type, BeanManagerImpl manager)
{
super(manager);
this.annotatedItem = type;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -38,7 +38,7 @@
import javax.enterprise.inject.spi.InjectionPoint;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.CreationalContextImpl;
import org.jboss.webbeans.context.DependentContext;
@@ -72,7 +72,7 @@
* @param declaringBean The declaring bean
* @param manager The Web Beans manager
*/
- public AbstractProducerBean(AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public AbstractProducerBean(AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
super(manager);
this.declaringBean = declaringBean;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -33,7 +33,7 @@
import javax.event.Observes;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
@@ -53,7 +53,7 @@
protected Set<AnnotatedInjectionPoint<?, ?>> disposalInjectionPoints;
private final String id;
- protected DisposalMethodBean(ManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
+ protected DisposalMethodBean(BeanManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
{
super(manager);
this.disposalMethodInjectionPoint = MethodInjectionPoint.of(this, disposalMethod);
@@ -79,7 +79,7 @@
return disposalMethodInjectionPoint;
}
- public static <T> DisposalMethodBean<T> of(ManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
+ public static <T> DisposalMethodBean<T> of(BeanManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
{
return new DisposalMethodBean<T>(manager, disposalMethod, declaringBean);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -34,7 +34,7 @@
import javax.inject.DefinitionException;
import javax.interceptor.Interceptor;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.proxy.EnterpriseBeanInstance;
import org.jboss.webbeans.bean.proxy.EnterpriseBeanProxyMethodHandler;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
@@ -76,7 +76,7 @@
* @param manager the current manager
* @return An Enterprise Web Bean
*/
- public static <T> EnterpriseBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager, BeanDeployerEnvironment environment)
+ public static <T> EnterpriseBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
return new EnterpriseBean<T>(clazz, manager, environment);
}
@@ -87,7 +87,7 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- protected EnterpriseBean(AnnotatedClass<T> type, ManagerImpl manager, BeanDeployerEnvironment environment)
+ protected EnterpriseBean(AnnotatedClass<T> type, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
super(type, manager);
initType();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.deployment.Standard;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.literal.NewLiteral;
@@ -45,7 +45,7 @@
* @param manager The Web Beans manager
* @return a new NewEnterpriseBean instance
*/
- public static <T> NewEnterpriseBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager, BeanDeployerEnvironment environment)
+ public static <T> NewEnterpriseBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
return new NewEnterpriseBean<T>(clazz, manager, environment);
}
@@ -56,7 +56,7 @@
* @param type An annotated class
* @param manager The Web Beans manager
*/
- protected NewEnterpriseBean(AnnotatedClass<T> type, ManagerImpl manager, BeanDeployerEnvironment environment)
+ protected NewEnterpriseBean(AnnotatedClass<T> type, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
super(type, manager, environment);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.deployment.Standard;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.literal.NewLiteral;
@@ -44,7 +44,7 @@
* @param manager The Web Beans manager
* @return a new NewSimpleBean instance
*/
- public static <T> NewSimpleBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager)
+ public static <T> NewSimpleBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager)
{
return new NewSimpleBean<T>(clazz, manager);
}
@@ -55,7 +55,7 @@
* @param type An annotated class
* @param manager The Web Beans manager
*/
- protected NewSimpleBean(AnnotatedClass<T> type, ManagerImpl manager)
+ protected NewSimpleBean(AnnotatedClass<T> type, BeanManagerImpl manager)
{
super(type, manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -20,7 +20,7 @@
import javax.enterprise.context.spi.CreationalContext;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.util.Names;
@@ -46,7 +46,7 @@
* @param manager the current manager
* @return A producer Web Bean
*/
- public static <T> ProducerFieldBean<T> of(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public static <T> ProducerFieldBean<T> of(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
return new ProducerFieldBean<T>(field, declaringBean, manager);
}
@@ -58,7 +58,7 @@
* @param declaringBean The declaring bean
* @param manager The Web Beans manager
*/
- protected ProducerFieldBean(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ protected ProducerFieldBean(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
super(declaringBean, manager);
this.field = field;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -27,7 +27,7 @@
import javax.event.Observes;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.context.DependentStorageRequest;
@@ -63,12 +63,12 @@
* @param manager the current manager
* @return A producer Web Bean
*/
- public static <T> ProducerMethodBean<T> of(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public static <T> ProducerMethodBean<T> of(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
return new ProducerMethodBean<T>(method, declaringBean, manager);
}
- protected ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ protected ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
super(declaringBean, manager);
this.method = MethodInjectionPoint.of(this, method);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
@@ -39,9 +39,9 @@
private static final ConcurrentMap<String, AtomicInteger> ids = new ConcurrentHashMap<String, AtomicInteger>();
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
- protected RIBean(ManagerImpl manager)
+ protected RIBean(BeanManagerImpl manager)
{
this.manager = manager;
// TODO better ID strategy (human readable)
@@ -53,7 +53,7 @@
return prefix + "-" + i;
}
- protected ManagerImpl getManager()
+ protected BeanManagerImpl getManager()
{
return manager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -26,7 +26,7 @@
import javax.enterprise.inject.Initializer;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.context.DependentStorageRequest;
@@ -84,7 +84,7 @@
* @param manager the current manager
* @return A Web Bean
*/
- public static <T> SimpleBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager)
+ public static <T> SimpleBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager)
{
return new SimpleBean<T>(clazz, manager);
}
@@ -95,7 +95,7 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- protected SimpleBean(AnnotatedClass<T> type, ManagerImpl manager)
+ protected SimpleBean(AnnotatedClass<T> type, BeanManagerImpl manager)
{
super(type, manager);
initType();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -31,7 +31,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.deployment.Production;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
@@ -66,7 +66,7 @@
* @param bindings the bindings of bean
* @param type the concrete type of the bean
*/
- protected AbstractJavaEEResourceBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type)
+ protected AbstractJavaEEResourceBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type)
{
this(manager, deploymentType, bindings, type, type);
}
@@ -77,7 +77,7 @@
* @param bindings the bindings of bean
* @param type the concrete type of the bean
*/
- protected AbstractJavaEEResourceBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, Type... types)
+ protected AbstractJavaEEResourceBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, Type... types)
{
super(manager);
if (deploymentType != null)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractResourceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractResourceBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractResourceBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -20,7 +20,7 @@
import java.lang.reflect.Type;
import java.util.Set;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -31,7 +31,7 @@
private final String jndiName;
private final String mappedName;
- protected AbstractResourceBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, Type... types)
+ protected AbstractResourceBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, Type... types)
{
super(manager, deploymentType, bindings, type, types);
this.jndiName = jndiName;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceContextBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceContextBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceContextBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -23,7 +23,7 @@
import javax.persistence.EntityManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -35,7 +35,7 @@
private final String id;
private final String unitName;
- public PersistenceContextBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String unitName)
+ public PersistenceContextBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String unitName)
{
super(manager, deploymentType, bindings, EntityManager.class);
this.unitName = unitName;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceUnitBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceUnitBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/PersistenceUnitBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -23,7 +23,7 @@
import javax.persistence.EntityManagerFactory;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -35,7 +35,7 @@
private final String id;
private final String unitName;
- public PersistenceUnitBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String unitName)
+ public PersistenceUnitBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String unitName)
{
super(manager, deploymentType, bindings, EntityManagerFactory.class);
this.unitName = unitName;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/RemoteEjbBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/RemoteEjbBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/RemoteEjbBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -21,7 +21,7 @@
import javassist.util.proxy.MethodHandler;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -33,7 +33,7 @@
private final String id;
private final String ejbLink;
- public RemoteEjbBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, String ejbLink)
+ public RemoteEjbBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, String ejbLink)
{
super(manager, deploymentType, bindings, type, jndiName, mappedName, type);
this.ejbLink = ejbLink;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/ResourceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/ResourceBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/ResourceBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -21,7 +21,7 @@
import javassist.util.proxy.MethodHandler;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -32,7 +32,7 @@
private final String id;
- public ResourceBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName)
+ public ResourceBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName)
{
super(manager, deploymentType, bindings, type, jndiName, mappedName, type);
this.id = createId("Resource-");
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/WebServiceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/WebServiceBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/WebServiceBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -21,7 +21,7 @@
import javassist.util.proxy.MethodHandler;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* @author Pete Muir
@@ -33,7 +33,7 @@
private final String id;
private final String wsdlLocation;
- public WebServiceBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, String wsdlLocation)
+ public WebServiceBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, Class<T> type, String jndiName, String mappedName, String wsdlLocation)
{
super(manager, deploymentType, bindings, type, jndiName, mappedName, type);
this.wsdlLocation = wsdlLocation;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsQueueBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -26,7 +26,7 @@
import javax.jms.QueueSender;
import javax.jms.QueueSession;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.ee.AbstractResourceBean;
@@ -47,7 +47,7 @@
* @param bindings
* @param type
*/
- public JmsQueueBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String jndiName, String mappedName)
+ public JmsQueueBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String jndiName, String mappedName)
{
super(manager,
deploymentType,
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/jms/JmsTopicBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -26,7 +26,7 @@
import javax.jms.TopicPublisher;
import javax.jms.TopicSession;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.ee.AbstractResourceBean;
/**
@@ -46,7 +46,7 @@
* @param bindings
* @param type
*/
- public JmsTopicBean(ManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String jndiName, String mappedName)
+ public JmsTopicBean(BeanManagerImpl manager, Class<? extends Annotation> deploymentType, Set<Annotation> bindings, String jndiName, String mappedName)
{
super(manager,
deploymentType,
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyMethodHandler.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.enterprise.context.spi.Context;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.CreationalContextImpl;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -50,7 +50,7 @@
// The bean index in the manager
private final int beanIndex;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
private static final ThreadLocal<CreationalContextImpl<?>> currentCreationalContext = new ThreadLocal<CreationalContextImpl<?>>();
@@ -60,7 +60,7 @@
* @param bean The bean to proxy
* @param beanIndex The index to the bean in the manager bean list
*/
- public ClientProxyMethodHandler(Bean<?> bean, ManagerImpl manager, int beanIndex)
+ public ClientProxyMethodHandler(Bean<?> bean, BeanManagerImpl manager, int beanIndex)
{
this.bean = bean;
this.beanIndex = beanIndex;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyProvider.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyProvider.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/proxy/ClientProxyProvider.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -27,7 +27,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.collections.ConcurrentCache;
@@ -70,7 +70,7 @@
* @throws InstantiationException When the proxy couldn't be created
* @throws IllegalAccessException When the proxy couldn't be created
*/
- private static <T> T createClientProxy(Bean<T> bean, ManagerImpl manager, int beanIndex) throws RuntimeException
+ private static <T> T createClientProxy(Bean<T> bean, BeanManagerImpl manager, int beanIndex) throws RuntimeException
{
try
@@ -106,7 +106,7 @@
* @param bean The bean to get a proxy to
* @return the client proxy for the bean
*/
- public <T> T getClientProxy(final ManagerImpl manager, final Bean<T> bean)
+ public <T> T getClientProxy(final BeanManagerImpl manager, final Bean<T> bean)
{
return pool.putIfAbsent(bean, new Callable<T>()
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
@@ -35,7 +35,7 @@
private static final Log log = Logging.getLog(AbstractFacadeBean.class);
- protected AbstractFacadeBean(ManagerImpl manager)
+ protected AbstractFacadeBean(BeanManagerImpl manager)
{
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.deployment.Standard;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
@@ -40,7 +40,7 @@
private final String id;
- protected AbstractStandardBean(ManagerImpl manager)
+ protected AbstractStandardBean(BeanManagerImpl manager)
{
super(manager);
this.id = getClass().getSimpleName();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -26,7 +26,7 @@
import javax.event.Event;
import javax.inject.Obtains;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.injection.resolution.AnnotatedItemTransformer;
import org.jboss.webbeans.literal.AnyLiteral;
@@ -42,12 +42,12 @@
private static final Set<Class<? extends Annotation>> FILTERED_ANNOTATION_TYPES = new HashSet<Class<? extends Annotation>>(Arrays.asList(Obtains.class));
- public static AbstractFacadeBean<Event<?>> of(ManagerImpl manager)
+ public static AbstractFacadeBean<Event<?>> of(BeanManagerImpl manager)
{
return new EventBean(manager);
}
- protected EventBean(ManagerImpl manager)
+ protected EventBean(BeanManagerImpl manager)
{
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* Bean for InjectionPoint metadata
@@ -47,12 +47,12 @@
* @param manager The RI manager implementation
* @return a new bean for this injection point
*/
- public static InjectionPointBean of(ManagerImpl manager)
+ public static InjectionPointBean of(BeanManagerImpl manager)
{
return new InjectionPointBean(manager);
}
- protected InjectionPointBean(ManagerImpl manager)
+ protected InjectionPointBean(BeanManagerImpl manager)
{
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -27,7 +27,7 @@
import javax.inject.Obtains;
import org.jboss.webbeans.InstanceImpl;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.injection.resolution.AnnotatedItemTransformer;
import org.jboss.webbeans.literal.ObtainsLiteral;
@@ -42,12 +42,12 @@
public static final AnnotatedItemTransformer TRANSFORMER = new FacadeBeanAnnotatedItemTransformer(TYPE, OBTAINS);
- public static AbstractFacadeBean<Instance<?>> of(ManagerImpl manager)
+ public static AbstractFacadeBean<Instance<?>> of(BeanManagerImpl manager)
{
return new InstanceBean(manager);
}
- protected InstanceBean(ManagerImpl manager)
+ protected InstanceBean(BeanManagerImpl manager)
{
super(manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,32 +24,32 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.BeanManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
-public class ManagerBean extends AbstractStandardBean<ManagerImpl>
+public class ManagerBean extends AbstractStandardBean<BeanManagerImpl>
{
- private static final Set<Type> TYPES = new HashSet<Type>(Arrays.asList(ManagerImpl.class, BeanManager.class));
+ private static final Set<Type> TYPES = new HashSet<Type>(Arrays.asList(BeanManagerImpl.class, BeanManager.class));
- public static final ManagerBean of(ManagerImpl manager)
+ public static final ManagerBean of(BeanManagerImpl manager)
{
return new ManagerBean(manager);
}
- protected ManagerBean(ManagerImpl manager)
+ protected ManagerBean(BeanManagerImpl manager)
{
super(manager);
}
- public ManagerImpl create(CreationalContext<ManagerImpl> creationalContext)
+ public BeanManagerImpl create(CreationalContext<BeanManagerImpl> creationalContext)
{
return getManager().getCurrent();
}
@Override
- public Class<ManagerImpl> getType()
+ public Class<BeanManagerImpl> getType()
{
- return ManagerImpl.class;
+ return BeanManagerImpl.class;
}
public Set<Type> getTypes()
@@ -57,7 +57,7 @@
return TYPES;
}
- public void destroy(ManagerImpl instance, CreationalContext<ManagerImpl> creationalContext)
+ public void destroy(BeanManagerImpl instance, CreationalContext<BeanManagerImpl> creationalContext)
{
// No-op
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -30,7 +30,7 @@
import javax.event.Observes;
import javax.inject.Realizes;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.AbstractClassBean;
import org.jboss.webbeans.bean.DisposalMethodBean;
import org.jboss.webbeans.bean.EnterpriseBean;
@@ -64,11 +64,11 @@
private final BeanDeployerEnvironment environment;
private final Set<AnnotatedClass<?>> classes;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
private final ClassTransformer classTransformer;
- public BeanDeployer(ManagerImpl manager, EjbDescriptorCache ejbDescriptors)
+ public BeanDeployer(BeanManagerImpl manager, EjbDescriptorCache ejbDescriptors)
{
this.manager = manager;
this.environment = new BeanDeployerEnvironment(ejbDescriptors);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -22,7 +22,7 @@
import org.jboss.webbeans.BeanValidator;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.ee.AbstractJavaEEResourceBean;
import org.jboss.webbeans.bean.standard.EventBean;
import org.jboss.webbeans.bean.standard.InjectionPointBean;
@@ -87,7 +87,7 @@
}
// The Web Beans manager
- private ManagerImpl manager;
+ private BeanManagerImpl manager;
public WebBeansBootstrap()
{
// initialize default services
@@ -124,7 +124,7 @@
}
addImplementationServices();
createContexts();
- this.manager = ManagerImpl.newRootManager(ServiceRegistries.unmodifiableServiceRegistry(getServices()));
+ this.manager = BeanManagerImpl.newRootManager(ServiceRegistries.unmodifiableServiceRegistry(getServices()));
CurrentManager.setRootManager(manager);
initializeContexts();
}
@@ -142,7 +142,7 @@
getServices().add(MetaDataCache.class, new MetaDataCache(getServices().get(ClassTransformer.class)));
}
- public ManagerImpl getManager()
+ public BeanManagerImpl getManager()
{
return manager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/el/WebBeansELResolverImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.inject.ExecutionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* An EL-resolver against the named beans
@@ -51,9 +51,9 @@
}
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
- public WebBeansELResolverImpl(ManagerImpl manager)
+ public WebBeansELResolverImpl(BeanManagerImpl manager)
{
this.manager = manager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.event.Observer;
import org.jboss.webbeans.FacadeImpl;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.util.Strings;
@@ -41,7 +41,7 @@
private static final long serialVersionUID = 656782657242515455L;
- public static <E> Event<E> of(Type eventType, ManagerImpl manager, Set<Annotation> bindings)
+ public static <E> Event<E> of(Type eventType, BeanManagerImpl manager, Set<Annotation> bindings)
{
return new EventImpl<E>(eventType, manager, bindings);
}
@@ -54,7 +54,7 @@
* @param manager The Web Beans manager
* @param bindings The binding types
*/
- public EventImpl(Type eventType, ManagerImpl manager, Set<Annotation> bindings)
+ public EventImpl(Type eventType, BeanManagerImpl manager, Set<Annotation> bindings)
{
super(eventType, manager, removeBindings(bindings, new AnyLiteral()));
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventManager.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.event.Observer;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
@@ -41,13 +41,13 @@
{
private static Log log = Logging.getLog(EventManager.class);
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
/**
* Initializes a new instance of the EventManager.
*/
- public EventManager(ManagerImpl manager)
+ public EventManager(BeanManagerImpl manager)
{
this.manager = manager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventObserver.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.event.Observer;
import javax.inject.DuplicateBindingTypeException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.metadata.MetaDataCache;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Strings;
@@ -49,7 +49,7 @@
private final Type eventType;
private final List<Annotation> eventBindings;
private final Observer<T> observer;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
/**
* Constructs a new wrapper for an observer.
@@ -58,7 +58,7 @@
* @param eventType The class of event being observed
* @param eventBindings The array of annotation event bindings, if any
*/
- public EventObserver(final Observer<T> observer, final Type eventType, ManagerImpl manager, final Annotation... eventBindings)
+ public EventObserver(final Observer<T> observer, final Type eventType, BeanManagerImpl manager, final Annotation... eventBindings)
{
this.observer = observer;
this.eventType = eventType;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -16,7 +16,7 @@
*/
package org.jboss.webbeans.event;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.AbstractClassBean;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.transaction.spi.TransactionServices;
@@ -37,7 +37,7 @@
* @param manager The Web Beans manager
* @return An observer implementation built from the method abstraction
*/
- public static <T> ObserverImpl<T> create(AnnotatedMethod<?> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public static <T> ObserverImpl<T> create(AnnotatedMethod<?> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
ObserverImpl<T> result = null;
if (manager.getServices().contains(TransactionServices.class) && TransactionalObserverImpl.isObserverMethodTransactional(method))
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -34,7 +34,7 @@
import javax.event.Observes;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.context.CreationalContextImpl;
import org.jboss.webbeans.context.DependentContext;
@@ -62,7 +62,7 @@
protected final MethodInjectionPoint<?> observerMethod;
private final boolean conditional;
private final boolean asynchronous;
- protected ManagerImpl manager;
+ protected BeanManagerImpl manager;
private final Type eventType;
private final Annotation[] bindings;
@@ -74,7 +74,7 @@
* @param observerBean The observer bean
* @param manager The Web Beans manager
*/
- protected ObserverImpl(final AnnotatedMethod<?> observer, final RIBean<?> observerBean, final ManagerImpl manager)
+ protected ObserverImpl(final AnnotatedMethod<?> observer, final RIBean<?> observerBean, final BeanManagerImpl manager)
{
this.manager = manager;
this.observerBean = observerBean;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -27,7 +27,7 @@
import javax.inject.DefinitionException;
import javax.transaction.Synchronization;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.transaction.spi.TransactionServices;
@@ -72,7 +72,7 @@
* @param observerBean The bean declaring the observer method
* @param manager The JCDI manager in use
*/
- protected TransactionalObserverImpl(AnnotatedMethod<?> observer, RIBean<?> observerBean, ManagerImpl manager)
+ protected TransactionalObserverImpl(AnnotatedMethod<?> observer, RIBean<?> observerBean, BeanManagerImpl manager)
{
super(observer, observerBean, manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -30,7 +30,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.ForwardingAnnotatedConstructor;
@@ -96,7 +96,7 @@
return delegate().getBindings();
}
- public T newInstance(ManagerImpl manager, CreationalContext<?> creationalContext)
+ public T newInstance(BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
try
{
@@ -156,7 +156,7 @@
* @param manager The Web Beans manager
* @return The object array of looked up values
*/
- protected Object[] getParameterValues(List<ParameterInjectionPoint<?>> parameters, Object specialVal, Class<? extends Annotation> specialParam, ManagerImpl manager, CreationalContext<?> creationalContext)
+ protected Object[] getParameterValues(List<ParameterInjectionPoint<?>> parameters, Object specialVal, Class<? extends Annotation> specialParam, BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
Object[] parameterValues = new Object[parameters.size()];
Iterator<ParameterInjectionPoint<?>> iterator = parameters.iterator();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -25,7 +25,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.ForwardingAnnotatedField;
@@ -69,7 +69,7 @@
return delegate().getAnnotationStore().getBindings();
}
- public void inject(Object declaringInstance, ManagerImpl manager, CreationalContext<?> creationalContext)
+ public void inject(Object declaringInstance, BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
try
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -29,7 +29,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.ForwardingAnnotatedMethod;
@@ -95,7 +95,7 @@
return delegate().getBindings();
}
- public T invoke(Object declaringInstance, ManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
+ public T invoke(Object declaringInstance, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
try
{
@@ -117,7 +117,7 @@
}
@SuppressWarnings("unchecked")
- public T invokeWithSpecialValue(Object declaringInstance, Class<? extends Annotation> annotatedParameter, Object parameter, ManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
+ public T invokeWithSpecialValue(Object declaringInstance, Class<? extends Annotation> annotatedParameter, Object parameter, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
try
{
@@ -138,7 +138,7 @@
return null;
}
- public T invokeOnInstance(Object declaringInstance, ManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
+ public T invokeOnInstance(Object declaringInstance, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
try
{
@@ -168,7 +168,7 @@
}
@SuppressWarnings("unchecked")
- public T invokeOnInstanceWithSpecialValue(Object declaringInstance, Class<? extends Annotation> annotatedParameter, Object parameter, ManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
+ public T invokeOnInstanceWithSpecialValue(Object declaringInstance, Class<? extends Annotation> annotatedParameter, Object parameter, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
try
{
@@ -247,7 +247,7 @@
* @param manager The Web Beans manager
* @return The object array of looked up values
*/
- protected Object[] getParameterValues(List<ParameterInjectionPoint<?>> parameters, Class<? extends Annotation> specialParam, Object specialVal, ManagerImpl manager, CreationalContext<?> creationalContext)
+ protected Object[] getParameterValues(List<ParameterInjectionPoint<?>> parameters, Class<? extends Annotation> specialParam, Object specialVal, BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
Object[] parameterValues = new Object[parameters.size()];
Iterator<ParameterInjectionPoint<?>> iterator = parameters.iterator();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -28,7 +28,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.ApplicationContext;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.resources.ClassTransformer;
@@ -41,9 +41,9 @@
private final Bean<?> nonContextualBean;
private final ConcurrentCache<Class<?>, Set<FieldInjectionPoint<?>>> instances;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
- public NonContextualInjector(ManagerImpl manager)
+ public NonContextualInjector(BeanManagerImpl manager)
{
this.instances = new ConcurrentCache<Class<?>, Set<FieldInjectionPoint<?>>>();
this.manager = manager;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -23,7 +23,7 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.ForwardingAnnotatedParameter;
@@ -78,7 +78,7 @@
}
@SuppressWarnings("unchecked")
- public T getValueToInject(ManagerImpl manager, CreationalContext<?> creationalContext)
+ public T getValueToInject(BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
return (T) manager.getInjectableReference(this, creationalContext);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -29,7 +29,7 @@
import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.standard.EventBean;
import org.jboss.webbeans.bean.standard.InstanceBean;
import org.jboss.webbeans.introspector.AnnotatedItem;
@@ -56,14 +56,14 @@
// The resolved names
private ConcurrentCache<String, Set<Bean<?>>> resolvedNames;
// The Web Beans manager
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
private final Set<AnnotatedItemTransformer> transformers;
/**
* Constructor
*
*/
- public Resolver(ManagerImpl manager)
+ public Resolver(BeanManagerImpl manager)
{
this.manager = manager;
this.injectionPoints = new HashSet<AnnotatedItem<?, ?>>();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import java.util.Collections;
import java.util.List;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.AnnotatedType;
@@ -183,7 +183,7 @@
* @throws InstantiationException
* @throws IllegalArgumentException
*
- * @see org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(ManagerImpl)
+ * @see org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(BeanManagerImpl)
*/
public T newInstance(Object... parameters) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/MergedStereotypes.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -22,7 +22,7 @@
import java.util.Map;
import java.util.Set;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
/**
* Meta model for the merged stereotype for a bean
@@ -42,14 +42,14 @@
// The supported scopes
private final Set<Class<? extends Annotation>> supportedScopes;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
/**
* Constructor
*
* @param stereotypeAnnotations The stereotypes to merge
*/
- public MergedStereotypes(Set<Annotation> stereotypeAnnotations, ManagerImpl manager)
+ public MergedStereotypes(Set<Annotation> stereotypeAnnotations, BeanManagerImpl manager)
{
this.possibleDeploymentTypes = new HashMap<Class<? extends Annotation>, Annotation>();
this.possibleScopeTypes = new HashSet<Annotation>();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -24,7 +24,7 @@
import javax.enterprise.inject.spi.Bean;
import javax.inject.DefinitionException;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.injection.FieldInjectionPoint;
@@ -47,7 +47,7 @@
* @param bean The bean to inspect
* @return True if passivating, false otherwise
*/
- public static boolean isPassivatingBean(Bean<?> bean, ManagerImpl manager)
+ public static boolean isPassivatingBean(Bean<?> bean, BeanManagerImpl manager)
{
if (bean instanceof EnterpriseBean)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlEnvironment.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlEnvironment.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlEnvironment.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -23,7 +23,7 @@
import java.util.List;
import java.util.Set;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.ee.AbstractJavaEEResourceBean;
import org.jboss.webbeans.bootstrap.api.ServiceRegistry;
import org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery;
@@ -43,14 +43,14 @@
private final Iterable<URL> beansXmlUrls;
private final EjbDescriptorCache ejbDescriptors;
private final Set<AbstractJavaEEResourceBean<?>> resourceBeans;
- private final ManagerImpl manager;
+ private final BeanManagerImpl manager;
- public XmlEnvironment(ServiceRegistry serviceRegistry, EjbDescriptorCache ejbDescriptors, ManagerImpl manager)
+ public XmlEnvironment(ServiceRegistry serviceRegistry, EjbDescriptorCache ejbDescriptors, BeanManagerImpl manager)
{
this(serviceRegistry, serviceRegistry.get(WebBeanDiscovery.class).discoverWebBeansXml(), ejbDescriptors, manager);
}
- protected XmlEnvironment(ServiceRegistry serviceRegistry, Iterable<URL> beanXmlUrls, EjbDescriptorCache ejbDescriptors, ManagerImpl manager)
+ protected XmlEnvironment(ServiceRegistry serviceRegistry, Iterable<URL> beanXmlUrls, EjbDescriptorCache ejbDescriptors, BeanManagerImpl manager)
{
this.classes = new ArrayList<AnnotatedClass<?>>();
this.annotations = new ArrayList<AnnotatedAnnotation<?>>();
@@ -116,7 +116,7 @@
return resourceBeans;
}
- public ManagerImpl getManager()
+ public BeanManagerImpl getManager()
{
return manager;
}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -18,7 +18,7 @@
import org.jboss.testharness.AbstractTest;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.mock.el.EL;
import org.jboss.webbeans.util.EnumerationIterable;
@@ -62,7 +62,7 @@
protected static final int BUILT_IN_BEANS = 3;
- private ManagerImpl manager;
+ private BeanManagerImpl manager;
public static boolean visited = false;
@@ -136,7 +136,7 @@
return in.readObject();
}
- protected ManagerImpl getCurrentManager()
+ protected BeanManagerImpl getCurrentManager()
{
return manager;
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -9,7 +9,7 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bean.SimpleBean;
import org.jboss.webbeans.mock.MockServletLifecycle;
@@ -22,7 +22,7 @@
{
private MockServletLifecycle lifecycle;
- private ManagerImpl manager;
+ private BeanManagerImpl manager;
@BeforeClass
public void beforeClass() throws Throwable
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/event/SimpleEventTest.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -6,7 +6,7 @@
import javax.event.Observes;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
@@ -42,7 +42,7 @@
@Test
public void testEventUsingManager()
{
- ManagerImpl manager = getCurrentManager();
+ BeanManagerImpl manager = getCurrentManager();
manager.fireEvent("Fired using Manager Interface with AnnotationLiteral.",
new AnnotationLiteral<Updated>(){});
@@ -61,7 +61,7 @@
@Test
public void testEventUsingEvent()
{
- ManagerImpl manager = getCurrentManager();
+ BeanManagerImpl manager = getCurrentManager();
App app = manager.getInstanceByType(App.class);
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/manager/ManagerTest.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -14,7 +14,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.literal.CurrentLiteral;
import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@@ -100,7 +100,7 @@
public void testRootManagerSerializability() throws Exception
{
Integer rootManagerId = getCurrentManager().getId();
- ManagerImpl deserializedRootManager = (ManagerImpl) deserialize(serialize(getCurrentManager()));
+ BeanManagerImpl deserializedRootManager = (BeanManagerImpl) deserialize(serialize(getCurrentManager()));
assert deserializedRootManager.getId().equals(rootManagerId);
assert getCurrentManager().getBeans(Foo.class).size() == 1;
assert deserializedRootManager.getBeans(Foo.class).size() == 1;
@@ -110,11 +110,11 @@
@Test
public void testChildManagerSerializability() throws Exception
{
- ManagerImpl childManager = getCurrentManager().createActivity();
+ BeanManagerImpl childManager = getCurrentManager().createActivity();
Bean<?> dummyBean = new DummyBean();
childManager.addBean(dummyBean);
Integer childManagerId = childManager.getId();
- ManagerImpl deserializedChildManager = (ManagerImpl) deserialize(serialize(childManager));
+ BeanManagerImpl deserializedChildManager = (BeanManagerImpl) deserialize(serialize(childManager));
assert deserializedChildManager.getId().equals(childManagerId);
assert childManager.getBeans(Dummy.class).size() == 1;
assert deserializedChildManager.getBeans(Dummy.class).size() == 1;
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java 2009-06-09 14:47:32 UTC (rev 2797)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/xml/parser/XmlParserImplTest.java 2009-06-09 14:49:53 UTC (rev 2798)
@@ -12,7 +12,7 @@
import org.jboss.testharness.impl.packaging.Classes;
import org.jboss.testharness.impl.packaging.Resource;
import org.jboss.testharness.impl.packaging.Resources;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedItem;
@@ -64,7 +64,7 @@
XmlParser parser = new XmlParser(parserEnv);
parser.parse();
- ManagerImpl manager = parserEnv.getManager();
+ BeanManagerImpl manager = parserEnv.getManager();
Set<Bean<?>> beansSet = manager.getBeans(Order.class);
List<Class<? extends Annotation>> dTypes = manager.getEnabledDeploymentTypes();
More information about the weld-commits
mailing list