[webbeans-commits] Webbeans SVN: r2279 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: danielc.roth
Date: 2009-03-31 03:38:18 -0400 (Tue, 31 Mar 2009)
New Revision: 2279
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
Log:
Initial Disposal Method commit
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java 2009-03-31 03:54:17 UTC (rev 2278)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java 2009-03-31 07:38:18 UTC (rev 2279)
@@ -1,1043 +1,1044 @@
-/*
- * 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.InputStream;
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-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.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Stack;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import javax.context.Context;
-import javax.context.ContextNotActiveException;
-import javax.context.CreationalContext;
-import javax.event.Observer;
-import javax.inject.AmbiguousDependencyException;
-import javax.inject.BindingType;
-import javax.inject.DeploymentException;
-import javax.inject.DuplicateBindingTypeException;
-import javax.inject.Production;
-import javax.inject.Standard;
-import javax.inject.TypeLiteral;
-import javax.inject.UnproxyableDependencyException;
-import javax.inject.UnsatisfiedDependencyException;
-import javax.inject.manager.Bean;
-import javax.inject.manager.Decorator;
-import javax.inject.manager.InjectionPoint;
-import javax.inject.manager.InterceptionType;
-import javax.inject.manager.Interceptor;
-import javax.inject.manager.Manager;
-
-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.ContextMap;
-import org.jboss.webbeans.context.CreationalContextImpl;
-import org.jboss.webbeans.ejb.EjbDescriptorCache;
-import org.jboss.webbeans.event.EventManager;
-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.introspector.AnnotatedMethod;
-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.resources.spi.NamingContext;
-import org.jboss.webbeans.util.Beans;
-import org.jboss.webbeans.util.Reflections;
-
-/**
- * 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 RootManager implements WebBeansManager, Serializable
-{
-
- private static final Log log = Logging.getLog(RootManager.class);
-
- private static final long serialVersionUID = 3021562879133838561L;
-
- // The JNDI key to place the manager under
- public static final String JNDI_KEY = "java:app/Manager";
-
- // The enabled deployment types from web-beans.xml
- private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
- // The Web Beans event manager
- private transient final EventManager eventManager;
-
- // An executor service for asynchronous tasks
- private transient final ExecutorService taskExecutor = Executors.newSingleThreadExecutor();
-
- // An injection point metadata beans factory
- private transient final ThreadLocal<Stack<InjectionPoint>> currentInjectionPoint;
-
- // The bean resolver
- private transient final Resolver resolver;
-
- // The registered contexts
- private transient final ContextMap contextMap;
- // The client proxy pool
- private transient final ClientProxyProvider clientProxyProvider;
- // The registered beans
- private transient List<Bean<?>> beans;
- // The registered beans, mapped by implementation class
- private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeanMap;
-
- private transient final Map<String, RIBean<?>> riBeans;
-
- // The registered decorators
- private transient final Set<Decorator> decorators;
- // The registered interceptors
- private transient final Set<Interceptor> interceptors;
-
- // The EJB resolver provided by the container
- private transient final ServiceRegistry simpleServiceRegistry;
-
- private transient final EjbDescriptorCache ejbDescriptorCache;
-
- private final transient Map<Bean<?>, Bean<?>> specializedBeans;
-
- private final transient NonContextualInjector nonContextualInjector;
-
- /**
- * Create a new manager
- *
- * @param ejbServices
- * the ejbResolver to use
- */
- public RootManager(ServiceRegistry simpleServiceRegistry)
- {
- this.simpleServiceRegistry = simpleServiceRegistry;
- this.beans = new CopyOnWriteArrayList<Bean<?>>();
- this.newEnterpriseBeanMap = new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>();
- this.riBeans = new ConcurrentHashMap<String, RIBean<?>>();
- this.resolver = new Resolver(this);
- this.clientProxyProvider = new ClientProxyProvider();
- this.decorators = new HashSet<Decorator>();
- this.interceptors = new HashSet<Interceptor>();
- this.contextMap = new ContextMap();
- this.eventManager = new EventManager();
- this.ejbDescriptorCache = new EjbDescriptorCache();
- this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
- {
- @Override
- protected Stack<InjectionPoint> initialValue()
- {
- return new Stack<InjectionPoint>();
- }
- };
- this.specializedBeans = new HashMap<Bean<?>, Bean<?>>();
- this.nonContextualInjector = new NonContextualInjector(this);
- List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
- defaultEnabledDeploymentTypes.add(0, Standard.class);
- defaultEnabledDeploymentTypes.add(1, Production.class);
- setEnabledDeploymentTypes(defaultEnabledDeploymentTypes);
- }
-
- /**
- * 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.inject.manager.Manager#addBean(javax.inject.manager.Bean)
- */
- public Manager addBean(Bean<?> bean)
- {
- if (beans.contains(bean))
- {
- return this;
- }
- resolver.clear();
- beans.add(bean);
- return this;
- }
-
- /**
- * 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<AnnotatedMethod<?>> resolveDisposalMethods(Class<T> apiType, Annotation... bindings)
- {
- return Collections.emptySet();
- }
-
- /**
- * Resolves observers for given event and bindings
- *
- * @param event
- * The event to match
- * @param bindings
- * The binding types to match
- * @return The set of matching observers
- *
- * @see javax.inject.manager.Manager#resolveObservers(java.lang.Object,
- * java.lang.annotation.Annotation[])
- */
- @SuppressWarnings("unchecked")
- public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
- {
- Class<?> clazz = event.getClass();
- for (Annotation annotation : bindings)
- {
- if (!MetaDataCache.instance().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);
- }
- Type t = new Reflections.HierarchyDiscovery(clazz).getResolvedType();
- for (Type type : Reflections.getActualTypeArguments(clazz))
- {
- if (type instanceof WildcardType)
- {
- throw new IllegalArgumentException("Cannot resolve an event type parameterized with a wildcard " + clazz);
- }
- if (type instanceof TypeVariable)
- {
- throw new IllegalArgumentException("Cannot resolve an event type parameterized with a type parameter " + clazz);
- }
- }
- return eventManager.getObservers(event, bindings);
- }
-
- /**
- * 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();
- }
-
- /**
- * Resolves beans by API type and binding types
- *
- * @param type
- * The API type to match
- * @param bindings
- * The binding types to match
- * @return The set of matching beans
- *
- * @see javax.inject.manager.Manager#resolveByType(java.lang.Class,
- * java.lang.annotation.Annotation[])
- */
- public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... bindings)
- {
- return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
- }
-
- /**
- * Resolves beans by API type literal and binding types
- *
- * @param type
- * The API type literal to match
- * @param bindings
- * The binding types to match
- * @return The set of matching beans
- *
- * @see javax.inject.manager.Manager#resolveByType(javax.inject.TypeLiteral,
- * java.lang.annotation.Annotation[])
- */
- public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> type, Annotation... bindings)
- {
- return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
- }
-
- public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, InjectionPoint injectionPoint, Annotation... bindings)
- {
- boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
- try
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().push(injectionPoint);
- }
- return resolveByType(element, bindings);
- }
- finally
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().pop();
- }
- }
- }
-
- /**
- * Check the resolution request is valid, and then ask the resolver to
- * perform the resolution. For internal use.
- *
- * @param element
- * The item to resolve
- * @param bindings
- * The binding types to match
- * @return The set of matching beans
- */
- public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, Annotation... bindings)
- {
- for (Annotation annotation : element.getAnnotationsAsSet())
- {
- if (!MetaDataCache.instance().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.length > element.getMetaAnnotations(BindingType.class).size())
- {
- throw new DuplicateBindingTypeException("Duplicate bindings (" + Arrays.asList(bindings) + ") type passed " + element.toString());
- }
- return resolver.get(element);
- }
-
- /**
- * 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.beans = new CopyOnWriteArrayList<Bean<?>>(beans);
- for (RIBean<?> bean : beans)
- {
- if (bean instanceof NewEnterpriseBean)
- {
- newEnterpriseBeanMap.put(bean.getType(), (EnterpriseBean<?>) bean);
- }
- riBeans.put(bean.getId(), bean);
- }
- resolver.clear();
- }
- }
-
- /**
- * Gets the class-mapped beans. For internal use.
- *
- * @return The bean map
- */
- public Map<Class<?>, EnterpriseBean<?>> getNewEnterpriseBeanMap()
- {
- return newEnterpriseBeanMap;
- }
-
- /**
- * The beans registered with the Web Bean manager. For internal use
- *
- * @return The list of known beans
- */
- public List<Bean<?>> getBeans()
- {
- return Collections.unmodifiableList(beans);
- }
-
- 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.inject.manager.Manager#addContext(javax.context.Context)
- */
- public Manager addContext(Context context)
- {
- contextMap.add(context);
- return this;
- }
-
- /**
- * Registers a decorator with the manager
- *
- * @param decorator
- * The decorator to register
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#addDecorator(javax.inject.manager.Decorator)
- */
- public Manager addDecorator(Decorator decorator)
- {
- decorators.add(decorator);
- return this;
- }
-
- /**
- * Registers an interceptor with the manager
- *
- * @param interceptor
- * The interceptor to register
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#addInterceptor(javax.inject.manager.Interceptor)
- */
- public Manager addInterceptor(Interceptor interceptor)
- {
- interceptors.add(interceptor);
- return this;
- }
-
- /**
- * Registers an observer for a given event type and binding types
- *
- * @param observer
- * The observer to register
- * @param eventType
- * The event type to match
- * @param bindings
- * The bindings to match
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#addObserver(javax.event.Observer,
- * java.lang.Class, java.lang.annotation.Annotation[])
- */
- public <T> Manager addObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
- {
- this.eventManager.addObserver(observer, eventType, bindings);
- return this;
- }
-
- public <T> Manager addObserver(ObserverImpl<T> observer)
- {
- this.eventManager.addObserver(observer, observer.getEventType(), observer.getBindingsAsArray());
- return this;
- }
-
- /**
- * Registers an observer for a given event type literal and binding types
- *
- * @param observer
- * The observer to register
- * @param eventType
- * The event type literal to match
- * @param bindings
- * The bindings to match
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#addObserver(javax.event.Observer,
- * javax.inject.TypeLiteral, java.lang.annotation.Annotation[])
- */
- public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
- {
- eventManager.addObserver(observer, eventType.getType(), bindings);
- return this;
- }
-
- /**
- * 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.inject.manager.Manager#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.inject.manager.Manager#getContext(java.lang.Class)
- */
- public Context getContext(Class<? extends Annotation> scopeType)
- {
- List<Context> activeContexts = new ArrayList<Context>();
- for (Context context : contextMap.getContext(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();
- }
-
- /**
- * Direct access to built in contexts. For internal use.
- *
- * @param scopeType
- * The scope type of the context
- * @return The context
- */
- public Context getBuiltInContext(Class<? extends Annotation> scopeType)
- {
- return contextMap.getBuiltInContext(scopeType);
- }
-
- /**
- * Returns an instance of a bean
- *
- * @param bean
- * The bean to instantiate
- * @return An instance of the bean
- *
- * @see javax.inject.manager.Manager#getInstance(javax.inject.manager.Bean)
- */
- public <T> T getInstance(Bean<T> bean)
- {
- return getInstance(bean, true);
- }
-
- public <T> T getInstance(Bean<T> bean, boolean create)
- {
- if (create)
- {
- return getInstance(bean, new CreationalContextImpl<T>(bean));
- }
- else
- {
- return getInstance(bean, null);
- }
- }
-
- /**
- * Returns an instance of a bean
- *
- * @param bean
- * The bean to instantiate
- * @return An instance of the bean
- *
- * @see javax.inject.manager.Manager#getInstance(javax.inject.manager.Bean)
- */
- @SuppressWarnings("unchecked")
- private <T> T getInstance(Bean<T> bean, CreationalContextImpl<T> creationalContext)
- {
- if (specializedBeans.containsKey(bean))
- {
- return getInstance((Bean<T>) specializedBeans.get(bean), creationalContext);
- }
- else if (MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal())
- {
- if (creationalContext != null || (creationalContext == null && getContext(bean.getScopeType()).get(bean) != null))
- {
- return (T) clientProxyProvider.getClientProxy(bean);
- }
- else
- {
- return null;
- }
- }
- else
- {
- return getContext(bean.getScopeType()).get(bean, creationalContext);
- }
- }
-
- public <T> T getInstanceToInject(InjectionPoint injectionPoint)
- {
- return this.<T> getInstanceToInject(injectionPoint, null);
- }
-
- public void injectNonContextualInstance(Object instance)
- {
- nonContextualInjector.inject(instance);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getInstanceToInject(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
- {
- boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
- try
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().push(injectionPoint);
- }
- AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]));
- Bean<T> bean = getBeanByType(element, element.getBindingsAsArray());
- if (creationalContext instanceof CreationalContextImpl)
- {
- CreationalContextImpl<?> ctx = (CreationalContextImpl<?>) creationalContext;
- if (ctx.containsIncompleteInstance(bean))
- {
- return ctx.getIncompleteInstance(bean);
- }
- else
- {
- return getInstance(bean, ctx.getCreationalContext(bean));
- }
- }
- else
- {
- return getInstance(bean);
- }
- }
- finally
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().pop();
- }
- }
- }
-
- /**
- * Gets an instance by name, returning null if none is found and throwing an
- * exception if too many beans match
- *
- * @param name
- * The name to match
- * @return An instance of the bean
- *
- * @see javax.inject.manager.Manager#getInstanceByName(java.lang.String)
- */
- public Object getInstanceByName(String name)
- {
- Set<Bean<?>> beans = resolveByName(name);
- if (beans.size() == 0)
- {
- return null;
- }
- else if (beans.size() > 1)
- {
- throw new AmbiguousDependencyException("Resolved multiple Web Beans with " + name);
- }
- else
- {
- return getInstance(beans.iterator().next());
- }
- }
-
- /**
- * 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
- *
- * @see javax.inject.manager.Manager#getInstanceByType(java.lang.Class,
- * java.lang.annotation.Annotation[])
- */
- public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
- {
- return getInstanceByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
- }
-
- /**
- * Returns an instance by type literal and binding types
- *
- * @param type
- * The type to match
- * @param bindings
- * The binding types to match
- * @return An instance of the bean
- *
- * @see javax.inject.manager.Manager#getInstanceByType(javax.inject.TypeLiteral,
- * java.lang.annotation.Annotation[])
- */
- public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindings)
- {
- return getInstanceByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
- }
-
- /**
- * Resolve an instance, verify that the resolved bean can be instantiated,
- * and return
- *
- * @param element
- * The annotated item to match
- * @param bindings
- * The binding types to match
- * @return An instance of the bean
- */
- private <T> T getInstanceByType(AnnotatedItem<T, ?> element, Annotation... bindings)
- {
- return getInstance(getBeanByType(element, bindings));
- }
-
- public <T> Bean<T> getBeanByType(AnnotatedItem<T, ?> element, Annotation... bindings)
- {
- Set<Bean<T>> beans = resolveByType(element, bindings);
- if (beans.size() == 0)
- {
- throw new UnsatisfiedDependencyException(element + "Unable to resolve any Web Beans");
- }
- else if (beans.size() > 1)
- {
- throw new AmbiguousDependencyException(element + "Resolved multiple Web Beans");
- }
- Bean<T> bean = beans.iterator().next();
- boolean normalScoped = MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal();
- if (normalScoped && !Beans.isBeanProxyable(bean))
- {
- throw new UnproxyableDependencyException("Normal scoped bean " + bean + " is not proxyable");
- }
- return bean;
- }
-
- /**
- * Removes an observer
- *
- * @param observer
- * The observer to remove
- * @param eventType
- * The event type to match
- * @param bindings
- * the binding types to match
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#removeObserver(javax.event.Observer,
- * java.lang.Class, java.lang.annotation.Annotation[])
- */
- public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
- {
- this.eventManager.removeObserver(observer, eventType, bindings);
- return this;
- }
-
- /**
- * Removes an observer
- *
- * @param observer
- * The observer to remove
- * @param eventType
- * The event type to match
- * @param bindings
- * the binding types to match
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#removeObserver(javax.event.Observer,
- * javax.inject.TypeLiteral, java.lang.annotation.Annotation[])
- */
- public <T> Manager removeObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
- {
- this.eventManager.removeObserver(observer, eventType.getRawType(), bindings);
- return this;
- }
-
- /**
- * Resolves a set of beans based on their name
- *
- * @param The
- * name to match
- * @return The set of matching beans
- *
- * @see javax.inject.manager.Manager#resolveByName(java.lang.String)
- */
- public Set<Bean<?>> resolveByName(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.inject.manager.Manager#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.inject.manager.Manager#resolveInterceptors(javax.inject.manager.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;
- }
-
- public EjbDescriptorCache getEjbDescriptorCache()
- {
- return ejbDescriptorCache;
- }
-
- /**
- * 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: " + contextMap.keySet() + "\n");
- buffer.append("Registered beans: " + getBeans().size() + "\n");
- buffer.append("Registered decorators: " + decorators.size() + "\n");
- buffer.append("Registered interceptors: " + interceptors.size() + "\n");
- buffer.append("Specialized beans: " + specializedBeans.size() + "\n");
- return buffer.toString();
- }
-
- public Manager parse(InputStream xmlStream)
- {
- throw new UnsupportedOperationException();
- }
-
- public Manager createActivity()
- {
- return new ChildManager(this);
- }
-
- public Manager setCurrent(Class<? extends Annotation> scopeType)
- {
- throw new UnsupportedOperationException();
- }
-
- public ServiceRegistry getServices()
- {
- return simpleServiceRegistry;
- }
-
- /**
- * 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.rootManager();
- }
-
- /**
- * 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);
- getServices().get(NamingContext.class).unbind(RootManager.JNDI_KEY);
- }
-
- /**
- * 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();
- }
- }
-
-}
+/*
+ * 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.InputStream;
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+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.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import javax.context.Context;
+import javax.context.ContextNotActiveException;
+import javax.context.CreationalContext;
+import javax.event.Observer;
+import javax.inject.AmbiguousDependencyException;
+import javax.inject.BindingType;
+import javax.inject.DeploymentException;
+import javax.inject.DuplicateBindingTypeException;
+import javax.inject.Production;
+import javax.inject.Standard;
+import javax.inject.TypeLiteral;
+import javax.inject.UnproxyableDependencyException;
+import javax.inject.UnsatisfiedDependencyException;
+import javax.inject.manager.Bean;
+import javax.inject.manager.Decorator;
+import javax.inject.manager.InjectionPoint;
+import javax.inject.manager.InterceptionType;
+import javax.inject.manager.Interceptor;
+import javax.inject.manager.Manager;
+
+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.ContextMap;
+import org.jboss.webbeans.context.CreationalContextImpl;
+import org.jboss.webbeans.ejb.EjbDescriptorCache;
+import org.jboss.webbeans.event.EventManager;
+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.introspector.AnnotatedMethod;
+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.resources.spi.NamingContext;
+import org.jboss.webbeans.util.Beans;
+import org.jboss.webbeans.util.Reflections;
+
+/**
+ * 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 RootManager implements WebBeansManager, Serializable
+{
+
+ private static final Log log = Logging.getLog(RootManager.class);
+
+ private static final long serialVersionUID = 3021562879133838561L;
+
+ // The JNDI key to place the manager under
+ public static final String JNDI_KEY = "java:app/Manager";
+
+ // The enabled deployment types from web-beans.xml
+ private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
+ // The Web Beans event manager
+ private transient final EventManager eventManager;
+
+ // An executor service for asynchronous tasks
+ private transient final ExecutorService taskExecutor = Executors.newSingleThreadExecutor();
+
+ // An injection point metadata beans factory
+ private transient final ThreadLocal<Stack<InjectionPoint>> currentInjectionPoint;
+
+ // The bean resolver
+ private transient final Resolver resolver;
+
+ // The registered contexts
+ private transient final ContextMap contextMap;
+ // The client proxy pool
+ private transient final ClientProxyProvider clientProxyProvider;
+ // The registered beans
+ private transient List<Bean<?>> beans;
+ // The registered beans, mapped by implementation class
+ private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeanMap;
+
+ private transient final Map<String, RIBean<?>> riBeans;
+
+ // The registered decorators
+ private transient final Set<Decorator> decorators;
+ // The registered interceptors
+ private transient final Set<Interceptor> interceptors;
+
+ // The EJB resolver provided by the container
+ private transient final ServiceRegistry simpleServiceRegistry;
+
+ private transient final EjbDescriptorCache ejbDescriptorCache;
+
+ private final transient Map<Bean<?>, Bean<?>> specializedBeans;
+
+ private final transient NonContextualInjector nonContextualInjector;
+
+ /**
+ * Create a new manager
+ *
+ * @param ejbServices
+ * the ejbResolver to use
+ */
+ public RootManager(ServiceRegistry simpleServiceRegistry)
+ {
+ this.simpleServiceRegistry = simpleServiceRegistry;
+ this.beans = new CopyOnWriteArrayList<Bean<?>>();
+ this.newEnterpriseBeanMap = new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>();
+ this.riBeans = new ConcurrentHashMap<String, RIBean<?>>();
+ this.resolver = new Resolver(this);
+ this.clientProxyProvider = new ClientProxyProvider();
+ this.decorators = new HashSet<Decorator>();
+ this.interceptors = new HashSet<Interceptor>();
+ this.contextMap = new ContextMap();
+ this.eventManager = new EventManager();
+ this.ejbDescriptorCache = new EjbDescriptorCache();
+ this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
+ {
+ @Override
+ protected Stack<InjectionPoint> initialValue()
+ {
+ return new Stack<InjectionPoint>();
+ }
+ };
+ this.specializedBeans = new HashMap<Bean<?>, Bean<?>>();
+ this.nonContextualInjector = new NonContextualInjector(this);
+ List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ defaultEnabledDeploymentTypes.add(0, Standard.class);
+ defaultEnabledDeploymentTypes.add(1, Production.class);
+ setEnabledDeploymentTypes(defaultEnabledDeploymentTypes);
+ }
+
+ /**
+ * 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.inject.manager.Manager#addBean(javax.inject.manager.Bean)
+ */
+ public Manager addBean(Bean<?> bean)
+ {
+ if (beans.contains(bean))
+ {
+ return this;
+ }
+ resolver.clear();
+ beans.add(bean);
+ return this;
+ }
+
+ /**
+ * 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<Bean<T>> resolveDisposalBeans(Class<T> apiType, Annotation... bindings)
+ {
+ return resolveByType(apiType, bindings);
+ }
+
+ /**
+ * Resolves observers for given event and bindings
+ *
+ * @param event
+ * The event to match
+ * @param bindings
+ * The binding types to match
+ * @return The set of matching observers
+ *
+ * @see javax.inject.manager.Manager#resolveObservers(java.lang.Object,
+ * java.lang.annotation.Annotation[])
+ */
+ @SuppressWarnings("unchecked")
+ public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
+ {
+ Class<?> clazz = event.getClass();
+ for (Annotation annotation : bindings)
+ {
+ if (!MetaDataCache.instance().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);
+ }
+ Type t = new Reflections.HierarchyDiscovery(clazz).getResolvedType();
+ for (Type type : Reflections.getActualTypeArguments(clazz))
+ {
+ if (type instanceof WildcardType)
+ {
+ throw new IllegalArgumentException("Cannot resolve an event type parameterized with a wildcard " + clazz);
+ }
+ if (type instanceof TypeVariable)
+ {
+ throw new IllegalArgumentException("Cannot resolve an event type parameterized with a type parameter " + clazz);
+ }
+ }
+ return eventManager.getObservers(event, bindings);
+ }
+
+ /**
+ * 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();
+ }
+
+ /**
+ * Resolves beans by API type and binding types
+ *
+ * @param type
+ * The API type to match
+ * @param bindings
+ * The binding types to match
+ * @return The set of matching beans
+ *
+ * @see javax.inject.manager.Manager#resolveByType(java.lang.Class,
+ * java.lang.annotation.Annotation[])
+ */
+ public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... bindings)
+ {
+ return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
+ }
+
+ /**
+ * Resolves beans by API type literal and binding types
+ *
+ * @param type
+ * The API type literal to match
+ * @param bindings
+ * The binding types to match
+ * @return The set of matching beans
+ *
+ * @see javax.inject.manager.Manager#resolveByType(javax.inject.TypeLiteral,
+ * java.lang.annotation.Annotation[])
+ */
+ public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> type, Annotation... bindings)
+ {
+ return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
+ }
+
+ public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, InjectionPoint injectionPoint, Annotation... bindings)
+ {
+ boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
+ try
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().push(injectionPoint);
+ }
+ return resolveByType(element, bindings);
+ }
+ finally
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+ }
+
+ /**
+ * Check the resolution request is valid, and then ask the resolver to
+ * perform the resolution. For internal use.
+ *
+ * @param element
+ * The item to resolve
+ * @param bindings
+ * The binding types to match
+ * @return The set of matching beans
+ */
+ public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, Annotation... bindings)
+ {
+ for (Annotation annotation : element.getAnnotationsAsSet())
+ {
+ if (!MetaDataCache.instance().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.length > element.getMetaAnnotations(BindingType.class).size())
+ {
+ throw new DuplicateBindingTypeException("Duplicate bindings (" + Arrays.asList(bindings) + ") type passed " + element.toString());
+ }
+ return resolver.get(element);
+ }
+
+ /**
+ * 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.beans = new CopyOnWriteArrayList<Bean<?>>(beans);
+ for (RIBean<?> bean : beans)
+ {
+ if (bean instanceof NewEnterpriseBean)
+ {
+ newEnterpriseBeanMap.put(bean.getType(), (EnterpriseBean<?>) bean);
+ }
+ riBeans.put(bean.getId(), bean);
+ }
+ resolver.clear();
+ }
+ }
+
+ /**
+ * Gets the class-mapped beans. For internal use.
+ *
+ * @return The bean map
+ */
+ public Map<Class<?>, EnterpriseBean<?>> getNewEnterpriseBeanMap()
+ {
+ return newEnterpriseBeanMap;
+ }
+
+ /**
+ * The beans registered with the Web Bean manager. For internal use
+ *
+ * @return The list of known beans
+ */
+ public List<Bean<?>> getBeans()
+ {
+ return Collections.unmodifiableList(beans);
+ }
+
+ 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.inject.manager.Manager#addContext(javax.context.Context)
+ */
+ public Manager addContext(Context context)
+ {
+ contextMap.add(context);
+ return this;
+ }
+
+ /**
+ * Registers a decorator with the manager
+ *
+ * @param decorator
+ * The decorator to register
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#addDecorator(javax.inject.manager.Decorator)
+ */
+ public Manager addDecorator(Decorator decorator)
+ {
+ decorators.add(decorator);
+ return this;
+ }
+
+ /**
+ * Registers an interceptor with the manager
+ *
+ * @param interceptor
+ * The interceptor to register
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#addInterceptor(javax.inject.manager.Interceptor)
+ */
+ public Manager addInterceptor(Interceptor interceptor)
+ {
+ interceptors.add(interceptor);
+ return this;
+ }
+
+ /**
+ * Registers an observer for a given event type and binding types
+ *
+ * @param observer
+ * The observer to register
+ * @param eventType
+ * The event type to match
+ * @param bindings
+ * The bindings to match
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#addObserver(javax.event.Observer,
+ * java.lang.Class, java.lang.annotation.Annotation[])
+ */
+ public <T> Manager addObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
+ {
+ this.eventManager.addObserver(observer, eventType, bindings);
+ return this;
+ }
+
+ public <T> Manager addObserver(ObserverImpl<T> observer)
+ {
+ this.eventManager.addObserver(observer, observer.getEventType(), observer.getBindingsAsArray());
+ return this;
+ }
+
+ /**
+ * Registers an observer for a given event type literal and binding types
+ *
+ * @param observer
+ * The observer to register
+ * @param eventType
+ * The event type literal to match
+ * @param bindings
+ * The bindings to match
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#addObserver(javax.event.Observer,
+ * javax.inject.TypeLiteral, java.lang.annotation.Annotation[])
+ */
+ public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
+ {
+ eventManager.addObserver(observer, eventType.getType(), bindings);
+ return this;
+ }
+
+ /**
+ * 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.inject.manager.Manager#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.inject.manager.Manager#getContext(java.lang.Class)
+ */
+ public Context getContext(Class<? extends Annotation> scopeType)
+ {
+ List<Context> activeContexts = new ArrayList<Context>();
+ for (Context context : contextMap.getContext(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();
+ }
+
+ /**
+ * Direct access to built in contexts. For internal use.
+ *
+ * @param scopeType
+ * The scope type of the context
+ * @return The context
+ */
+ public Context getBuiltInContext(Class<? extends Annotation> scopeType)
+ {
+ return contextMap.getBuiltInContext(scopeType);
+ }
+
+ /**
+ * Returns an instance of a bean
+ *
+ * @param bean
+ * The bean to instantiate
+ * @return An instance of the bean
+ *
+ * @see javax.inject.manager.Manager#getInstance(javax.inject.manager.Bean)
+ */
+ public <T> T getInstance(Bean<T> bean)
+ {
+ return getInstance(bean, true);
+ }
+
+ public <T> T getInstance(Bean<T> bean, boolean create)
+ {
+ if (create)
+ {
+ return getInstance(bean, new CreationalContextImpl<T>(bean));
+ }
+ else
+ {
+ return getInstance(bean, null);
+ }
+ }
+
+ /**
+ * Returns an instance of a bean
+ *
+ * @param bean
+ * The bean to instantiate
+ * @return An instance of the bean
+ *
+ * @see javax.inject.manager.Manager#getInstance(javax.inject.manager.Bean)
+ */
+ @SuppressWarnings("unchecked")
+ private <T> T getInstance(Bean<T> bean, CreationalContextImpl<T> creationalContext)
+ {
+ if (specializedBeans.containsKey(bean))
+ {
+ return getInstance((Bean<T>) specializedBeans.get(bean), creationalContext);
+ }
+ else if (MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal())
+ {
+ if (creationalContext != null || (creationalContext == null && getContext(bean.getScopeType()).get(bean) != null))
+ {
+ return (T) clientProxyProvider.getClientProxy(bean);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ return getContext(bean.getScopeType()).get(bean, creationalContext);
+ }
+ }
+
+ public <T> T getInstanceToInject(InjectionPoint injectionPoint)
+ {
+ return this.<T> getInstanceToInject(injectionPoint, null);
+ }
+
+ public void injectNonContextualInstance(Object instance)
+ {
+ nonContextualInjector.inject(instance);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getInstanceToInject(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
+ {
+ boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
+ try
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().push(injectionPoint);
+ }
+ AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]));
+ Bean<T> bean = getBeanByType(element, element.getBindingsAsArray());
+ if (creationalContext instanceof CreationalContextImpl)
+ {
+ CreationalContextImpl<?> ctx = (CreationalContextImpl<?>) creationalContext;
+ if (ctx.containsIncompleteInstance(bean))
+ {
+ return ctx.getIncompleteInstance(bean);
+ }
+ else
+ {
+ return getInstance(bean, ctx.getCreationalContext(bean));
+ }
+ }
+ else
+ {
+ return getInstance(bean);
+ }
+ }
+ finally
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+ }
+
+ /**
+ * Gets an instance by name, returning null if none is found and throwing an
+ * exception if too many beans match
+ *
+ * @param name
+ * The name to match
+ * @return An instance of the bean
+ *
+ * @see javax.inject.manager.Manager#getInstanceByName(java.lang.String)
+ */
+ public Object getInstanceByName(String name)
+ {
+ Set<Bean<?>> beans = resolveByName(name);
+ if (beans.size() == 0)
+ {
+ return null;
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousDependencyException("Resolved multiple Web Beans with " + name);
+ }
+ else
+ {
+ return getInstance(beans.iterator().next());
+ }
+ }
+
+ /**
+ * 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
+ *
+ * @see javax.inject.manager.Manager#getInstanceByType(java.lang.Class,
+ * java.lang.annotation.Annotation[])
+ */
+ public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
+ {
+ return getInstanceByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
+ }
+
+ /**
+ * Returns an instance by type literal and binding types
+ *
+ * @param type
+ * The type to match
+ * @param bindings
+ * The binding types to match
+ * @return An instance of the bean
+ *
+ * @see javax.inject.manager.Manager#getInstanceByType(javax.inject.TypeLiteral,
+ * java.lang.annotation.Annotation[])
+ */
+ public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindings)
+ {
+ return getInstanceByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
+ }
+
+ /**
+ * Resolve an instance, verify that the resolved bean can be instantiated,
+ * and return
+ *
+ * @param element
+ * The annotated item to match
+ * @param bindings
+ * The binding types to match
+ * @return An instance of the bean
+ */
+ private <T> T getInstanceByType(AnnotatedItem<T, ?> element, Annotation... bindings)
+ {
+ return getInstance(getBeanByType(element, bindings));
+ }
+
+ public <T> Bean<T> getBeanByType(AnnotatedItem<T, ?> element, Annotation... bindings)
+ {
+ Set<Bean<T>> beans = resolveByType(element, bindings);
+ if (beans.size() == 0)
+ {
+ throw new UnsatisfiedDependencyException(element + "Unable to resolve any Web Beans");
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousDependencyException(element + "Resolved multiple Web Beans");
+ }
+ Bean<T> bean = beans.iterator().next();
+ boolean normalScoped = MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal();
+ if (normalScoped && !Beans.isBeanProxyable(bean))
+ {
+ throw new UnproxyableDependencyException("Normal scoped bean " + bean + " is not proxyable");
+ }
+ return bean;
+ }
+
+ /**
+ * Removes an observer
+ *
+ * @param observer
+ * The observer to remove
+ * @param eventType
+ * The event type to match
+ * @param bindings
+ * the binding types to match
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#removeObserver(javax.event.Observer,
+ * java.lang.Class, java.lang.annotation.Annotation[])
+ */
+ public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
+ {
+ this.eventManager.removeObserver(observer, eventType, bindings);
+ return this;
+ }
+
+ /**
+ * Removes an observer
+ *
+ * @param observer
+ * The observer to remove
+ * @param eventType
+ * The event type to match
+ * @param bindings
+ * the binding types to match
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#removeObserver(javax.event.Observer,
+ * javax.inject.TypeLiteral, java.lang.annotation.Annotation[])
+ */
+ public <T> Manager removeObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
+ {
+ this.eventManager.removeObserver(observer, eventType.getRawType(), bindings);
+ return this;
+ }
+
+ /**
+ * Resolves a set of beans based on their name
+ *
+ * @param The
+ * name to match
+ * @return The set of matching beans
+ *
+ * @see javax.inject.manager.Manager#resolveByName(java.lang.String)
+ */
+ public Set<Bean<?>> resolveByName(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.inject.manager.Manager#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.inject.manager.Manager#resolveInterceptors(javax.inject.manager.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;
+ }
+
+ public EjbDescriptorCache getEjbDescriptorCache()
+ {
+ return ejbDescriptorCache;
+ }
+
+ /**
+ * 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: " + contextMap.keySet() + "\n");
+ buffer.append("Registered beans: " + getBeans().size() + "\n");
+ buffer.append("Registered decorators: " + decorators.size() + "\n");
+ buffer.append("Registered interceptors: " + interceptors.size() + "\n");
+ buffer.append("Specialized beans: " + specializedBeans.size() + "\n");
+ return buffer.toString();
+ }
+
+ public Manager parse(InputStream xmlStream)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Manager createActivity()
+ {
+ return new ChildManager(this);
+ }
+
+ public Manager setCurrent(Class<? extends Annotation> scopeType)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public ServiceRegistry getServices()
+ {
+ return simpleServiceRegistry;
+ }
+
+ /**
+ * 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.rootManager();
+ }
+
+ /**
+ * 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);
+ getServices().get(NamingContext.class).unbind(RootManager.JNDI_KEY);
+ }
+
+ /**
+ * 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();
+ }
+ }
+
+}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-03-31 07:38:18 UTC (rev 2279)
@@ -0,0 +1,298 @@
+package org.jboss.webbeans.bean;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Set;
+
+import javax.context.CreationalContext;
+import javax.event.Observes;
+import javax.inject.DefinitionException;
+import javax.inject.Disposes;
+import javax.inject.Initializer;
+import javax.inject.Produces;
+import javax.inject.manager.Bean;
+import javax.inject.manager.InjectionPoint;
+
+import org.jboss.webbeans.RootManager;
+import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
+import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
+import org.jboss.webbeans.injection.MethodInjectionPoint;
+import org.jboss.webbeans.injection.ParameterInjectionPoint;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.AnnotatedParameter;
+
+public class DisposalMethodBean<T> extends AbstractBean<T, Method>
+{
+
+ protected DisposalMethodBean(RootManager manager, AnnotatedMethod<T> disposalMethod, Bean<?> declaringBean)
+ {
+ super(manager);
+ this.disposalMethod = disposalMethod;
+ this.declaringBean = declaringBean;
+ checkDisposalMethod();
+ initInjectionPoints();
+ initType();
+ initTypes();
+ this.id = createId("DisposalMethod-" + declaringBean.getName() + "-"+ disposalMethod.getSignature().toString());
+
+ }
+
+ protected Bean<?> declaringBean;
+ protected AnnotatedMethod<T> disposalMethod;
+ protected Set<AnnotatedInjectionPoint<?, ?>> disposalInjectionPoints;
+ private String id;
+
+ @Override
+ protected void initTypes()
+ {
+ Set<Type> types = new HashSet<Type>();
+ types = new HashSet<Type>();
+ types.add(getType());
+ types.add(Object.class); // FODO: Maybe not?
+ super.types = types;
+ }
+
+ protected void initType()
+ {
+ this.type = (Class<T>) disposalMethod.getAnnotatedParameters(Disposes.class).get(0).getRawType();
+ }
+
+ public static <T> DisposalMethodBean<T> of(RootManager manager, AnnotatedMethod<T> disposalMethod, Bean<?> declaringBean)
+ {
+ return new DisposalMethodBean<T>(manager, disposalMethod, declaringBean);
+ }
+
+ private void initInjectionPoints()
+ {
+ disposalInjectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
+
+ List<? extends AnnotatedParameter<?>> disposalMethodParameters = disposalMethod.getParameters();
+
+ // First one must be @Disposes, if more, register injectionpoints
+ if (disposalMethodParameters.size() > 1)
+ {
+ for (int i = 1; i < disposalMethodParameters.size(); i++)
+ {
+ AnnotatedParameter<?> parameter = disposalMethodParameters.get(i);
+ disposalInjectionPoints.add(ParameterInjectionPoint.of(declaringBean, parameter));
+ }
+ }
+
+ injectionPoints.add(MethodInjectionPoint.of(declaringBean, disposalMethod));
+
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ // At least 1 parameter exists, already checked in constructor
+ return disposalMethod.getParameters().get(0).getBindings();
+ }
+
+ @Override
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return declaringBean.getDeploymentType();
+ }
+
+ public Set<AnnotatedInjectionPoint<?, ?>> getInjectionPoints()
+ {
+ return injectionPoints;
+ }
+
+ @Override
+ public String getName()
+ {
+ return disposalMethod.getPropertyName();
+ }
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return declaringBean.getScopeType();
+ }
+
+ @Override
+ public Set<? extends Type> getTypes()
+ {
+ return types;
+ }
+
+ @Override
+ public String toString()
+ {
+ return disposalMethod.toString();
+ }
+
+ @Override
+ public boolean isNullable()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isSerializable()
+ {
+ return declaringBean.isSerializable();
+ }
+
+ public T create(CreationalContext<T> creationalContext)
+ {
+ return null;
+ }
+
+ public void invokeDisposeMethod(Object instance)
+ {
+ List<Object> parameters = new LinkedList<Object>();
+
+ parameters.add(instance);
+
+ for (InjectionPoint injectionPoint : disposalInjectionPoints)
+ {
+ Object injectionObject = getManager().getInstanceToInject(injectionPoint);
+ parameters.add(injectionObject);
+ }
+
+ Object beanInstance = disposalMethod.isStatic() ? declaringBean : getManager().getInstance(declaringBean);
+
+ try
+ {
+ disposalMethod.invoke(beanInstance, parameters.toArray());
+ }
+ catch (Exception e)
+ {
+ // TODO:
+ }
+
+ }
+
+ private void checkDisposalMethod()
+ {
+ if (!disposalMethod.getParameters().get(0).isAnnotationPresent(Disposes.class))
+ {
+ throw new DefinitionException(disposalMethod.toString() + " doesn't have @Dispose as first parameter");
+ }
+ if (disposalMethod.getAnnotatedParameters(Disposes.class).size() > 1)
+ {
+ throw new DefinitionException(disposalMethod.toString() + " has more than one @Dispose parameters");
+ }
+ if (disposalMethod.getAnnotatedParameters(Observes.class).size() > 0)
+ {
+ throw new DefinitionException("@Observes is not allowed on disposal method, see " + disposalMethod.toString());
+ }
+ if (disposalMethod.getAnnotation(Initializer.class) != null)
+ {
+ throw new DefinitionException("@Intitializer is not allowed on a disposal method, see " + disposalMethod.toString());
+ }
+ if (disposalMethod.getAnnotation(Produces.class) != null)
+ {
+ throw new DefinitionException("@Produces is not allowed on a disposal method, see " + disposalMethod.toString());
+ }
+ if (declaringBean instanceof EnterpriseBean)
+ {
+ boolean methodDeclaredOnTypes = false;
+ // TODO use annotated item?
+ for (Type type : declaringBean.getTypes())
+ {
+ if (type instanceof Class)
+ {
+ Class<?> clazz = (Class<?>) type;
+ try
+ {
+ clazz.getDeclaredMethod(disposalMethod.getName(), disposalMethod.getParameterTypesAsArray());
+ methodDeclaredOnTypes = true;
+ }
+ catch (NoSuchMethodException nsme)
+ {
+ // No - op
+ }
+ }
+ }
+ if (!methodDeclaredOnTypes)
+ {
+ throw new DefinitionException("Producer method " + toString() + " must be declared on a business interface of " + declaringBean);
+ }
+ }
+ }
+
+ @Override
+ public Class<T> getType()
+ {
+ return type;
+ }
+
+ @Override
+ public void initialize(BeanDeployerEnvironment environment)
+ {
+
+ }
+
+ @Override
+ public boolean isPrimitive()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isProxyable()
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isSpecializing()
+ {
+ return false;
+ }
+
+ @Override
+ protected AnnotatedItem<T, Method> getAnnotatedItem()
+ {
+ return disposalMethod;
+ }
+
+ @Override
+ protected Class<? extends Annotation> getDefaultDeploymentType()
+ {
+ return declaringBean.getDeploymentType();
+ }
+
+ @Override
+ protected String getDefaultName()
+ {
+ return disposalMethod.getPropertyName();
+ }
+
+ @Override
+ protected void initDeploymentType()
+ {
+ }
+
+ @Override
+ protected void initScopeType()
+ {
+ }
+
+ @Override
+ public AbstractBean<?, ?> getSpecializedBean()
+ {
+ return null;
+ }
+
+ public void destroy(T instance)
+ {
+
+ }
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+}
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-03-31 03:54:17 UTC (rev 2278)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-03-31 07:38:18 UTC (rev 2279)
@@ -1,266 +1,276 @@
-/*
- * 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.bean;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.context.CreationalContext;
-import javax.event.Observes;
-import javax.inject.CreationException;
-import javax.inject.DefinitionException;
-import javax.inject.Disposes;
-
-import org.jboss.webbeans.RootManager;
-import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.injection.MethodInjectionPoint;
-import org.jboss.webbeans.injection.ParameterInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.util.Names;
-
-/**
- * Represents a producer method bean
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class ProducerMethodBean<T> extends AbstractProducerBean<T, Method>
-{
- // The underlying method
- private MethodInjectionPoint<T> method;
-
- private AnnotatedMethod<?> disposalMethod;
-
- private ProducerMethodBean<?> specializedBean;
-
- private final String id;
-
- /**
- * Creates a producer method Web Bean
- *
- * @param method
- * The underlying method abstraction
- * @param declaringBean
- * The declaring bean abstraction
- * @param manager
- * the current manager
- * @return A producer Web Bean
- */
- public static <T> ProducerMethodBean<T> of(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, RootManager manager)
- {
- return new ProducerMethodBean<T>(method, declaringBean, manager);
- }
-
- protected ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, RootManager manager)
- {
- super(declaringBean, manager);
- this.method = MethodInjectionPoint.of(this, method);
- initType();
- initTypes();
- initBindings();
- this.id = createId("ProducerField-" + declaringBean.getType().getName() + "-"+ method.getSignature().toString());
- }
-
- protected T produceInstance(CreationalContext<T> creationalContext)
- {
- Object receiver = getReceiver(creationalContext);
- if (receiver != null)
- {
- return method.invokeOnInstance(receiver, manager, creationalContext, CreationException.class);
- }
- else
- {
- return method.invoke(receiver, manager, creationalContext, CreationException.class);
- }
- }
-
- /**
- * Initializes the bean and its metadata
- */
- @Override
- public void initialize(BeanDeployerEnvironment environment)
- {
- if (!isInitialized())
- {
- super.initialize(environment);
- checkProducerMethod();
- // initDisposalMethod();
- initInjectionPoints();
- }
- }
-
- /**
- * Initializes the injection points
- */
- protected void initInjectionPoints()
- {
- for (AnnotatedParameter<?> parameter : method.getParameters())
- {
- injectionPoints.add(ParameterInjectionPoint.of(this, parameter));
- }
- }
-
- /**
- * Validates the producer method
- */
- protected void checkProducerMethod()
- {
- if (getAnnotatedItem().getAnnotatedParameters(Observes.class).size() > 0)
- {
- throw new DefinitionException("Producer method cannot have parameter annotated @Observes");
- }
- else if (getAnnotatedItem().getAnnotatedParameters(Disposes.class).size() > 0)
- {
- throw new DefinitionException("Producer method cannot have parameter annotated @Disposes");
- }
- else if (declaringBean instanceof EnterpriseBean)
- {
- boolean methodDeclaredOnTypes = false;
- // TODO use annotated item?
- for (Type type : declaringBean.getTypes())
- {
- if (type instanceof Class)
- {
- Class<?> clazz = (Class<?>) type;
- try
- {
- clazz.getDeclaredMethod(getAnnotatedItem().getName(), getAnnotatedItem().getParameterTypesAsArray());
- methodDeclaredOnTypes = true;
- }
- catch (NoSuchMethodException nsme)
- {
- // No - op
- }
- }
- }
- if (!methodDeclaredOnTypes)
- {
- throw new DefinitionException("Producer method " + toString() + " must be declared on a business interface of " + declaringBean);
- }
- }
- }
-
- /**
- * Initializes the remove method
- */
- protected void initDisposalMethod(BeanDeployerEnvironment environment)
- {
- Set<AnnotatedMethod<?>> disposalMethods = manager.resolveDisposalMethods(getType(), getBindings().toArray(new Annotation[0]));
- if (disposalMethods.size() == 1)
- {
- this.disposalMethod = disposalMethods.iterator().next();
- }
- else if (disposalMethods.size() > 1)
- {
- // TODO List out found disposal methods
- throw new DefinitionException("Cannot declare multiple disposal methods for this producer method");
- }
- }
-
- /**
- * Gets the annotated item representing the method
- *
- * @return The annotated item
- */
- @Override
- public AnnotatedMethod<T> getAnnotatedItem()
- {
- return method;
- }
-
- /**
- * Returns the default name
- *
- * @return The default name
- */
- @Override
- protected String getDefaultName()
- {
- return method.getPropertyName();
- }
-
- /**
- * Returns the disposal method
- *
- * @return The method representation
- */
- public AnnotatedMethod<?> getDisposalMethod()
- {
- return disposalMethod;
- }
-
- /**
- * Gets a string representation
- *
- * @return The string representation
- */
- @Override
- public String toString()
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append(Names.scopeTypeToString(getScopeType()));
- if (getName() == null)
- {
- buffer.append("unnamed producer method bean");
- }
- else
- {
- buffer.append("simple producer method bean '" + getName() + "'");
- }
- buffer.append(" [" + getType().getName() + "] ");
- buffer.append("API types " + getTypes() + ", binding types " + getBindings());
- return buffer.toString();
- }
-
- @Override
- public AbstractBean<?, ?> getSpecializedBean()
- {
- return specializedBean;
- }
-
- @Override
- protected void preSpecialize()
- {
- if (declaringBean.getAnnotatedItem().getSuperclass().getDeclaredMethod(getAnnotatedItem().getAnnotatedMethod()) == null)
- {
- throw new DefinitionException("Specialized producer method does not override a method on the direct superclass");
- }
- }
-
- @Override
- protected void specialize(BeanDeployerEnvironment environment)
- {
- AnnotatedMethod<?> superClassMethod = declaringBean.getAnnotatedItem().getSuperclass().getMethod(getAnnotatedItem().getAnnotatedMethod());
- if (environment.getProducerMethod(superClassMethod) == null)
- {
- throw new IllegalStateException(toString() + " does not specialize a bean");
- }
- this.specializedBean = environment.getProducerMethod(superClassMethod);
- }
-
- @Override
- public String getId()
- {
- return id;
- }
-
-}
+/*
+ * 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.bean;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.context.CreationalContext;
+import javax.event.Observes;
+import javax.inject.CreationException;
+import javax.inject.DefinitionException;
+import javax.inject.Disposes;
+import javax.inject.manager.Bean;
+
+import org.jboss.webbeans.RootManager;
+import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
+import org.jboss.webbeans.injection.MethodInjectionPoint;
+import org.jboss.webbeans.injection.ParameterInjectionPoint;
+import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.util.Names;
+
+/**
+ * Represents a producer method bean
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class ProducerMethodBean<T> extends AbstractProducerBean<T, Method>
+{
+ // The underlying method
+ private MethodInjectionPoint<T> method;
+
+ private DisposalMethodBean<?> disposalMethodBean;
+
+ private ProducerMethodBean<?> specializedBean;
+
+ private final String id;
+
+ /**
+ * Creates a producer method Web Bean
+ *
+ * @param method The underlying method abstraction
+ * @param declaringBean The declaring bean abstraction
+ * @param manager the current manager
+ * @return A producer Web Bean
+ */
+ public static <T> ProducerMethodBean<T> of(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, RootManager manager)
+ {
+ return new ProducerMethodBean<T>(method, declaringBean, manager);
+ }
+
+ protected ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, RootManager manager)
+ {
+ super(declaringBean, manager);
+ this.method = MethodInjectionPoint.of(this, method);
+ initType();
+ initTypes();
+ initBindings();
+ this.id = createId("ProducerField-" + declaringBean.getType().getName() + "-" + method.getSignature().toString());
+ }
+
+ protected T produceInstance(CreationalContext<T> creationalContext)
+ {
+ Object receiver = getReceiver(creationalContext);
+ if (receiver != null)
+ {
+ return method.invokeOnInstance(receiver, manager, creationalContext, CreationException.class);
+ }
+ else
+ {
+ return method.invoke(receiver, manager, creationalContext, CreationException.class);
+ }
+ }
+
+ /**
+ * Initializes the bean and its metadata
+ */
+ @Override
+ public void initialize(BeanDeployerEnvironment environment)
+ {
+ if (!isInitialized())
+ {
+ super.initialize(environment);
+ checkProducerMethod();
+ // initDisposalMethod();
+ initInjectionPoints();
+ }
+ }
+
+ /**
+ * Initializes the injection points
+ */
+ protected void initInjectionPoints()
+ {
+ for (AnnotatedParameter<?> parameter : method.getParameters())
+ {
+ injectionPoints.add(ParameterInjectionPoint.of(this, parameter));
+ }
+ }
+
+ /**
+ * Validates the producer method
+ */
+ protected void checkProducerMethod()
+ {
+ if (getAnnotatedItem().getAnnotatedParameters(Observes.class).size() > 0)
+ {
+ throw new DefinitionException("Producer method cannot have parameter annotated @Observes");
+ }
+ else if (getAnnotatedItem().getAnnotatedParameters(Disposes.class).size() > 0)
+ {
+ throw new DefinitionException("Producer method cannot have parameter annotated @Disposes");
+ }
+ else if (declaringBean instanceof EnterpriseBean)
+ {
+ boolean methodDeclaredOnTypes = false;
+ // TODO use annotated item?
+ for (Type type : declaringBean.getTypes())
+ {
+ if (type instanceof Class)
+ {
+ Class<?> clazz = (Class<?>) type;
+ try
+ {
+ clazz.getDeclaredMethod(getAnnotatedItem().getName(), getAnnotatedItem().getParameterTypesAsArray());
+ methodDeclaredOnTypes = true;
+ }
+ catch (NoSuchMethodException nsme)
+ {
+ // No - op
+ }
+ }
+ }
+ if (!methodDeclaredOnTypes)
+ {
+ throw new DefinitionException("Producer method " + toString() + " must be declared on a business interface of " + declaringBean);
+ }
+ }
+ }
+
+ /**
+ * Initializes the remove method
+ */
+ protected void initDisposalMethod(BeanDeployerEnvironment environment)
+ {
+ Set<Bean<T>> disposalBeans = manager.resolveDisposalBeans(getType(), bindings.toArray(new Annotation[0]));
+
+ if (disposalBeans.size() == 1)
+ {
+ this.disposalMethodBean = (DisposalMethodBean<?>) disposalBeans.iterator().next();
+ environment.addResolvedDisposalBean(disposalMethodBean);
+ }
+ else if (disposalBeans.size() > 1)
+ {
+ // TODO List out found disposal methods
+ throw new DefinitionException("Cannot declare multiple disposal methods for this producer method");
+ }
+ }
+
+ @Override
+ public void destroy(T instance)
+ {
+ // Delegate destruction to disposal method
+ if (disposalMethodBean != null)
+ disposalMethodBean.invokeDisposeMethod(instance);
+
+ super.destroy(instance);
+ }
+
+ /**
+ * Gets the annotated item representing the method
+ *
+ * @return The annotated item
+ */
+ @Override
+ public AnnotatedMethod<T> getAnnotatedItem()
+ {
+ return method;
+ }
+
+ /**
+ * Returns the default name
+ *
+ * @return The default name
+ */
+ @Override
+ protected String getDefaultName()
+ {
+ return method.getPropertyName();
+ }
+
+ /**
+ * Returns the disposal method
+ *
+ * @return The method representation
+ */
+ public DisposalMethodBean<?> getDisposalMethod()
+ {
+ return disposalMethodBean;
+ }
+
+ /**
+ * Gets a string representation
+ *
+ * @return The string representation
+ */
+ @Override
+ public String toString()
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append(Names.scopeTypeToString(getScopeType()));
+ if (getName() == null)
+ {
+ buffer.append("unnamed producer method bean");
+ }
+ else
+ {
+ buffer.append("simple producer method bean '" + getName() + "'");
+ }
+ buffer.append(" [" + getType().getName() + "] ");
+ buffer.append("API types " + getTypes() + ", binding types " + getBindings());
+ return buffer.toString();
+ }
+
+ @Override
+ public AbstractBean<?, ?> getSpecializedBean()
+ {
+ return specializedBean;
+ }
+
+ @Override
+ protected void preSpecialize()
+ {
+ if (declaringBean.getAnnotatedItem().getSuperclass().getDeclaredMethod(getAnnotatedItem().getAnnotatedMethod()) == null)
+ {
+ throw new DefinitionException("Specialized producer method does not override a method on the direct superclass");
+ }
+ }
+
+ @Override
+ protected void specialize(BeanDeployerEnvironment environment)
+ {
+ AnnotatedMethod<?> superClassMethod = declaringBean.getAnnotatedItem().getSuperclass().getMethod(getAnnotatedItem().getAnnotatedMethod());
+ if (environment.getProducerMethod(superClassMethod) == null)
+ {
+ throw new IllegalStateException(toString() + " does not specialize a bean");
+ }
+ this.specializedBean = environment.getProducerMethod(superClassMethod);
+ }
+
+ @Override
+ public String getId()
+ {
+ return id;
+ }
+
+}
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-03-31 03:54:17 UTC (rev 2278)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-03-31 07:38:18 UTC (rev 2279)
@@ -1,340 +1,361 @@
-package org.jboss.webbeans.bootstrap;
-
-import java.lang.annotation.Annotation;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.event.Observes;
-import javax.inject.BindingType;
-import javax.inject.DeploymentType;
-import javax.inject.Initializer;
-import javax.inject.Produces;
-import javax.inject.Realizes;
-
-import org.jboss.webbeans.RootManager;
-import org.jboss.webbeans.bean.AbstractClassBean;
-import org.jboss.webbeans.bean.EnterpriseBean;
-import org.jboss.webbeans.bean.NewEnterpriseBean;
-import org.jboss.webbeans.bean.NewSimpleBean;
-import org.jboss.webbeans.bean.ProducerFieldBean;
-import org.jboss.webbeans.bean.ProducerMethodBean;
-import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.ejb.EJBApiAbstraction;
-import org.jboss.webbeans.event.ObserverFactory;
-import org.jboss.webbeans.event.ObserverImpl;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedField;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.WrappedAnnotatedField;
-import org.jboss.webbeans.introspector.WrappedAnnotatedMethod;
-import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
-import org.jboss.webbeans.jpa.spi.JpaServices;
-import org.jboss.webbeans.jsf.JSFApiAbstraction;
-import org.jboss.webbeans.log.LogProvider;
-import org.jboss.webbeans.log.Logging;
-import org.jboss.webbeans.servlet.ServletApiAbstraction;
-import org.jboss.webbeans.util.Reflections;
-
-public class BeanDeployer
-{
-
- private static final LogProvider log = Logging.getLogProvider(BeanDeployer.class);
-
- private final BeanDeployerEnvironment beanDeployerEnvironment;
- private final Set<AnnotatedClass<?>> classes;
- private final RootManager manager;
-
- public BeanDeployer(RootManager manager)
- {
- this.manager = manager;
- this.beanDeployerEnvironment = new BeanDeployerEnvironment();
- this.classes = new HashSet<AnnotatedClass<?>>();
- }
-
- public <T> BeanDeployer addBean(RIBean<T> bean)
- {
- this.beanDeployerEnvironment.addBean(bean);
- return this;
- }
-
- public BeanDeployer addClass(Class<?> clazz)
- {
- if (!clazz.isAnnotation() && !clazz.isEnum())
- {
- classes.add(AnnotatedClassImpl.of(clazz));
- }
- return this;
- }
-
- public BeanDeployer addClasses(Iterable<Class<?>> classes)
- {
- for (Class<?> clazz : classes)
- {
- addClass(clazz);
- }
- return this;
- }
-
- public BeanDeployer addClasses(Collection<AnnotatedClass<?>> classes)
- {
- classes.addAll(classes);
- return this;
- }
-
- public BeanDeployer createBeans()
- {
- for (AnnotatedClass<?> clazz : classes)
- {
- if (manager.getEjbDescriptorCache().containsKey(clazz.getRawType()))
- {
- createEnterpriseBean(clazz);
- }
- else if (isTypeSimpleWebBean(clazz))
- {
- createSimpleBean(clazz);
- }
- }
- return this;
- }
-
- public BeanDeployer deploy()
- {
- Set<RIBean<?>> beans = beanDeployerEnvironment.getBeans();
- for (RIBean<?> bean : beans)
- {
- bean.initialize(beanDeployerEnvironment);
- log.info("Bean: " + bean);
- }
- manager.setBeans(beans);
- for (ObserverImpl<?> observer : beanDeployerEnvironment.getObservers())
- {
- observer.initialize();
- log.info("Observer : " + observer);
- manager.addObserver(observer);
- }
- return this;
- }
-
- public BeanDeployerEnvironment getBeanDeployerEnvironment()
- {
- return beanDeployerEnvironment;
- }
-
- /**
- * Creates a Web Bean from a bean abstraction and adds it to the set of
- * created beans
- *
- * Also creates the implicit field- and method-level beans, if present
- *
- * @param bean
- * The bean representation
- */
- protected <T> void createBean(AbstractClassBean<T> bean, final AnnotatedClass<T> annotatedClass)
- {
-
- addBean(bean);
-
- manager.getResolver().addInjectionPoints(bean.getInjectionPoints());
-
- createProducerMethods(bean, annotatedClass);
- createProducerFields(bean, annotatedClass);
- createObserverMethods(bean, annotatedClass);
- createDisposalMethods(bean, annotatedClass);
-
- if (annotatedClass.isAnnotationPresent(Realizes.class))
- {
- createRealizedProducerMethods(bean, annotatedClass);
- createRealizedProducerFields(bean, annotatedClass);
- createRealizedObserverMethods(bean, annotatedClass);
- }
- }
-
- private void createProducerMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
- {
- for (AnnotatedMethod<?> method : annotatedClass.getDeclaredAnnotatedMethods(Produces.class))
- {
- createProducerMethod(declaringBean, method);
- }
- }
-
- private void createDisposalMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
- {
-
- }
-
- private <T> void createProducerMethod(AbstractClassBean<?> declaringBean, AnnotatedMethod<T> annotatedMethod)
- {
- ProducerMethodBean<T> bean = ProducerMethodBean.of(annotatedMethod, declaringBean, manager);
- addBean(bean);
- manager.getResolver().addInjectionPoints(bean.getInjectionPoints());
- }
-
- private void createRealizedProducerMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
- {
- AnnotatedClass<?> realizedClass = realizingClass.getSuperclass();
- for (AnnotatedMethod<?> realizedMethod : realizedClass.getDeclaredAnnotatedMethods(Produces.class))
- {
- createProducerMethod(declaringBean, realizeProducerMethod(realizedMethod, realizingClass));
- }
- }
-
- private void createRealizedProducerFields(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
- {
- AnnotatedClass<?> realizedClass = realizingClass.getSuperclass();
- for (final AnnotatedField<?> realizedField : realizedClass.getDeclaredAnnotatedFields(Produces.class))
- {
- createProducerField(declaringBean, realizeProducerField(realizedField, realizingClass));
- }
- }
-
- private <T> void createProducerField(AbstractClassBean<?> declaringBean, AnnotatedField<T> field)
- {
- ProducerFieldBean<T> bean = ProducerFieldBean.of(field, declaringBean, manager);
- addBean(bean);
- }
-
- private void createProducerFields(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
- {
- for (AnnotatedField<?> field : annotatedClass.getDeclaredAnnotatedFields(Produces.class))
- {
- createProducerField(declaringBean, field);
- }
- }
-
- private void createObserverMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
- {
- for (AnnotatedMethod<?> method : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Observes.class))
- {
- createObserverMethod(declaringBean, method);
- }
- }
-
- private void createRealizedObserverMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
- {
- createObserverMethods(declaringBean, realizingClass.getSuperclass());
- }
-
- private void createObserverMethod(AbstractClassBean<?> declaringBean, AnnotatedMethod<?> method)
- {
- ObserverImpl<?> observer = ObserverFactory.create(method, declaringBean, manager);
- beanDeployerEnvironment.getObservers().add(observer);
- }
-
- private <T> void createSimpleBean(AnnotatedClass<T> annotatedClass)
- {
- SimpleBean<T> bean = SimpleBean.of(annotatedClass, manager);
- createBean(bean, annotatedClass);
- addBean(NewSimpleBean.of(annotatedClass, manager));
- }
-
- private <T> void createEnterpriseBean(AnnotatedClass<T> annotatedClass)
- {
- // TODO Don't create enterprise bean if it has no local interfaces!
- EnterpriseBean<T> bean = EnterpriseBean.of(annotatedClass, manager);
- createBean(bean, annotatedClass);
- addBean(NewEnterpriseBean.of(annotatedClass, manager));
- }
-
- /**
- * Indicates if the type is a simple Web Bean
- *
- * @param type
- * The type to inspect
- * @return True if simple Web Bean, false otherwise
- */
- private boolean isTypeSimpleWebBean(AnnotatedClass<?> clazz)
- {
- Class<?> rawType = clazz.getRawType();
- EJBApiAbstraction ejbApiAbstraction = manager.getServices().get(EJBApiAbstraction.class);
- JSFApiAbstraction jsfApiAbstraction = manager.getServices().get(JSFApiAbstraction.class);
- ServletApiAbstraction servletApiAbstraction = manager.getServices().get(ServletApiAbstraction.class);
- // TODO: check 3.2.1 for more rules!!!!!!
- return !Reflections.isAbstract(rawType) &&
- !Reflections.isParameterizedType(rawType) &&
- !servletApiAbstraction.SERVLET_CLASS.isAssignableFrom(rawType) &&
- !servletApiAbstraction.FILTER_CLASS.isAssignableFrom(rawType) &&
- !servletApiAbstraction.SERVLET_CONTEXT_LISTENER_CLASS.isAssignableFrom(rawType) &&
- !servletApiAbstraction.HTTP_SESSION_LISTENER_CLASS.isAssignableFrom(rawType) &&
- !servletApiAbstraction.SERVLET_REQUEST_LISTENER_CLASS.isAssignableFrom(rawType) &&
- !ejbApiAbstraction.ENTERPRISE_BEAN_CLASS.isAssignableFrom(rawType) &&
- !jsfApiAbstraction.UICOMPONENT_CLASS.isAssignableFrom(rawType) &&
- hasSimpleWebBeanConstructor(clazz)
- && (manager.getServices().contains(JpaServices.class) ? !manager.getServices().get(JpaServices.class).discoverEntities().contains(clazz.getRawType()) : true);
- }
-
- private static boolean hasSimpleWebBeanConstructor(AnnotatedClass<?> type)
- {
- return type.getNoArgsConstructor() != null || type.getAnnotatedConstructors(Initializer.class).size() > 0;
- }
-
- private static <T> AnnotatedMethod<T> realizeProducerMethod(final AnnotatedMethod<T> method, final AnnotatedClass<?> realizingClass)
- {
- return new WrappedAnnotatedMethod<T>(method, realizingClass.getMetaAnnotations(BindingType.class))
- {
-
- @Override
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- if (metaAnnotationType.equals(DeploymentType.class))
- {
- return realizingClass.getMetaAnnotations(DeploymentType.class);
- }
- else
- {
- return super.getMetaAnnotations(metaAnnotationType);
- }
- }
-
- @Override
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- if (metaAnnotationType.equals(DeploymentType.class))
- {
- return realizingClass.getDeclaredMetaAnnotations(DeploymentType.class);
- }
- else
- {
- return super.getDeclaredMetaAnnotations(metaAnnotationType);
- }
- }
-
- };
- }
-
- private static <T> AnnotatedField<T> realizeProducerField(final AnnotatedField<T> field, final AnnotatedClass<?> realizingClass)
- {
- return new WrappedAnnotatedField<T>(field, realizingClass.getMetaAnnotations(BindingType.class))
- {
-
- @Override
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- if (metaAnnotationType.equals(DeploymentType.class))
- {
- return realizingClass.getMetaAnnotations(DeploymentType.class);
- }
- else
- {
- return super.getMetaAnnotations(metaAnnotationType);
- }
- }
-
- @Override
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- if (metaAnnotationType.equals(DeploymentType.class))
- {
- return realizingClass.getDeclaredMetaAnnotations(DeploymentType.class);
- }
- else
- {
- return super.getDeclaredMetaAnnotations(metaAnnotationType);
- }
- }
-
- };
- }
-
-}
+package org.jboss.webbeans.bootstrap;
+
+import java.lang.annotation.Annotation;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.event.Observes;
+import javax.inject.BindingType;
+import javax.inject.DeploymentType;
+import javax.inject.Initializer;
+import javax.inject.Produces;
+import javax.inject.Realizes;
+import javax.inject.UnsatisfiedDependencyException;
+
+import org.jboss.webbeans.RootManager;
+import org.jboss.webbeans.bean.AbstractClassBean;
+import org.jboss.webbeans.bean.DisposalMethodBean;
+import org.jboss.webbeans.bean.EnterpriseBean;
+import org.jboss.webbeans.bean.NewEnterpriseBean;
+import org.jboss.webbeans.bean.NewSimpleBean;
+import org.jboss.webbeans.bean.ProducerFieldBean;
+import org.jboss.webbeans.bean.ProducerMethodBean;
+import org.jboss.webbeans.bean.RIBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.ejb.EJBApiAbstraction;
+import org.jboss.webbeans.event.ObserverFactory;
+import org.jboss.webbeans.event.ObserverImpl;
+import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.introspector.AnnotatedField;
+import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.WrappedAnnotatedField;
+import org.jboss.webbeans.introspector.WrappedAnnotatedMethod;
+import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
+import org.jboss.webbeans.jpa.spi.JpaServices;
+import org.jboss.webbeans.jsf.JSFApiAbstraction;
+import org.jboss.webbeans.log.LogProvider;
+import org.jboss.webbeans.log.Logging;
+import org.jboss.webbeans.servlet.ServletApiAbstraction;
+import org.jboss.webbeans.util.Reflections;
+
+public class BeanDeployer
+{
+
+ private static final LogProvider log = Logging.getLogProvider(BeanDeployer.class);
+
+ private final BeanDeployerEnvironment beanDeployerEnvironment;
+ private final Set<AnnotatedClass<?>> classes;
+ private final RootManager manager;
+
+ public BeanDeployer(RootManager manager)
+ {
+ this.manager = manager;
+ this.beanDeployerEnvironment = new BeanDeployerEnvironment();
+ this.classes = new HashSet<AnnotatedClass<?>>();
+ }
+
+ public <T> BeanDeployer addBean(RIBean<T> bean)
+ {
+ this.beanDeployerEnvironment.addBean(bean);
+ return this;
+ }
+
+ public BeanDeployer addClass(Class<?> clazz)
+ {
+ if (!clazz.isAnnotation() && !clazz.isEnum())
+ {
+ classes.add(AnnotatedClassImpl.of(clazz));
+ }
+ return this;
+ }
+
+ public BeanDeployer addClasses(Iterable<Class<?>> classes)
+ {
+ for (Class<?> clazz : classes)
+ {
+ addClass(clazz);
+ }
+ return this;
+ }
+
+ public BeanDeployer addClasses(Collection<AnnotatedClass<?>> classes)
+ {
+ classes.addAll(classes);
+ return this;
+ }
+
+ public BeanDeployer createBeans()
+ {
+ for (AnnotatedClass<?> clazz : classes)
+ {
+ if (manager.getEjbDescriptorCache().containsKey(clazz.getRawType()))
+ {
+ createEnterpriseBean(clazz);
+ }
+ else if (isTypeSimpleWebBean(clazz))
+ {
+ createSimpleBean(clazz);
+ }
+ }
+ return this;
+ }
+
+ public BeanDeployer deploy()
+ {
+ Set<RIBean<?>> beans = beanDeployerEnvironment.getBeans();
+ for (RIBean<?> bean : beans)
+ {
+ bean.initialize(beanDeployerEnvironment);
+ log.info("Bean: " + bean);
+ }
+ manager.setBeans(beans);
+ for (ObserverImpl<?> observer : beanDeployerEnvironment.getObservers())
+ {
+ observer.initialize();
+ log.info("Observer : " + observer);
+ manager.addObserver(observer);
+ }
+
+ // TODO: move to boot
+ checkDisposalMethods();
+
+ return this;
+ }
+
+
+ private void checkDisposalMethods() {
+ Set<DisposalMethodBean<?>> all = new HashSet<DisposalMethodBean<?>>(beanDeployerEnvironment.getAllDisposalBeans());
+ Set<DisposalMethodBean<?>> resolved = new HashSet<DisposalMethodBean<?>>(beanDeployerEnvironment.getResolvedDisposalBeans());
+ if(resolved.contains(all)) {
+ StringBuffer buff = new StringBuffer();
+ buff.append("The following Disposal methods where not resolved\n");
+ all.removeAll(resolved);
+ for(DisposalMethodBean<?> bean: all) {
+ buff.append(bean.toString());
+ }
+ throw new UnsatisfiedDependencyException(buff.toString());
+ }
+ }
+
+ public BeanDeployerEnvironment getBeanDeployerEnvironment()
+ {
+ return beanDeployerEnvironment;
+ }
+
+ /**
+ * Creates a Web Bean from a bean abstraction and adds it to the set of
+ * created beans
+ *
+ * Also creates the implicit field- and method-level beans, if present
+ *
+ * @param bean
+ * The bean representation
+ */
+ protected <T> void createBean(AbstractClassBean<T> bean, final AnnotatedClass<T> annotatedClass)
+ {
+
+ addBean(bean);
+
+ manager.getResolver().addInjectionPoints(bean.getInjectionPoints());
+
+ createProducerMethods(bean, annotatedClass);
+ createProducerFields(bean, annotatedClass);
+ createObserverMethods(bean, annotatedClass);
+ createDisposalMethods(bean, annotatedClass);
+
+ if (annotatedClass.isAnnotationPresent(Realizes.class))
+ {
+ createRealizedProducerMethods(bean, annotatedClass);
+ createRealizedProducerFields(bean, annotatedClass);
+ createRealizedObserverMethods(bean, annotatedClass);
+ }
+ }
+
+ private void createProducerMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
+ {
+ for (AnnotatedMethod<?> method : annotatedClass.getDeclaredAnnotatedMethods(Produces.class))
+ {
+ createProducerMethod(declaringBean, method);
+ }
+ }
+
+ private void createDisposalMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
+ {
+
+ }
+
+ private <T> void createProducerMethod(AbstractClassBean<?> declaringBean, AnnotatedMethod<T> annotatedMethod)
+ {
+ ProducerMethodBean<T> bean = ProducerMethodBean.of(annotatedMethod, declaringBean, manager);
+ addBean(bean);
+ manager.getResolver().addInjectionPoints(bean.getInjectionPoints());
+ }
+
+ private void createRealizedProducerMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
+ {
+ AnnotatedClass<?> realizedClass = realizingClass.getSuperclass();
+ for (AnnotatedMethod<?> realizedMethod : realizedClass.getDeclaredAnnotatedMethods(Produces.class))
+ {
+ createProducerMethod(declaringBean, realizeProducerMethod(realizedMethod, realizingClass));
+ }
+ }
+
+ private void createRealizedProducerFields(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
+ {
+ AnnotatedClass<?> realizedClass = realizingClass.getSuperclass();
+ for (final AnnotatedField<?> realizedField : realizedClass.getDeclaredAnnotatedFields(Produces.class))
+ {
+ createProducerField(declaringBean, realizeProducerField(realizedField, realizingClass));
+ }
+ }
+
+ private <T> void createProducerField(AbstractClassBean<?> declaringBean, AnnotatedField<T> field)
+ {
+ ProducerFieldBean<T> bean = ProducerFieldBean.of(field, declaringBean, manager);
+ addBean(bean);
+ }
+
+ private void createProducerFields(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
+ {
+ for (AnnotatedField<?> field : annotatedClass.getDeclaredAnnotatedFields(Produces.class))
+ {
+ createProducerField(declaringBean, field);
+ }
+ }
+
+ private void createObserverMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
+ {
+ for (AnnotatedMethod<?> method : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Observes.class))
+ {
+ createObserverMethod(declaringBean, method);
+ }
+ }
+
+ private void createRealizedObserverMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
+ {
+ createObserverMethods(declaringBean, realizingClass.getSuperclass());
+ }
+
+ private void createObserverMethod(AbstractClassBean<?> declaringBean, AnnotatedMethod<?> method)
+ {
+ ObserverImpl<?> observer = ObserverFactory.create(method, declaringBean, manager);
+ beanDeployerEnvironment.getObservers().add(observer);
+ }
+
+ private <T> void createSimpleBean(AnnotatedClass<T> annotatedClass)
+ {
+ SimpleBean<T> bean = SimpleBean.of(annotatedClass, manager);
+ createBean(bean, annotatedClass);
+ addBean(NewSimpleBean.of(annotatedClass, manager));
+ }
+
+ private <T> void createEnterpriseBean(AnnotatedClass<T> annotatedClass)
+ {
+ // TODO Don't create enterprise bean if it has no local interfaces!
+ EnterpriseBean<T> bean = EnterpriseBean.of(annotatedClass, manager);
+ createBean(bean, annotatedClass);
+ addBean(NewEnterpriseBean.of(annotatedClass, manager));
+ }
+
+ /**
+ * Indicates if the type is a simple Web Bean
+ *
+ * @param type
+ * The type to inspect
+ * @return True if simple Web Bean, false otherwise
+ */
+ private boolean isTypeSimpleWebBean(AnnotatedClass<?> clazz)
+ {
+ Class<?> rawType = clazz.getRawType();
+ EJBApiAbstraction ejbApiAbstraction = manager.getServices().get(EJBApiAbstraction.class);
+ JSFApiAbstraction jsfApiAbstraction = manager.getServices().get(JSFApiAbstraction.class);
+ ServletApiAbstraction servletApiAbstraction = manager.getServices().get(ServletApiAbstraction.class);
+ // TODO: check 3.2.1 for more rules!!!!!!
+ return !Reflections.isAbstract(rawType) &&
+ !Reflections.isParameterizedType(rawType) &&
+ !servletApiAbstraction.SERVLET_CLASS.isAssignableFrom(rawType) &&
+ !servletApiAbstraction.FILTER_CLASS.isAssignableFrom(rawType) &&
+ !servletApiAbstraction.SERVLET_CONTEXT_LISTENER_CLASS.isAssignableFrom(rawType) &&
+ !servletApiAbstraction.HTTP_SESSION_LISTENER_CLASS.isAssignableFrom(rawType) &&
+ !servletApiAbstraction.SERVLET_REQUEST_LISTENER_CLASS.isAssignableFrom(rawType) &&
+ !ejbApiAbstraction.ENTERPRISE_BEAN_CLASS.isAssignableFrom(rawType) &&
+ !jsfApiAbstraction.UICOMPONENT_CLASS.isAssignableFrom(rawType) &&
+ hasSimpleWebBeanConstructor(clazz)
+ && (manager.getServices().contains(JpaServices.class) ? !manager.getServices().get(JpaServices.class).discoverEntities().contains(clazz.getRawType()) : true);
+ }
+
+ private static boolean hasSimpleWebBeanConstructor(AnnotatedClass<?> type)
+ {
+ return type.getNoArgsConstructor() != null || type.getAnnotatedConstructors(Initializer.class).size() > 0;
+ }
+
+ private static <T> AnnotatedMethod<T> realizeProducerMethod(final AnnotatedMethod<T> method, final AnnotatedClass<?> realizingClass)
+ {
+ return new WrappedAnnotatedMethod<T>(method, realizingClass.getMetaAnnotations(BindingType.class))
+ {
+
+ @Override
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ if (metaAnnotationType.equals(DeploymentType.class))
+ {
+ return realizingClass.getMetaAnnotations(DeploymentType.class);
+ }
+ else
+ {
+ return super.getMetaAnnotations(metaAnnotationType);
+ }
+ }
+
+ @Override
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ if (metaAnnotationType.equals(DeploymentType.class))
+ {
+ return realizingClass.getDeclaredMetaAnnotations(DeploymentType.class);
+ }
+ else
+ {
+ return super.getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+ }
+
+ };
+ }
+
+ private static <T> AnnotatedField<T> realizeProducerField(final AnnotatedField<T> field, final AnnotatedClass<?> realizingClass)
+ {
+ return new WrappedAnnotatedField<T>(field, realizingClass.getMetaAnnotations(BindingType.class))
+ {
+
+ @Override
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ if (metaAnnotationType.equals(DeploymentType.class))
+ {
+ return realizingClass.getMetaAnnotations(DeploymentType.class);
+ }
+ else
+ {
+ return super.getMetaAnnotations(metaAnnotationType);
+ }
+ }
+
+ @Override
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ if (metaAnnotationType.equals(DeploymentType.class))
+ {
+ return realizingClass.getDeclaredMetaAnnotations(DeploymentType.class);
+ }
+ else
+ {
+ return super.getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+ }
+
+ };
+ }
+
+}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java 2009-03-31 03:54:17 UTC (rev 2278)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java 2009-03-31 07:38:18 UTC (rev 2279)
@@ -1,99 +1,117 @@
-package org.jboss.webbeans.bootstrap;
-
-import java.lang.annotation.Annotation;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.webbeans.bean.AbstractClassBean;
-import org.jboss.webbeans.bean.NewBean;
-import org.jboss.webbeans.bean.ProducerMethodBean;
-import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.event.ObserverImpl;
-import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-
-public class BeanDeployerEnvironment
-{
-
- private static final AnnotatedItem<?, ?> OTHER_BEANS_ANNOTATED_ITEM = ResolvableAnnotatedClass.of(BeanDeployerEnvironment.class, new Annotation[0]);
-
- private final Map<AnnotatedClass<?>, AbstractClassBean<?>> classBeanMap;
- private final Map<AnnotatedMethod<?>, ProducerMethodBean<?>> methodBeanMap;
- private final Set<RIBean<?>> beans;
- private final Set<ObserverImpl<?>> observers;
- private final Set<AnnotatedMethod<?>> disposalMethods;
-
- public BeanDeployerEnvironment()
- {
- this.classBeanMap = new HashMap<AnnotatedClass<?>, AbstractClassBean<?>>();
- this.methodBeanMap = new HashMap<AnnotatedMethod<?>, ProducerMethodBean<?>>();
- this.disposalMethods = new HashSet<AnnotatedMethod<?>>();
- this.beans = new HashSet<RIBean<?>>();
- this.observers = new HashSet<ObserverImpl<?>>();
- }
-
- public ProducerMethodBean<?> getProducerMethod(AnnotatedMethod<?> method)
- {
- if (!methodBeanMap.containsKey(method))
- {
- return null;
- }
- else
- {
- ProducerMethodBean<?> bean = methodBeanMap.get(method);
- bean.initialize(this);
- return bean;
- }
- }
-
- public AbstractClassBean<?> getClassBean(AnnotatedClass<?> clazz)
- {
- if (!classBeanMap.containsKey(clazz))
- {
- return null;
- }
- else
- {
- AbstractClassBean<?> bean = classBeanMap.get(clazz);
- bean.initialize(this);
- return bean;
- }
- }
-
- public void addBean(RIBean<?> value)
- {
-
- if (value instanceof AbstractClassBean && !(value instanceof NewBean))
- {
- AbstractClassBean<?> bean = (AbstractClassBean<?>) value;
- classBeanMap.put(bean.getAnnotatedItem(), bean);
- }
- else if (value instanceof ProducerMethodBean)
- {
- ProducerMethodBean<?> bean = (ProducerMethodBean<?>) value;
- methodBeanMap.put(bean.getAnnotatedItem(), bean);
- }
- beans.add(value);
- }
-
- public Set<RIBean<?>> getBeans()
- {
- return Collections.unmodifiableSet(beans);
- }
-
- public Set<ObserverImpl<?>> getObservers()
- {
- return observers;
- }
-
- public Set<AnnotatedMethod<?>> getDisposalMethods()
- {
- return disposalMethods;
- }
-
-}
+package org.jboss.webbeans.bootstrap;
+
+import java.lang.annotation.Annotation;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.webbeans.bean.AbstractClassBean;
+import org.jboss.webbeans.bean.DisposalMethodBean;
+import org.jboss.webbeans.bean.NewBean;
+import org.jboss.webbeans.bean.ProducerMethodBean;
+import org.jboss.webbeans.bean.RIBean;
+import org.jboss.webbeans.event.ObserverImpl;
+import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
+import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.AnnotatedMethod;
+
+public class BeanDeployerEnvironment
+{
+
+ private static final AnnotatedItem<?, ?> OTHER_BEANS_ANNOTATED_ITEM = ResolvableAnnotatedClass.of(BeanDeployerEnvironment.class, new Annotation[0]);
+
+ private final Map<AnnotatedClass<?>, AbstractClassBean<?>> classBeanMap;
+ private final Map<AnnotatedMethod<?>, ProducerMethodBean<?>> methodBeanMap;
+ private final Set<RIBean<?>> beans;
+ private final Set<ObserverImpl<?>> observers;
+ private final Set<DisposalMethodBean<?>> allDisposalBeans;
+ private final Set<DisposalMethodBean<?>> resolvedDisposalBeans;
+
+ public BeanDeployerEnvironment()
+ {
+ this.classBeanMap = new HashMap<AnnotatedClass<?>, AbstractClassBean<?>>();
+ this.methodBeanMap = new HashMap<AnnotatedMethod<?>, ProducerMethodBean<?>>();
+ this.allDisposalBeans = new HashSet<DisposalMethodBean<?>>();
+ this.resolvedDisposalBeans = new HashSet<DisposalMethodBean<?>>();
+ this.beans = new HashSet<RIBean<?>>();
+ this.observers = new HashSet<ObserverImpl<?>>();
+ }
+
+ public ProducerMethodBean<?> getProducerMethod(AnnotatedMethod<?> method)
+ {
+ if (!methodBeanMap.containsKey(method))
+ {
+ return null;
+ }
+ else
+ {
+ ProducerMethodBean<?> bean = methodBeanMap.get(method);
+ bean.initialize(this);
+ return bean;
+ }
+ }
+
+ public AbstractClassBean<?> getClassBean(AnnotatedClass<?> clazz)
+ {
+ if (!classBeanMap.containsKey(clazz))
+ {
+ return null;
+ }
+ else
+ {
+ AbstractClassBean<?> bean = classBeanMap.get(clazz);
+ bean.initialize(this);
+ return bean;
+ }
+ }
+
+ public void addBean(RIBean<?> value)
+ {
+
+ if (value instanceof AbstractClassBean && !(value instanceof NewBean))
+ {
+ AbstractClassBean<?> bean = (AbstractClassBean<?>) value;
+ classBeanMap.put(bean.getAnnotatedItem(), bean);
+ }
+ else if (value instanceof ProducerMethodBean)
+ {
+ ProducerMethodBean<?> bean = (ProducerMethodBean<?>) value;
+ methodBeanMap.put(bean.getAnnotatedItem(), bean);
+ }
+ beans.add(value);
+ }
+
+ public Set<RIBean<?>> getBeans()
+ {
+ return Collections.unmodifiableSet(beans);
+ }
+
+ public Set<ObserverImpl<?>> getObservers()
+ {
+ return observers;
+ }
+
+ public Set<DisposalMethodBean<?>> getAllDisposalBeans()
+ {
+ return allDisposalBeans;
+ }
+
+ public void addAllDisposalBean(DisposalMethodBean<?> disposalBean)
+ {
+ allDisposalBeans.add(disposalBean);
+ }
+
+ public void addResolvedDisposalBean(DisposalMethodBean<?> disposalBean)
+ {
+ resolvedDisposalBeans.add(disposalBean);
+ }
+
+ public Set<DisposalMethodBean<?>> getResolvedDisposalBeans()
+ {
+ return resolvedDisposalBeans;
+ }
+
+}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-03-31 03:54:17 UTC (rev 2278)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-03-31 07:38:18 UTC (rev 2279)
@@ -74,7 +74,7 @@
{
initNewBean();
Class<?> type = TypeInfo.ofTypes(newEnterpriseBean.getTypes()).getSuperClass();
- assert manager.resolveDisposalMethods(type, newEnterpriseBean.getBindings().toArray(new Annotation[0])).isEmpty();
+ assert manager.resolveDisposalBeans(type, newEnterpriseBean.getBindings().toArray(new Annotation[0])).isEmpty();
}
}
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2278 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-30 23:54:17 -0400 (Mon, 30 Mar 2009)
New Revision: 2278
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BakedBean_Broken.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Other.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherBinding.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
Log:
5.7.1 tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BakedBean_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BakedBean_Broken.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BakedBean_Broken.java 2009-03-31 03:54:17 UTC (rev 2278)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
+public class BakedBean_Broken
+{
+ /*
+ * private constructor makes this bean unproxyable
+ */
+ private BakedBean_Broken()
+ {
+
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/BrokenInjectedBean.java 2009-03-31 03:54:17 UTC (rev 2278)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
+import javax.inject.Current;
+
+class BrokenInjectedBean
+{
+ @Current public BakedBean_Broken bakedBean;
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java 2009-03-31 02:43:36 UTC (rev 2277)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java 2009-03-31 03:54:17 UTC (rev 2278)
@@ -3,7 +3,7 @@
import javax.inject.AnnotationLiteral;
import javax.inject.Current;
-public class CurrentBinding extends AnnotationLiteral<Current> implements Current
+class CurrentBinding extends AnnotationLiteral<Current> implements Current
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-03-31 02:43:36 UTC (rev 2277)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-03-31 03:54:17 UTC (rev 2278)
@@ -7,10 +7,13 @@
import java.util.HashSet;
import java.util.Set;
+import javax.inject.UnproxyableDependencyException;
+import javax.inject.UnsatisfiedDependencyException;
import javax.inject.manager.Bean;
import javax.inject.manager.InjectionPoint;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -71,7 +74,10 @@
}
@Test
- @SpecAssertion(section = "5.7.1", id = "c")
+ @SpecAssertions({
+ @SpecAssertion(section = "5.7.1", id = "c"),
+ @SpecAssertion(section = "5.7.1", id = "d")
+ })
public void testGetInstanceToInjectReturnsContextualInstance() throws Exception
{
Bean<Vanilla> vanillaBean = getCurrentManager().resolveByType(Vanilla.class).iterator().next();
@@ -83,4 +89,44 @@
assert getCurrentManager().getInstanceToInject(injectionPoint) instanceof Vanilla;
}
+
+ @Test(expectedExceptions = UnsatisfiedDependencyException.class)
+ @SpecAssertion(section = "5.7.1", id = "e")
+ public void testGetInstanceToInjectThrowsUnsatisfiedDependencyException() throws Exception
+ {
+ Bean<Vanilla> vanillaBean = getCurrentManager().resolveByType(Vanilla.class).iterator().next();
+
+ Field injectedField = InjectedBean.class.getField("vanilla");
+ Set<Annotation> bindings = new HashSet<Annotation>();
+ bindings.add(new OtherBinding());
+ MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean, Vanilla.class, injectedField, bindings);
+
+ assert getCurrentManager().getInstanceToInject(injectionPoint) instanceof Vanilla;
+ }
+
+ @Test(expectedExceptions = UnsatisfiedDependencyException.class)
+ @SpecAssertion(section = "5.7.1", id = "f")
+ public void testGetInstanceToInjectThrowsAmbiguousDependencyException() throws Exception
+ {
+ Bean<Vanilla> vanillaBean = getCurrentManager().resolveByType(Vanilla.class).iterator().next();
+
+ Field injectedField = InjectedBean.class.getField("vanilla");
+ Set<Annotation> bindings = new HashSet<Annotation>();
+ bindings.add(new OtherBinding());
+ MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean, Vanilla.class, injectedField, bindings);
+ getCurrentManager().getInstanceToInject(injectionPoint);
+ }
+
+ @Test(expectedExceptions = UnproxyableDependencyException.class, groups = "ri-broken")
+ @SpecAssertion(section = "5.7.1", id = "g")
+ public void testGetInstanceToInjectThrowsUnproxyableDependencyException() throws Exception
+ {
+ Bean<BakedBean_Broken> bakedBean = getCurrentManager().resolveByType(BakedBean_Broken.class).iterator().next();
+
+ Field injectedField = BrokenInjectedBean.class.getField("bakedBean");
+ Set<Annotation> bindings = new HashSet<Annotation>();
+ bindings.add(new CurrentBinding());
+ MockInjectionPoint injectionPoint = new MockInjectionPoint(bakedBean, BakedBean_Broken.class, injectedField, bindings);
+ getCurrentManager().getInstanceToInject(injectionPoint);
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Other.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Other.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Other.java 2009-03-31 03:54:17 UTC (rev 2278)
@@ -0,0 +1,23 @@
+package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+public @interface Other
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/OtherBinding.java 2009-03-31 03:54:17 UTC (rev 2278)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
+import javax.inject.AnnotationLiteral;
+
+class OtherBinding extends AnnotationLiteral<Other> implements Other
+{
+
+}
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2277 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup: dependency and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-30 22:43:36 -0400 (Mon, 30 Mar 2009)
New Revision: 2277
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/InjectedBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java
Log:
test for 5.7.1.c
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/CurrentBinding.java 2009-03-31 02:43:36 UTC (rev 2277)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
+import javax.inject.AnnotationLiteral;
+import javax.inject.Current;
+
+public class CurrentBinding extends AnnotationLiteral<Current> implements Current
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-03-31 02:43:36 UTC (rev 2277)
@@ -0,0 +1,86 @@
+package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.inject.manager.Bean;
+import javax.inject.manager.InjectionPoint;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+@Artifact
+public class DependencyResolutionTest extends AbstractJSR299Test
+{
+ class MockInjectionPoint implements InjectionPoint
+ {
+ private Bean<?> bean;
+ private Type type;
+ private Member member;
+ private Set<Annotation> bindings;
+
+ public MockInjectionPoint(Bean<?> bean, Type type, Member member,
+ Set<Annotation> bindings)
+ {
+ this.bean = bean;
+ this.type = type;
+ this.member = member;
+ this.bindings = bindings;
+ }
+
+ public <T extends Annotation> T getAnnotation(Class<T> arg0)
+ {
+ return null;
+ }
+
+ public Annotation[] getAnnotations()
+ {
+ return null;
+ }
+
+ public Bean<?> getBean()
+ {
+ return bean;
+ }
+
+ public Set<Annotation> getBindings()
+ {
+ return bindings;
+ }
+
+ public Member getMember()
+ {
+ return member;
+ }
+
+ public Type getType()
+ {
+ return type;
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> arg0)
+ {
+ return false;
+ }
+ }
+
+ @Test
+ @SpecAssertion(section = "5.7.1", id = "c")
+ public void testGetInstanceToInjectReturnsContextualInstance() throws Exception
+ {
+ Bean<Vanilla> vanillaBean = getCurrentManager().resolveByType(Vanilla.class).iterator().next();
+
+ Field injectedField = InjectedBean.class.getField("vanilla");
+ Set<Annotation> bindings = new HashSet<Annotation>();
+ bindings.add(new CurrentBinding());
+ MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean, Vanilla.class, injectedField, bindings);
+
+ assert getCurrentManager().getInstanceToInject(injectionPoint) instanceof Vanilla;
+ }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/InjectedBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/InjectedBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/InjectedBean.java 2009-03-31 02:43:36 UTC (rev 2277)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
+import javax.inject.Current;
+
+class InjectedBean
+{
+ @Current public Vanilla vanilla;
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/Vanilla.java 2009-03-31 02:43:36 UTC (rev 2277)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.lookup.dependency.resolution;
+
+class Vanilla
+{
+
+}
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2276 - doc/trunk/reference/it-IT.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2009-03-30 16:02:12 -0400 (Mon, 30 Mar 2009)
New Revision: 2276
Modified:
doc/trunk/reference/it-IT/environments.po
doc/trunk/reference/it-IT/extensions.po
doc/trunk/reference/it-IT/producermethods.po
Log:
Italian translation
Modified: doc/trunk/reference/it-IT/environments.po
===================================================================
--- doc/trunk/reference/it-IT/environments.po 2009-03-30 19:49:39 UTC (rev 2275)
+++ doc/trunk/reference/it-IT/environments.po 2009-03-30 20:02:12 UTC (rev 2276)
@@ -6,8 +6,8 @@
"Project-Id-Version: Web_Beans:_Java_Contexts_and_Dependency_Injection VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2009-03-28 17:09+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-03-30 21:57+0100\n"
+"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -28,27 +28,20 @@
#. Tag: para
#: environments.xml:9
#, no-c-format
-msgid ""
-"No special configuration of your application, beyond adding either "
-"<literal>META-INF/beans.xml</literal> or <literal>WEB-INF/beans.xml</"
-"literal> is needed."
+msgid "No special configuration of your application, beyond adding either <literal>META-INF/beans.xml</literal> or <literal>WEB-INF/beans.xml</literal> is needed."
msgstr ""
#. Tag: para
#: environments.xml:15
#, no-c-format
-msgid ""
-"If you are using JBoss AS 5.0.1.GA then you'll need to install Web Beans as "
-"an extra. First we need to tell Web Beans where JBoss is located. Edit "
-"<literal>jboss-as/build.properties</literal> and set the <literal>jboss."
-"home</literal> property. For example:"
+msgid "If you are using JBoss AS 5.0.1.GA then you'll need to install Web Beans as an extra. First we need to tell Web Beans where JBoss is located. Edit <literal>jboss-as/build.properties</literal> and set the <literal>jboss.home</literal> property. For example:"
msgstr ""
#. Tag: programlisting
#: environments.xml:22
#, no-c-format
msgid "jboss.home=/Applications/jboss-5.0.1.GA"
-msgstr ""
+msgstr "jboss.home=/Applications/jboss-5.0.1.GA"
#. Tag: para
#: environments.xml:24
@@ -63,15 +56,13 @@
"$ cd webbeans-$VERSION/jboss-as\n"
"$ ant update"
msgstr ""
+"$ cd webbeans-$VERSION/jboss-as\n"
+"$ ant update"
#. Tag: para
#: environments.xml:31
#, no-c-format
-msgid ""
-"A new deployer, <literal>webbeans.deployer</literal> is added to JBoss AS. "
-"This adds supports for JSR-299 deployments to JBoss AS, and allows Web Beans "
-"to query the EJB3 container and discover which EJBs are installed in your "
-"application."
+msgid "A new deployer, <literal>webbeans.deployer</literal> is added to JBoss AS. This adds supports for JSR-299 deployments to JBoss AS, and allows Web Beans to query the EJB3 container and discover which EJBs are installed in your application."
msgstr ""
#. Tag: para
@@ -84,19 +75,20 @@
#: environments.xml:47
#, no-c-format
msgid "Glassfish"
-msgstr ""
+msgstr "Glassfish"
#. Tag: para
-#: environments.xml:49 environments.xml:151
+#: environments.xml:49
+#: environments.xml:151
#, no-c-format
msgid "TODO"
-msgstr ""
+msgstr "DA FARE"
#. Tag: title
#: environments.xml:53
#, no-c-format
msgid "Tomcat"
-msgstr ""
+msgstr "Tomcat"
#. Tag: para
#: environments.xml:55
@@ -107,78 +99,67 @@
#. Tag: para
#: environments.xml:58
#, no-c-format
-msgid ""
-"Web Beans doesn't support deploying session beans, injection using "
-"<literal>@EJB</literal>, <literal>@Resource</literal>, or "
-"<literal>@PersistenceContext</literal> or using transactional events on "
-"Tomcat."
+msgid "Web Beans doesn't support deploying session beans, injection using <literal>@EJB</literal>, <literal>@Resource</literal>, or <literal>@PersistenceContext</literal> or using transactional events on Tomcat."
msgstr ""
#. Tag: para
#: environments.xml:66
#, no-c-format
-msgid ""
-"Web Beans should be used as a web application library in Tomcat. You should "
-"place <literal>webbeans-tomcat.jar</literal> in <literal>WEB-INF/lib</"
-"literal>. <literal>webbeans-tomcat.jar</literal> is an \"uber-jar\" provided "
-"for your convenience. Instead, you could use it's component jars:"
+msgid "Web Beans should be used as a web application library in Tomcat. You should place <literal>webbeans-tomcat.jar</literal> in <literal>WEB-INF/lib</literal>. <literal>webbeans-tomcat.jar</literal> is an \"uber-jar\" provided for your convenience. Instead, you could use it's component jars:"
msgstr ""
#. Tag: literal
#: environments.xml:77
#, no-c-format
msgid "jsr299-api.jar"
-msgstr ""
+msgstr "jsr299-api.jar"
#. Tag: literal
#: environments.xml:82
#, no-c-format
msgid "webbeans-api.jar"
-msgstr ""
+msgstr "webbeans-api.jar"
#. Tag: literal
#: environments.xml:87
#, no-c-format
msgid "webbeans-spi.jar"
-msgstr ""
+msgstr "webbeans-spi.jar"
#. Tag: literal
#: environments.xml:92
#, no-c-format
msgid "webbeans-core.jar"
-msgstr ""
+msgstr "webbeans-core.jar"
#. Tag: literal
#: environments.xml:97
#, no-c-format
msgid "webbeans-logging.jar"
-msgstr ""
+msgstr "webbeans-logging.jar"
#. Tag: literal
#: environments.xml:102
#, no-c-format
msgid "webbeans-tomcat-int.jar"
-msgstr ""
+msgstr "webbeans-tomcat-int.jar"
#. Tag: literal
#: environments.xml:107
#, no-c-format
msgid "javassist.jar"
-msgstr ""
+msgstr "javassist.jar"
#. Tag: literal
#: environments.xml:112
#, no-c-format
msgid "dom4j.jar"
-msgstr ""
+msgstr "dom4j.jar"
#. Tag: para
#: environments.xml:117
#, no-c-format
-msgid ""
-"You also need to explicitly specify the Tomcat servlet listener (used to "
-"boot Web Beans, and control it's interaction with requests) in <literal>web."
-"xml</literal>:"
+msgid "You also need to explicitly specify the Tomcat servlet listener (used to boot Web Beans, and control it's interaction with requests) in <literal>web.xml</literal>:"
msgstr ""
#. Tag: programlisting
@@ -186,18 +167,17 @@
#, no-c-format
msgid ""
"<![CDATA[<listener>\n"
-" <listener-class>org.jboss.webbeans.environment.tomcat.Listener</listener-"
-"class>\n"
+" <listener-class>org.jboss.webbeans.environment.tomcat.Listener</listener-class>\n"
"</listener>]]>"
msgstr ""
+"<![CDATA[<listener>\n"
+" <listener-class>org.jboss.webbeans.environment.tomcat.Listener</listener-class>\n"
+"</listener>]]>"
#. Tag: para
#: environments.xml:125
#, no-c-format
-msgid ""
-"Tomcat has a read-only JNDI, so Web Beans can't automatically bind the "
-"Manager. To bind the Manager into JNDI, you should add the following to your "
-"<literal>META-INF/context.xml</literal>:"
+msgid "Tomcat has a read-only JNDI, so Web Beans can't automatically bind the Manager. To bind the Manager into JNDI, you should add the following to your <literal>META-INF/context.xml</literal>:"
msgstr ""
#. Tag: programlisting
@@ -210,13 +190,16 @@
" factory=\"org.jboss.webbeans.resources.ManagerObjectFactory\"/>\n"
"]]>"
msgstr ""
+"<![CDATA[<Resource name=\"app/Manager\" \n"
+" auth=\"Container\"\n"
+" type=\"javax.inject.manager.Manager\"\n"
+" factory=\"org.jboss.webbeans.resources.ManagerObjectFactory\"/>\n"
+"]]>"
#. Tag: para
#: environments.xml:133
#, no-c-format
-msgid ""
-"and make it available to your deployment by adding this to <literal>web.xml</"
-"literal>:"
+msgid "and make it available to your deployment by adding this to <literal>web.xml</literal>:"
msgstr ""
#. Tag: programlisting
@@ -232,18 +215,24 @@
" </resource-env-ref-type>\n"
"</resource-env-ref>]]>"
msgstr ""
+"<![CDATA[<resource-env-ref>\n"
+" <resource-env-ref-name>\n"
+" app/Manager\n"
+" </resource-env-ref-name>\n"
+" <resource-env-ref-type>\n"
+" javax.inject.manager.Manager\n"
+" </resource-env-ref-type>\n"
+"</resource-env-ref>]]>"
#. Tag: para
#: environments.xml:140
#, no-c-format
-msgid ""
-"Tomcat doesn't only allows you to bind entries to <literal>java:comp/env</"
-"literal>, so the Manager will be available at <literal>java:comp/env/app/"
-"Manager</literal>"
+msgid "Tomcat doesn't only allows you to bind entries to <literal>java:comp/env</literal>, so the Manager will be available at <literal>java:comp/env/app/Manager</literal>"
msgstr ""
#. Tag: title
#: environments.xml:149
#, no-c-format
msgid "Java SE"
-msgstr ""
+msgstr "Java SE"
+
Modified: doc/trunk/reference/it-IT/extensions.po
===================================================================
--- doc/trunk/reference/it-IT/extensions.po 2009-03-30 19:49:39 UTC (rev 2275)
+++ doc/trunk/reference/it-IT/extensions.po 2009-03-30 20:02:12 UTC (rev 2276)
@@ -6,8 +6,8 @@
"Project-Id-Version: Web_Beans:_Java_Contexts_and_Dependency_Injection VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2009-03-28 17:09+0000\n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2009-03-30 21:59+0100\n"
+"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -17,29 +17,30 @@
#: extensions.xml:4
#, no-c-format
msgid "JSR-299 extensions available as part of Web Beans"
-msgstr ""
+msgstr "Estensioni JSR-299 disponibili come parte di Web Beans"
#. Tag: para
#: extensions.xml:7
#, no-c-format
-msgid ""
-"These modules are usable on any JSR-299 implementation, not just Web Beans!"
-msgstr ""
+msgid "These modules are usable on any JSR-299 implementation, not just Web Beans!"
+msgstr "Questi moduli sono utilizzabili su qualsiasi implementazione JSR-299, non solo Web Beans!"
#. Tag: title
#: extensions.xml:15
#, no-c-format
msgid "Web Beans Logger"
-msgstr ""
+msgstr "Web Beans Logger"
#. Tag: para
-#: extensions.xml:17 extensions.xml:26
+#: extensions.xml:17
+#: extensions.xml:26
#, no-c-format
msgid "TODO"
-msgstr ""
+msgstr "DA FARE"
#. Tag: title
#: extensions.xml:24
#, no-c-format
msgid "XSD Generator for JSR-299 XML deployment descriptors"
-msgstr ""
+msgstr "Generatore XSD per descrittori di deploy XML JSR-299"
+
Modified: doc/trunk/reference/it-IT/producermethods.po
===================================================================
--- doc/trunk/reference/it-IT/producermethods.po 2009-03-30 19:49:39 UTC (rev 2275)
+++ doc/trunk/reference/it-IT/producermethods.po 2009-03-30 20:02:12 UTC (rev 2276)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2008-12-21 10:30+0100\n"
+"PO-Revision-Date: 2009-03-30 22:01+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -22,18 +22,8 @@
#. Tag: para
#: producermethods.xml:7
#, no-c-format
-msgid ""
-"Producer methods let us overcome certain limitations that arise when the Web "
-"Bean manager, instead of the application, is responsible for instantiating "
-"objects. They're also the easiest way to integrate objects which are not Web "
-"Beans into the Web Beans environment. (We'll meet a second approach in <xref "
-"linkend=\"xml\"/>.)"
-msgstr ""
-"I metodi produttori consentono di superare alcune limitazioni che sorgono "
-"quando il manager Web Bean è responsabile dell'istanziamento degli oggetti "
-"al posto dell'applicazione. Questi metodi sono anche il modo migliore per "
-"integrare gli oggetti che non sono Web Beans dentro l'ambiente Web Beans. "
-"(Si incontrerà un secondo approccio in <xref linkend=\"xml\"/>.)"
+msgid "Producer methods let us overcome certain limitations that arise when the Web Bean manager, instead of the application, is responsible for instantiating objects. They're also the easiest way to integrate objects which are not Web Beans into the Web Beans environment. (We'll meet a second approach in <xref linkend=\"xml\"/>.)"
+msgstr "I metodi produttori consentono di superare alcune limitazioni che sorgono quando il manager Web Bean è responsabile dell'istanziamento degli oggetti al posto dell'applicazione. Questi metodi sono anche il modo migliore per integrare gli oggetti che non sono Web Beans dentro l'ambiente Web Beans. (Si incontrerà un secondo approccio in <xref linkend=\"xml\"/>.)"
#. Tag: para
#: producermethods.xml:12
@@ -44,16 +34,13 @@
#. Tag: para
#: producermethods.xml:16
#, no-c-format
-msgid ""
-"A Web Beans producer method acts as a source of objects to be injected, "
-"where:"
+msgid "A Web Beans producer method acts as a source of objects to be injected, where:"
msgstr ""
#. Tag: para
#: producermethods.xml:20
#, no-c-format
-msgid ""
-"the objects to be injected are not required to be instances of Web Beans,"
+msgid "the objects to be injected are not required to be instances of Web Beans,"
msgstr ""
#. Tag: para
@@ -65,16 +52,14 @@
#. Tag: para
#: producermethods.xml:26
#, no-c-format
-msgid ""
-"the objects require some custom initialization that is not performed by the "
-"Web Bean constructor"
+msgid "the objects require some custom initialization that is not performed by the Web Bean constructor"
msgstr ""
#. Tag: para
#: producermethods.xml:33
-#, fuzzy, no-c-format
+#, no-c-format
msgid "For example, producer methods let us:"
-msgstr "Scope di un metodo produttore"
+msgstr "Per esempio, i metodi produttori consentono di:"
#. Tag: para
#: producermethods.xml:37
@@ -91,9 +76,7 @@
#. Tag: para
#: producermethods.xml:43
#, no-c-format
-msgid ""
-"define multiple Web Beans, with different scopes or initialization, for the "
-"same implementation class, or"
+msgid "define multiple Web Beans, with different scopes or initialization, for the same implementation class, or"
msgstr ""
#. Tag: para
@@ -105,17 +88,12 @@
#. Tag: para
#: producermethods.xml:51
#, no-c-format
-msgid ""
-"In particular, producer methods let us use runtime polymorphism with Web "
-"Beans. As we've seen, deployment types are a powerful solution to the "
-"problem of deployment-time polymorphism. But once the system is deployed, "
-"the Web Bean implementation is fixed. A producer method has no such "
-"limitation:"
+msgid "In particular, producer methods let us use runtime polymorphism with Web Beans. As we've seen, deployment types are a powerful solution to the problem of deployment-time polymorphism. But once the system is deployed, the Web Bean implementation is fixed. A producer method has no such limitation:"
msgstr ""
#. Tag: programlisting
#: producermethods.xml:56
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"<![CDATA[@SessionScoped\n"
"public class Preferences {\n"
@@ -136,16 +114,23 @@
" \n"
"}]]>"
msgstr ""
-"<![CDATA[@Produces @Preferred @SessionScoped\n"
-"public PaymentStrategy getPaymentStrategy(CreditCardPaymentStrategy ccps,\n"
-" ChequePaymentStrategy cps,\n"
-" PayPalPaymentStrategy ppps) {\n"
-" switch (paymentStrategy) {\n"
-" case CREDIT_CARD: return ccps;\n"
-" case CHEQUE: return cps;\n"
-" case PAYPAL: return ppps;\n"
-" default: return null;\n"
-" } \n"
+"<![CDATA[@SessionScoped\n"
+"public class Preferences {\n"
+" \n"
+" private PaymentStrategyType paymentStrategy;\n"
+" \n"
+" ...\n"
+" \n"
+" @Produces @Preferred \n"
+" public PaymentStrategy getPaymentStrategy() {\n"
+" switch (paymentStrategy) {\n"
+" case CREDIT_CARD: return new CreditCardPaymentStrategy();\n"
+" case CHEQUE: return new ChequePaymentStrategy();\n"
+" case PAYPAL: return new PayPalPaymentStrategy();\n"
+" default: return null;\n"
+" } \n"
+" }\n"
+" \n"
"}]]>"
#. Tag: para
@@ -156,29 +141,21 @@
#. Tag: programlisting
#: producermethods.xml:60
-#, fuzzy, no-c-format
+#, no-c-format
msgid "<![CDATA[@Preferred PaymentStrategy paymentStrat;]]>"
-msgstr ""
-"<![CDATA[@Produces @Preferred @SessionScoped\n"
-"public PaymentStrategy getPaymentStrategy() {\n"
-" ...\n"
-"}]]>"
+msgstr "<![CDATA[@Preferred PaymentStrategy paymentStrat;]]>"
#. Tag: para
#: producermethods.xml:62
#, no-c-format
-msgid ""
-"This injection point has the same type and binding annotations as the "
-"producer method, so it resolves to the producer method using the usual Web "
-"Beans injection rules. The producer method will be called by the Web Bean "
-"manager to obtain an instance to service this injection point."
+msgid "This injection point has the same type and binding annotations as the producer method, so it resolves to the producer method using the usual Web Beans injection rules. The producer method will be called by the Web Bean manager to obtain an instance to service this injection point."
msgstr ""
#. Tag: chapter
#: producermethods.xml:65
#, no-c-format
msgid "<chapter>.</chapter>"
-msgstr ""
+msgstr "<chapter>.</chapter>"
#. Tag: title
#: producermethods.xml:68
@@ -189,28 +166,14 @@
#. Tag: para
#: producermethods.xml:70
#, no-c-format
-msgid ""
-"The scope of the producer method defaults to <literal>@Dependent</literal>, "
-"and so it will be called <emphasis>every time</emphasis> the Web Bean "
-"manager injects this field or any other field that resolves to the same "
-"producer method. Thus, there could be multiple instances of the "
-"<literal>PaymentStrategy</literal> object for each user session."
-msgstr ""
-"Lo scope dei metodi produttori è di default impostato a <literal>@Dependent</"
-"literal>, e quindi verrà chiamato <emphasis>ogni volta</emphasis> che il "
-"manager Web Bean inietta questo campo o qualsiasi altro campi che risolve lo "
-"stesso metodo produttore. Quindi ci potrebbero essere istanze multiple "
-"dell'oggetto <literal>PaymentStrategy</literal> per ogni sessione utente."
+msgid "The scope of the producer method defaults to <literal>@Dependent</literal>, and so it will be called <emphasis>every time</emphasis> the Web Bean manager injects this field or any other field that resolves to the same producer method. Thus, there could be multiple instances of the <literal>PaymentStrategy</literal> object for each user session."
+msgstr "Lo scope dei metodi produttori è di default impostato a <literal>@Dependent</literal>, e quindi verrà chiamato <emphasis>ogni volta</emphasis> che il manager Web Bean inietta questo campo o qualsiasi altro campi che risolve lo stesso metodo produttore. Quindi ci potrebbero essere istanze multiple dell'oggetto <literal>PaymentStrategy</literal> per ogni sessione utente."
#. Tag: para
#: producermethods.xml:75
#, no-c-format
-msgid ""
-"To change this behavior, we can add a <literal>@SessionScoped</literal> "
-"annotation to the method."
-msgstr ""
-"Per cambiare questo comportamento si può aggiungere un'annotazione "
-"<literal>@SessionScoped</literal> al metodo."
+msgid "To change this behavior, we can add a <literal>@SessionScoped</literal> annotation to the method."
+msgstr "Per cambiare questo comportamento si può aggiungere un'annotazione <literal>@SessionScoped</literal> al metodo."
#. Tag: programlisting
#: producermethods.xml:78
@@ -229,14 +192,8 @@
#. Tag: para
#: producermethods.xml:80
#, no-c-format
-msgid ""
-"Now, when the producer method is called, the returned "
-"<literal>PaymentStrategy</literal> will be bound to the session context. The "
-"producer method won't be called again in the same session."
-msgstr ""
-"Ora, quando il metodo produttore viene chiamato, il "
-"<literal>PaymentStrategy</literal> restituito verrà associato al contesto di "
-"sessione. Il metodo produttore non verrà più chiamato nella stessa sessione."
+msgid "Now, when the producer method is called, the returned <literal>PaymentStrategy</literal> will be bound to the session context. The producer method won't be called again in the same session."
+msgstr "Ora, quando il metodo produttore viene chiamato, il <literal>PaymentStrategy</literal> restituito verrà associato al contesto di sessione. Il metodo produttore non verrà più chiamato nella stessa sessione."
#. Tag: title
#: producermethods.xml:87
@@ -247,28 +204,14 @@
#. Tag: para
#: producermethods.xml:89
#, no-c-format
-msgid ""
-"There's one potential problem with the code above. The implementations of "
-"<literal>CreditCardPaymentStrategy</literal> are instantiated using the Java "
-"<literal>new</literal> operator. Objects instantiated directly by the "
-"application can't take advantage of dependency injection and don't have "
-"interceptors."
-msgstr ""
-"C'è un potenziale problema con il codice visto sopra. Le implementazioni di "
-"<literal>CreditCardPaymentStrategy</literal> vengono istanziate usando "
-"l'operatore Java <literal>new</literal>. Gli oggetti istanziati direttamente "
-"dall'applicazione non possono sfruttare la dependency injection e non hanno "
-"interceptor."
+msgid "There's one potential problem with the code above. The implementations of <literal>CreditCardPaymentStrategy</literal> are instantiated using the Java <literal>new</literal> operator. Objects instantiated directly by the application can't take advantage of dependency injection and don't have interceptors."
+msgstr "C'è un potenziale problema con il codice visto sopra. Le implementazioni di <literal>CreditCardPaymentStrategy</literal> vengono istanziate usando l'operatore Java <literal>new</literal>. Gli oggetti istanziati direttamente dall'applicazione non possono sfruttare la dependency injection e non hanno interceptor."
#. Tag: para
#: producermethods.xml:94
#, no-c-format
-msgid ""
-"If this isn't what we want we can use dependency injection into the producer "
-"method to obtain Web Bean instances:"
-msgstr ""
-"Se questo non è ciò che si vuole, è possibile usare la dependency injection "
-"nel metodo produttore per ottenere istanze Web Bean:"
+msgid "If this isn't what we want we can use dependency injection into the producer method to obtain Web Bean instances:"
+msgstr "Se questo non è ciò che si vuole, è possibile usare la dependency injection nel metodo produttore per ottenere istanze Web Bean:"
#. Tag: programlisting
#: producermethods.xml:97
@@ -301,50 +244,20 @@
#. Tag: para
#: producermethods.xml:99
#, no-c-format
-msgid ""
-"Wait, what if <literal>CreditCardPaymentStrategy</literal> is a request "
-"scoped Web Bean? Then the producer method has the effect of \"promoting\" "
-"the current request scoped instance into session scope. This is almost "
-"certainly a bug! The request scoped object will be destroyed by the Web Bean "
-"manager before the session ends, but the reference to the object will be "
-"left \"hanging\" in the session scope. This error will <emphasis>not</"
-"emphasis> be detected by the Web Bean manager, so please take extra care "
-"when returning Web Bean instances from producer methods!"
-msgstr ""
-"Ma cosa succede se <literal>CreditCardPaymentStrategy</literal> è un Web "
-"Bean con scope di tipo richiesta? Il metodo produttore ha l'effetto di "
-"\"promuovere\" l'istanza corrente con scope di tipo richiesta a scope di "
-"tipo sessione. Questo è quasi certamente un bug! L'oggetto con scope "
-"richiesta verrà distrutto dal manager Web Bean prima che la sessione "
-"termini. Quest'errore <emphasis>non</emphasis> verrà rilevato dal manager "
-"Web Bean, quindi si faccia attenzione quando si restituiscono istanze Web "
-"Bean dai metodi produttori!"
+msgid "Wait, what if <literal>CreditCardPaymentStrategy</literal> is a request scoped Web Bean? Then the producer method has the effect of \"promoting\" the current request scoped instance into session scope. This is almost certainly a bug! The request scoped object will be destroyed by the Web Bean manager before the session ends, but the reference to the object will be left \"hanging\" in the session scope. This error will <emphasis>not</emphasis> be detected by the Web Bean manager, so please take extra care when returning Web Bean instances from producer methods!"
+msgstr "Ma cosa succede se <literal>CreditCardPaymentStrategy</literal> è un Web Bean con scope di tipo richiesta? Il metodo produttore ha l'effetto di \"promuovere\" l'istanza corrente con scope di tipo richiesta a scope di tipo sessione. Questo è quasi certamente un bug! L'oggetto con scope richiesta verrà distrutto dal manager Web Bean prima che la sessione termini. Quest'errore <emphasis>non</emphasis> verrà rilevato dal manager Web Bean, quindi si faccia attenzione quando si restituiscono istanze Web Bean dai metodi produttori!"
#. Tag: para
#: producermethods.xml:107
#, no-c-format
-msgid ""
-"There's at least three ways we could go about fixing this bug. We could "
-"change the scope of the <literal>CreditCardPaymentStrategy</literal> "
-"implementation, but this would affect other clients of that Web Bean. A "
-"better option would be to change the scope of the producer method to "
-"<literal>@Dependent</literal> or <literal>@RequestScoped</literal>."
-msgstr ""
-"Ci sono almeno 3 modi per correggere questo bug. Si può cambiare lo scope "
-"dell'implementazione di <literal>CreditCardPaymentStrategy</literal>, ma "
-"questo non influenzerebbe gli altri client di questo Web Bean. Un'opzione "
-"migliore sarebbe quella di cambiare lo scope del metodo produttore a "
-"<literal>@Dependent</literal> o <literal>@RequestScoped</literal>."
+msgid "There's at least three ways we could go about fixing this bug. We could change the scope of the <literal>CreditCardPaymentStrategy</literal> implementation, but this would affect other clients of that Web Bean. A better option would be to change the scope of the producer method to <literal>@Dependent</literal> or <literal>@RequestScoped</literal>."
+msgstr "Ci sono almeno 3 modi per correggere questo bug. Si può cambiare lo scope dell'implementazione di <literal>CreditCardPaymentStrategy</literal>, ma questo non influenzerebbe gli altri client di questo Web Bean. Un'opzione migliore sarebbe quella di cambiare lo scope del metodo produttore a <literal>@Dependent</literal> o <literal>@RequestScoped</literal>."
#. Tag: para
#: producermethods.xml:113
#, no-c-format
-msgid ""
-"But a more common solution is to use the special <literal>@New</literal> "
-"binding annotation."
-msgstr ""
-"Ma una soluzione più comune è quella di usare la speciale annotazione di "
-"binding <literal>@New</literal>."
+msgid "But a more common solution is to use the special <literal>@New</literal> binding annotation."
+msgstr "Ma una soluzione più comune è quella di usare la speciale annotazione di binding <literal>@New</literal>."
#. Tag: title
#: producermethods.xml:119
@@ -363,11 +276,9 @@
#, no-c-format
msgid ""
"<![CDATA[@Produces @Preferred @SessionScoped\n"
-"public PaymentStrategy getPaymentStrategy(@New CreditCardPaymentStrategy "
-"ccps,\n"
+"public PaymentStrategy getPaymentStrategy(@New CreditCardPaymentStrategy ccps,\n"
" @New ChequePaymentStrategy cps,\n"
-" @New PayPalPaymentStrategy ppps) "
-"{\n"
+" @New PayPalPaymentStrategy ppps) {\n"
" switch (paymentStrategy) {\n"
" case CREDIT_CARD: return ccps;\n"
" case CHEQUE: return cps;\n"
@@ -377,11 +288,9 @@
"}]]>"
msgstr ""
"<![CDATA[@Produces @Preferred @SessionScoped\n"
-"public PaymentStrategy getPaymentStrategy(@New CreditCardPaymentStrategy "
-"ccps,\n"
+"public PaymentStrategy getPaymentStrategy(@New CreditCardPaymentStrategy ccps,\n"
" @New ChequePaymentStrategy cps,\n"
-" @New PayPalPaymentStrategy ppps) "
-"{\n"
+" @New PayPalPaymentStrategy ppps) {\n"
" switch (paymentStrategy) {\n"
" case CREDIT_CARD: return ccps;\n"
" case CHEQUE: return cps;\n"
@@ -393,19 +302,8 @@
#. Tag: para
#: producermethods.xml:125
#, no-c-format
-msgid ""
-"Then a new <emphasis>dependent</emphasis> instance of "
-"<literal>CreditCardPaymentStrategy</literal> will be created, passed to the "
-"producer method, returned by the producer method and finally bound to the "
-"session context. The dependent object won't be destroyed until the "
-"<literal>Preferences</literal> object is destroyed, at the end of the "
-"session."
-msgstr ""
-"Quindi verrebbe creata una nuova istanza <emphasis>dipendente</emphasis> di "
-"<literal>CreditCardPaymentStrategy</literal>, passata al metodo produttore, "
-"ritornata al metodo produttore ed infine associata al contesto di sessione. "
-"L'oggetto dipendente non verrebbe distrutto finché l'oggetto "
-"<literal>Preferences</literal> non viene distrutto, cioè a fine sessione."
+msgid "Then a new <emphasis>dependent</emphasis> instance of <literal>CreditCardPaymentStrategy</literal> will be created, passed to the producer method, returned by the producer method and finally bound to the session context. The dependent object won't be destroyed until the <literal>Preferences</literal> object is destroyed, at the end of the session."
+msgstr "Quindi verrebbe creata una nuova istanza <emphasis>dipendente</emphasis> di <literal>CreditCardPaymentStrategy</literal>, passata al metodo produttore, ritornata al metodo produttore ed infine associata al contesto di sessione. L'oggetto dipendente non verrebbe distrutto finché l'oggetto <literal>Preferences</literal> non viene distrutto, cioè a fine sessione."
#~ msgid ""
#~ "<blockquote> <para>A Web Beans producer method acts as a source of "
@@ -494,3 +392,4 @@
#~ "risolve i metodi produttori usando le regole di iniezione dei Web Beans. "
#~ "Il metodo produttore verrà chiamato dal manager Web Bean per ottenere "
#~ "un'istanza per servire questo punto di iniezione.</para>"
+
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2275 - doc/trunk/reference/it-IT.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2009-03-30 15:49:39 -0400 (Mon, 30 Mar 2009)
New Revision: 2275
Modified:
doc/trunk/reference/it-IT/Author_Group.po
doc/trunk/reference/it-IT/ri-spi.po
doc/trunk/reference/it-IT/ri.po
Log:
Italian translation
Modified: doc/trunk/reference/it-IT/Author_Group.po
===================================================================
--- doc/trunk/reference/it-IT/Author_Group.po 2009-03-30 19:20:04 UTC (rev 2274)
+++ doc/trunk/reference/it-IT/Author_Group.po 2009-03-30 19:49:39 UTC (rev 2275)
@@ -6,7 +6,7 @@
"Project-Id-Version: Introduction_to_Web_Beans VERSION\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2009-03-17 21:16+0100\n"
+"PO-Revision-Date: 2009-03-30 21:41+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -22,12 +22,8 @@
#. Tag: affiliation
#: Author_Group.xml:7
#, no-c-format
-msgid ""
-"<jobtitle>JSR-299 specification lead</jobtitle> <orgname>Red Hat Middleware "
-"LLC</orgname>"
-msgstr ""
-"<jobtitle>JSR-299 specification lead</jobtitle> <orgname>Red Hat Middleware "
-"LLC</orgname>"
+msgid "<jobtitle>JSR-299 specification lead</jobtitle> <orgname>Red Hat Middleware LLC</orgname>"
+msgstr "<jobtitle>JSR-299 specification lead</jobtitle> <orgname>Red Hat Middleware LLC</orgname>"
#. Tag: author
#: Author_Group.xml:12
@@ -38,18 +34,14 @@
#. Tag: affiliation
#: Author_Group.xml:15
#, no-c-format
-msgid ""
-"<jobtitle>Web Beans (JSR-299 Reference Implementation) lead </jobtitle> "
-"<orgname>Red Hat Middleware LLC</orgname>"
-msgstr ""
-"<jobtitle>Web Beans (JSR-299 Reference Implementation) lead </jobtitle> "
-"<orgname>Red Hat Middleware LLC</orgname>"
+msgid "<jobtitle>Web Beans (JSR-299 Reference Implementation) lead </jobtitle> <orgname>Red Hat Middleware LLC</orgname>"
+msgstr "<jobtitle>Web Beans (JSR-299 Reference Implementation) lead </jobtitle> <orgname>Red Hat Middleware LLC</orgname>"
#. Tag: author
#: Author_Group.xml:21
-#, fuzzy, no-c-format
+#, no-c-format
msgid "<firstname>David</firstname> <surname>Allen</surname>"
-msgstr "<firstname>Gavin</firstname> <surname>King</surname>"
+msgstr "<firstname>David</firstname> <surname>Allen</surname>"
#. Tag: othercredit
#: Author_Group.xml:25
@@ -58,7 +50,8 @@
msgstr "<firstname>Nicola</firstname> <surname>Benaglia</surname>"
#. Tag: contrib
-#: Author_Group.xml:28 Author_Group.xml:57
+#: Author_Group.xml:28
+#: Author_Group.xml:57
#, no-c-format
msgid "Italian Translation"
msgstr "Traduzione italiana"
@@ -76,7 +69,9 @@
msgstr "Traduzione spagnola"
#. Tag: orgname
-#: Author_Group.xml:35 Author_Group.xml:43 Author_Group.xml:51
+#: Author_Group.xml:35
+#: Author_Group.xml:43
+#: Author_Group.xml:51
#, no-c-format
msgid "Red Hat Middleware LLC"
msgstr "Red Hat Middleware LLC"
@@ -128,3 +123,4 @@
#, no-c-format
msgid "Kava Community"
msgstr "Kava Community"
+
Modified: doc/trunk/reference/it-IT/ri-spi.po
===================================================================
--- doc/trunk/reference/it-IT/ri-spi.po 2009-03-30 19:20:04 UTC (rev 2274)
+++ doc/trunk/reference/it-IT/ri-spi.po 2009-03-30 19:49:39 UTC (rev 2275)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2009-03-17 21:22+0100\n"
+"PO-Revision-Date: 2009-03-30 21:47+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -22,32 +22,14 @@
#. Tag: para
#: ri-spi.xml:6
#, no-c-format
-msgid ""
-"Currently the Web Beans RI only runs in JBoss AS 5; integrating the RI into "
-"other EE environments (for example another application server like "
-"Glassfish), into a servlet container (like Tomcat), or with an Embedded "
-"EJB3.1 implementation is fairly easy. In this Appendix we will briefly "
-"discuss the steps needed."
-msgstr ""
-"Attualmente Web Bean RI funziona solo in JBoss AS 5; l'integrazione di RI in "
-"altri ambienti EE (per esempio in un application server come Glassfish), in "
-"un servlet container (come Tomcat), o con un'implementazione EJB3.1 Embedded "
-"è abbastanza facile. In questo appendice si discuterà brevemente dei passi "
-"necessari."
+msgid "Currently the Web Beans RI only runs in JBoss AS 5; integrating the RI into other EE environments (for example another application server like Glassfish), into a servlet container (like Tomcat), or with an Embedded EJB3.1 implementation is fairly easy. In this Appendix we will briefly discuss the steps needed."
+msgstr "Attualmente Web Bean RI funziona solo in JBoss AS 5; l'integrazione di RI in altri ambienti EE (per esempio in un application server come Glassfish), in un servlet container (come Tomcat), o con un'implementazione EJB3.1 Embedded è abbastanza facile. In questo appendice si discuterà brevemente dei passi necessari."
#. Tag: para
#: ri-spi.xml:15
#, no-c-format
-msgid ""
-"It should be possible to run Web Beans in an SE environment, but you'll to "
-"do more work, adding your own contexts and lifecycle. The Web Beans RI "
-"currently doesn't expose lifecycle extension points, so you would have to "
-"code directly against Web Beans RI classes."
-msgstr ""
-"Dovrebbe essere possibile far funzionare Web Beans in un ambiente SE, ma "
-"occorre molto lavoro per aggiungere i propri contesti ed il ciclo di vita. "
-"Web Beans RI attualmente non espone punti di estensione del ciclo di vita, "
-"così occorre codificare direttamente nelle classi Web Beans RI."
+msgid "It should be possible to run Web Beans in an SE environment, but you'll to do more work, adding your own contexts and lifecycle. The Web Beans RI currently doesn't expose lifecycle extension points, so you would have to code directly against Web Beans RI classes."
+msgstr "Dovrebbe essere possibile far funzionare Web Beans in un ambiente SE, ma occorre molto lavoro per aggiungere i propri contesti ed il ciclo di vita. Web Beans RI attualmente non espone punti di estensione del ciclo di vita, così occorre codificare direttamente nelle classi Web Beans RI."
#. Tag: title
#: ri-spi.xml:24
@@ -58,25 +40,14 @@
#. Tag: para
#: ri-spi.xml:26
#, no-c-format
-msgid ""
-"The Web Beans SPI is located in <literal>webbeans-ri-spi</literal> module, "
-"and packaged as <literal>webbeans-ri-spi.jar</literal>. Some SPIs are "
-"optional, if you need to override the default behavior, others are required."
-msgstr ""
-"Web Beans SPI è collocato nel modulo <literal>webbeans-ri-spi</literal>, ed "
-"è impacchettato come <literal>webbeans-ri-spi.jar</literal>. Alcuni SPI sono "
-"opzionali se occorre fare override del comportamento di default, altri sono "
-"richiesti."
+msgid "The Web Beans SPI is located in <literal>webbeans-ri-spi</literal> module, and packaged as <literal>webbeans-ri-spi.jar</literal>. Some SPIs are optional, if you need to override the default behavior, others are required."
+msgstr "Web Beans SPI è collocato nel modulo <literal>webbeans-ri-spi</literal>, ed è impacchettato come <literal>webbeans-ri-spi.jar</literal>. Alcuni SPI sono opzionali se occorre fare override del comportamento di default, altri sono richiesti."
#. Tag: para
#: ri-spi.xml:33
#, no-c-format
-msgid ""
-"All interfaces in the SPI support the decorator pattern and provide a "
-"<literal>Forwarding</literal> class."
-msgstr ""
-"Tutte le interfacce in SPI supportano il pattern decorator e forniscono una "
-"classe <literal>Forwarding</literal>."
+msgid "All interfaces in the SPI support the decorator pattern and provide a <literal>Forwarding</literal> class."
+msgstr "Tutte le interfacce in SPI supportano il pattern decorator e forniscono una classe <literal>Forwarding</literal>."
#. Tag: title
#: ri-spi.xml:39
@@ -90,8 +61,7 @@
msgid ""
"<![CDATA[public interface WebBeanDiscovery {\n"
" /**\n"
-" * Gets list of all classes in classpath archives with web-beans.xml "
-"files\n"
+" * Gets list of all classes in classpath archives with web-beans.xml files\n"
" * \n"
" * @return An iterable over the classes \n"
" */\n"
@@ -108,8 +78,7 @@
msgstr ""
"<![CDATA[public interface WebBeanDiscovery {\n"
" /**\n"
-" * Gets list of all classes in classpath archives with web-beans.xml "
-"files\n"
+" * Gets list of all classes in classpath archives with web-beans.xml files\n"
" * \n"
" * @return An iterable over the classes \n"
" */\n"
@@ -127,38 +96,24 @@
#. Tag: para
#: ri-spi.xml:43
#, no-c-format
-msgid ""
-"The discovery of Web Bean classes and <literal>web-bean.xml</literal> files "
-"is self-explanatory (the algorithm is described in Section 11.1 of the JSR-"
-"299 specification, and isn't repeated here)."
-msgstr ""
-"L'analisi dei file delle classi Web Bean e di <literal>web-bean.xml</"
-"literal> è molto istruttiva (l'algoritmo è descritto nella sezione 11.1 "
-"della specifica JSR-299 e non viene qua ripetuto)."
+msgid "The discovery of Web Bean classes and <literal>web-bean.xml</literal> files is self-explanatory (the algorithm is described in Section 11.1 of the JSR-299 specification, and isn't repeated here)."
+msgstr "L'analisi dei file delle classi Web Bean e di <literal>web-bean.xml</literal> è molto istruttiva (l'algoritmo è descritto nella sezione 11.1 della specifica JSR-299 e non viene qua ripetuto)."
#. Tag: title
#: ri-spi.xml:52
#, no-c-format
msgid "EJB services"
-msgstr ""
+msgstr "Servizi EJB"
#. Tag: para
#: ri-spi.xml:54
#, no-c-format
-msgid ""
-"The Web Beans RI also delegates EJB3 bean discovery to the container so that "
-"it doesn't have to scan for EJB3 annotations or parse <literal>ejb-jar.xml</"
-"literal>. For each EJB in the application an EJBDescriptor should be "
-"discovered:"
-msgstr ""
-"Web Beans RI delega al container la rilevazione dei bean EJB3 e quindi "
-"risulta non essere necessario eseguire lo scan delle annotazioni EJB3 o fare "
-"il parsing di <literal>ejb-jar.xml</literal>. Per ciascun EJB "
-"nell'applicazione dovrebbe essere rilevato un EJBDescriptor:"
+msgid "The Web Beans RI also delegates EJB3 bean discovery to the container so that it doesn't have to scan for EJB3 annotations or parse <literal>ejb-jar.xml</literal>. For each EJB in the application an EJBDescriptor should be discovered:"
+msgstr "Web Beans RI delega al container la rilevazione dei bean EJB3 e quindi risulta non essere necessario eseguire lo scan delle annotazioni EJB3 o fare il parsing di <literal>ejb-jar.xml</literal>. Per ciascun EJB nell'applicazione dovrebbe essere rilevato un EJBDescriptor:"
#. Tag: programlisting
#: ri-spi.xml:61
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"<![CDATA[public interface EjbServices\n"
"{\n"
@@ -170,18 +125,15 @@
" */\n"
" public Iterable<EjbDescriptor<?>> discoverEjbs();]]>"
msgstr ""
-"<![CDATA[public interface EjbDiscovery\n"
+"<![CDATA[public interface EjbServices\n"
"{\n"
-" public static final String PROPERTY_NAME = EjbDiscovery.class.getName();\n"
" \n"
" /**\n"
" * Gets a descriptor for each EJB in the application\n"
" * \n"
" * @return The bean class to descriptor map \n"
" */\n"
-" public Iterable<EjbDescriptor<?>> discoverEjbs();\n"
-" \n"
-"}]]>"
+" public Iterable<EjbDescriptor<?>> discoverEjbs();]]>"
#. Tag: programlisting
#: ri-spi.xml:63
@@ -201,16 +153,14 @@
" * \n"
" * @return An iterator over the local business interfaces\n"
" */\n"
-" public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces"
-"();\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces();\n"
" \n"
" /**\n"
" * Gets the remote business interfaces of the EJB\n"
" * \n"
" * @return An iterator over the remote business interfaces\n"
" */\n"
-" public Iterable<BusinessInterfaceDescriptor<?>> "
-"getRemoteBusinessInterfaces();\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces();\n"
" \n"
" /**\n"
" * Get the remove methods of the EJB\n"
@@ -271,16 +221,14 @@
" * \n"
" * @return An iterator over the local business interfaces\n"
" */\n"
-" public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces"
-"();\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getLocalBusinessInterfaces();\n"
" \n"
" /**\n"
" * Gets the remote business interfaces of the EJB\n"
" * \n"
" * @return An iterator over the remote business interfaces\n"
" */\n"
-" public Iterable<BusinessInterfaceDescriptor<?>> "
-"getRemoteBusinessInterfaces();\n"
+" public Iterable<BusinessInterfaceDescriptor<?>> getRemoteBusinessInterfaces();\n"
" \n"
" /**\n"
" * Get the remove methods of the EJB\n"
@@ -330,60 +278,31 @@
#. Tag: para
#: ri-spi.xml:65
#, no-c-format
-msgid ""
-"The <literal>EjbDescriptor</literal> is fairly self-explanatory, and should "
-"return the relevant metadata as defined in the EJB specification. In "
-"addition to these two interfaces, there is "
-"<literal>BusinessInterfaceDescriptor</literal> which represents a local "
-"business interface (encapsulating the interface class and jndi name used to "
-"look up an instance of the EJB)."
-msgstr ""
-"Il <literal>EjbDescriptor</literal> è abbastanza auto-esplicatorio e "
-"dovrebbe restituire i metadati rilevanti definiti nella specifica EJB. In "
-"aggiunta a queste due interfacce, vi è <literal>BusinessInterfaceDescriptor</"
-"literal> a rappresentare un'interfaccia locale di business (che incapsula la "
-"classe d'interfaccia ed il nome jndi usato per la ricerca di una istanza "
-"EJB)."
+msgid "The <literal>EjbDescriptor</literal> is fairly self-explanatory, and should return the relevant metadata as defined in the EJB specification. In addition to these two interfaces, there is <literal>BusinessInterfaceDescriptor</literal> which represents a local business interface (encapsulating the interface class and jndi name used to look up an instance of the EJB)."
+msgstr "Il <literal>EjbDescriptor</literal> è abbastanza auto-esplicatorio e dovrebbe restituire i metadati rilevanti definiti nella specifica EJB. In aggiunta a queste due interfacce, vi è <literal>BusinessInterfaceDescriptor</literal> a rappresentare un'interfaccia locale di business (che incapsula la classe d'interfaccia ed il nome jndi usato per la ricerca di una istanza EJB)."
#. Tag: para
#: ri-spi.xml:74
-#, fuzzy, no-c-format
-msgid ""
-"The resolution of <literal>@EJB</literal> and <literal>@Resource</literal> "
-"is delegated to the container. You must provide an implementation of "
-"<literal>org.jboss.webbeans.ejb.spi.EjbServices</literal> which provides "
-"these operations. Web Beans passes in the <literal>javax.inject.manager."
-"InjectionPoint</literal> the resolution is for, as well as the "
-"<literal>NamingContext</literal> in use for each resolution request."
-msgstr ""
-"La risoluzione di <literal>@EJB</literal>, <literal>@PersistenceContext</"
-"literal> e <literal>@Resource</literal> è delegata al container. Occorre "
-"fornire un'implementazione di <literal>org.jboss.webbeans.ejb.spi."
-"EjbResolver</literal> che rende disponibili queste operazioni. Web Beans "
-"passa nel <literal>javax.inject.manager.InjectionPoint</literal> la "
-"risoluzione, anche come <literal>NamingContext</literal>, che è in uso per "
-"ogni richiesta di risoluzione."
+#, no-c-format
+msgid "The resolution of <literal>@EJB</literal> and <literal>@Resource</literal> is delegated to the container. You must provide an implementation of <literal>org.jboss.webbeans.ejb.spi.EjbServices</literal> which provides these operations. Web Beans passes in the <literal>javax.inject.manager.InjectionPoint</literal> the resolution is for, as well as the <literal>NamingContext</literal> in use for each resolution request."
+msgstr "La risoluzione di <literal>@EJB</literal> e <literal>@Resource</literal> è delegata al container. Occorre fornire un'implementazione di <literal>org.jboss.webbeans.ejb.spi.EjbServices</literal> che rende disponibili queste operazioni. Web Beans passa nel <literal>javax.inject.manager.InjectionPoint</literal> la risoluzione, anche come <literal>NamingContext</literal>, che è in uso per ogni richiesta di risoluzione."
#. Tag: title
#: ri-spi.xml:98
#, no-c-format
msgid "JPA services"
-msgstr ""
+msgstr "Servizi JPA"
#. Tag: para
#: ri-spi.xml:100
#, no-c-format
-msgid ""
-"Just as resolution of <literal>@EJB</literal> is delegated to the container, "
-"so is resolution of <literal>@PersistenceContext</literal>."
+msgid "Just as resolution of <literal>@EJB</literal> is delegated to the container, so is resolution of <literal>@PersistenceContext</literal>."
msgstr ""
#. Tag: para
#: ri-spi.xml:106
#, no-c-format
-msgid ""
-"OPEN ISSUE: Web Beans also requires the container to provide a list of "
-"entities in the deployment, so that they aren't discovered as simple beans."
+msgid "OPEN ISSUE: Web Beans also requires the container to provide a list of entities in the deployment, so that they aren't discovered as simple beans."
msgstr ""
#. Tag: title
@@ -395,14 +314,8 @@
#. Tag: para
#: ri-spi.xml:116
#, no-c-format
-msgid ""
-"The Web Beans RI must delegate JTA activities to the container. The SPI "
-"provides a couple hooks to easily achieve this with the "
-"<literal>TransactionServices</literal> interface."
-msgstr ""
-"Web Beans RI deve delegare le attività JTA al container. SPI fornisce un "
-"paio di modi per ottenere ciò tramite l'interfaccia "
-"<literal>TransactionServices</literal>."
+msgid "The Web Beans RI must delegate JTA activities to the container. The SPI provides a couple hooks to easily achieve this with the <literal>TransactionServices</literal> interface."
+msgstr "Web Beans RI deve delegare le attività JTA al container. SPI fornisce un paio di modi per ottenere ciò tramite l'interfaccia <literal>TransactionServices</literal>."
#. Tag: programlisting
#: ri-spi.xml:122
@@ -426,12 +339,10 @@
" * @see javax.transaction.Synchronization\n"
" * @param synchronizedObserver\n"
" */\n"
-" public void registerSynchronization(Synchronization "
-"synchronizedObserver);\n"
+" public void registerSynchronization(Synchronization synchronizedObserver);\n"
"\n"
" /**\n"
-" * Queries the status of the current execution to see if a transaction "
-"is\n"
+" * Queries the status of the current execution to see if a transaction is\n"
" * currently active.\n"
" * \n"
" * @return true if a transaction is active\n"
@@ -457,12 +368,10 @@
" * @see javax.transaction.Synchronization\n"
" * @param synchronizedObserver\n"
" */\n"
-" public void registerSynchronization(Synchronization "
-"synchronizedObserver);\n"
+" public void registerSynchronization(Synchronization synchronizedObserver);\n"
"\n"
" /**\n"
-" * Queries the status of the current execution to see if a transaction "
-"is\n"
+" * Queries the status of the current execution to see if a transaction is\n"
" * currently active.\n"
" * \n"
" * @return true if a transaction is active\n"
@@ -473,44 +382,20 @@
#. Tag: para
#: ri-spi.xml:124
#, no-c-format
-msgid ""
-"The enumeration <literal>Status</literal> is a convenience for implementors "
-"to be able to keep track of whether a synchronization is supposed to notify "
-"an observer only when the transaction is successful, or after a failure, or "
-"regardless of the status of the transaction."
-msgstr ""
-"La enumeration <literal>Status</literal> serve agli implementatori per poter "
-"essere in grado di tracciare se una sincronizzazione deve notificare un "
-"osservatore solo quando la transazione ha avuto successo, o dopo un errore, "
-"o indipendentemente dallo stato della transazione."
+msgid "The enumeration <literal>Status</literal> is a convenience for implementors to be able to keep track of whether a synchronization is supposed to notify an observer only when the transaction is successful, or after a failure, or regardless of the status of the transaction."
+msgstr "La enumeration <literal>Status</literal> serve agli implementatori per poter essere in grado di tracciare se una sincronizzazione deve notificare un osservatore solo quando la transazione ha avuto successo, o dopo un errore, o indipendentemente dallo stato della transazione."
#. Tag: para
#: ri-spi.xml:131
#, no-c-format
-msgid ""
-"Any <literal>javax.transaction.Synchronization</literal> implementation may "
-"be passed to the <literal>registerSynchronization()</literal> method and the "
-"SPI implementation should immediately register the synchronization with the "
-"JTA transaction manager used for the EJBs."
-msgstr ""
-"Qualsiasi implementazione di <literal>javax.transaction.Synchronization</"
-"literal> può essere passata al metodo <literal>registerSynchronization()</"
-"literal> e l'implementazione SPI deve immediatamente registrare la "
-"sincronizzazione con il gestore della transazione JTA usato per EJB."
+msgid "Any <literal>javax.transaction.Synchronization</literal> implementation may be passed to the <literal>registerSynchronization()</literal> method and the SPI implementation should immediately register the synchronization with the JTA transaction manager used for the EJBs."
+msgstr "Qualsiasi implementazione di <literal>javax.transaction.Synchronization</literal> può essere passata al metodo <literal>registerSynchronization()</literal> e l'implementazione SPI deve immediatamente registrare la sincronizzazione con il gestore della transazione JTA usato per EJB."
#. Tag: para
#: ri-spi.xml:138
#, no-c-format
-msgid ""
-"To make it easier to determine whether or not a transaction is currently "
-"active for the requesting thread, the <literal>isTransactionActive()</"
-"literal> method can be used. The SPI implementation should query the same "
-"JTA transaction manager used for the EJBs."
-msgstr ""
-"Per facilitare la determinazione se o no una transazione è attualmente "
-"attiva per il thread di richiesta, può essere usato il metodo "
-"<literal>isTransactionActive()</literal>. L'implementazione SPI deve "
-"interrogare lo stesso gestore della transazione JTA usato per EJB."
+msgid "To make it easier to determine whether or not a transaction is currently active for the requesting thread, the <literal>isTransactionActive()</literal> method can be used. The SPI implementation should query the same JTA transaction manager used for the EJBs."
+msgstr "Per facilitare la determinazione se o no una transazione è attualmente attiva per il thread di richiesta, può essere usato il metodo <literal>isTransactionActive()</literal>. L'implementazione SPI deve interrogare lo stesso gestore della transazione JTA usato per EJB."
#. Tag: title
#: ri-spi.xml:147
@@ -521,19 +406,8 @@
#. Tag: para
#: ri-spi.xml:149
#, no-c-format
-msgid ""
-"Web Beans expects the Application Server or other container to provide the "
-"storage for each application's context. The <literal>org.jboss.webbeans."
-"context.api.BeanStore</literal> should be implemented to provide an "
-"application scoped storage. You may find <literal>org.jboss.webbeans.context."
-"api.helpers.ConcurrentHashMapBeanStore</literal> useful."
-msgstr ""
-"Web Beans si aspetta che l'Application Server od un altro container fornisca "
-"la memorizzazione per ogni contesto applicazione. <literal>org.jboss."
-"webbeans.context.api.BeanStore</literal> dovrebbe essere implementato per "
-"fornire uno storage con scope applicazione. Si può trovare molto utile "
-"<literal>org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore</"
-"literal>."
+msgid "Web Beans expects the Application Server or other container to provide the storage for each application's context. The <literal>org.jboss.webbeans.context.api.BeanStore</literal> should be implemented to provide an application scoped storage. You may find <literal>org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore</literal> useful."
+msgstr "Web Beans si aspetta che l'Application Server od un altro container fornisca la memorizzazione per ogni contesto applicazione. <literal>org.jboss.webbeans.context.api.BeanStore</literal> dovrebbe essere implementato per fornire uno storage con scope applicazione. Si può trovare molto utile <literal>org.jboss.webbeans.context.api.helpers.ConcurrentHashMapBeanStore</literal>."
#. Tag: title
#: ri-spi.xml:162
@@ -544,91 +418,44 @@
#. Tag: para
#: ri-spi.xml:163
#, no-c-format
-msgid ""
-"The <literal>org.jboss.webbeans.bootstrap.api.Bootstrap</literal> interface "
-"defines the bootstrap for Web Beans. To boot Web Beans, you must obtain an "
-"instance of <literal>org.jboss.webbeans.bootstrap.WebBeansBootstrap</"
-"literal> (which implements <literal>Boostrap</literal>), tell it about the "
-"SPIs in use, and then request the container start."
-msgstr ""
-"L'interfaccia <literal>org.jboss.webbeans.bootstrap.api.Bootstrap</literal> "
-"definisce il bootstrap per Web Beans. Per avviare Web Beans occorre ottenere "
-"un'istanza di <literal>org.jboss.webbeans.bootstrap.WebBeansBootstrap</"
-"literal> (che implementa <literal>Boostrap</literal>), e comunicare le SPI "
-"in uso, e poi chiedere che il container venga avviato."
+msgid "The <literal>org.jboss.webbeans.bootstrap.api.Bootstrap</literal> interface defines the bootstrap for Web Beans. To boot Web Beans, you must obtain an instance of <literal>org.jboss.webbeans.bootstrap.WebBeansBootstrap</literal> (which implements <literal>Boostrap</literal>), tell it about the SPIs in use, and then request the container start."
+msgstr "L'interfaccia <literal>org.jboss.webbeans.bootstrap.api.Bootstrap</literal> definisce il bootstrap per Web Beans. Per avviare Web Beans occorre ottenere un'istanza di <literal>org.jboss.webbeans.bootstrap.WebBeansBootstrap</literal> (che implementa <literal>Boostrap</literal>), e comunicare le SPI in uso, e poi chiedere che il container venga avviato."
#. Tag: para
#: ri-spi.xml:172
-#, fuzzy, no-c-format
-msgid ""
-"The bootstrap is split into phases, bootstrap initialization and boot and "
-"shutdown. Initialization will create a manager, and add the standard "
-"(specification defined) contexts. Bootstrap will discover EJBs, classes and "
-"XML; add beans defined using annotations; add beans defined using XML; and "
-"validate all beans."
-msgstr ""
-"Il bootstrap è suddiviso in due fasi, inizializzazione del bootstrap e "
-"bootstrap. L'inizializzazione creerà un manager, e aggiungerà i contesti "
-"standard (definiti dalla specifica). Bootstrap scoprirà EJB, classi e XML; "
-"aggiungerà i bean definiti con le annotazioni; aggiungerà i bean definiti "
-"con XML; e validerà tutti i bean."
+#, no-c-format
+msgid "The bootstrap is split into phases, bootstrap initialization and boot and shutdown. Initialization will create a manager, and add the standard (specification defined) contexts. Bootstrap will discover EJBs, classes and XML; add beans defined using annotations; add beans defined using XML; and validate all beans."
+msgstr "Il bootstrap è suddiviso in più fasi, inizializzazione del bootstrap, bootstrap e shutdown. L'inizializzazione creerà un manager, e aggiungerà i contesti standard (definiti dalla specifica). Bootstrap scoprirà EJB, classi e XML; aggiungerà i bean definiti con le annotazioni; aggiungerà i bean definiti con XML; e validerà tutti i bean."
#. Tag: para
#: ri-spi.xml:180
#, no-c-format
-msgid ""
-"The bootstrap supports multiple environments. Different environments require "
-"different services to be present (for example servlet doesn't require "
-"transaction, EJB or JPA services). By default an EE environment is assumed, "
-"but you can adjust the environment by calling <literal>bootstrap."
-"setEnvironment()</literal>."
+msgid "The bootstrap supports multiple environments. Different environments require different services to be present (for example servlet doesn't require transaction, EJB or JPA services). By default an EE environment is assumed, but you can adjust the environment by calling <literal>bootstrap.setEnvironment()</literal>."
msgstr ""
#. Tag: para
#: ri-spi.xml:188
-#, fuzzy, no-c-format
-msgid ""
-"To initialize the bootstrap you call <literal>Bootstrap.initialize()</"
-"literal>. Before calling <literal>initialize()</literal>, you must register "
-"any services required by your environment. You can do this by calling "
-"<literal>bootstrap.getServices().add(JpaServices.class, new MyJpaServices())"
-"</literal>. You must also provide the application context bean store."
-msgstr ""
-"Per inizializzare il bootstrap si chiama <literal>Bootstrap.initialize()</"
-"literal>. Prima della chiamata di <literal>initialize()</literal> occorre "
-"aver chiamato <literal>Bootstrap.setEjbResolver()</literal>. Se non si usa "
-"il <literal>DefaultNamingContext</literal> o <literal>DefaultResourceLoader</"
-"literal> predefiniti, occorre impostare questi prima di chiamare "
-"<literal>initialize()</literal>."
+#, no-c-format
+msgid "To initialize the bootstrap you call <literal>Bootstrap.initialize()</literal>. Before calling <literal>initialize()</literal>, you must register any services required by your environment. You can do this by calling <literal>bootstrap.getServices().add(JpaServices.class, new MyJpaServices())</literal>. You must also provide the application context bean store."
+msgstr "Per inizializzare il bootstrap si chiama <literal>Bootstrap.initialize()</literal>. Prima della chiamata di <literal>initialize()</literal> occorre registrare i servizi richiesti dal proprio ambiente. Si può fare questo chiamando <literal>bootstrap.getServices().add(JpaServices.class, new MyJpaServices())</literal>. Occorre anche fornire l'application context bean store."
#. Tag: para
#: ri-spi.xml:197
#, no-c-format
-msgid ""
-"Having called <literal>initialize()</literal>, the <literal>Manager</"
-"literal> can be obtained by calling <literal>Bootstrap.getManager()</"
-"literal>."
-msgstr ""
-"Dopo aver chiamato <literal>initialize()</literal>, il <literal>Manager</"
-"literal> può essere ottenuto chiamando <literal>Bootstrap.getManager()</"
-"literal>."
+msgid "Having called <literal>initialize()</literal>, the <literal>Manager</literal> can be obtained by calling <literal>Bootstrap.getManager()</literal>."
+msgstr "Dopo aver chiamato <literal>initialize()</literal>, il <literal>Manager</literal> può essere ottenuto chiamando <literal>Bootstrap.getManager()</literal>."
#. Tag: para
#: ri-spi.xml:203
#, no-c-format
msgid "To boot the container you call <literal>Bootstrap.boot()</literal>."
-msgstr ""
+msgstr "Per avviare il container chiamare <literal>Bootstrap.boot()</literal>."
#. Tag: para
#: ri-spi.xml:207
#, no-c-format
-msgid ""
-"To shutdown the container you call <literal>Bootstrap.shutdown()</literal>. "
-"This allows the container to perform any cleanup operations needed."
-msgstr ""
-"Per spegnere il container si chiama <literal>Bootstrap.shutdown()</literal>. "
-"Questo consente al container di eseguire ogni pulizia necessaria delle "
-"operazioni."
+msgid "To shutdown the container you call <literal>Bootstrap.shutdown()</literal>. This allows the container to perform any cleanup operations needed."
+msgstr "Per spegnere il container si chiama <literal>Bootstrap.shutdown()</literal>. Questo consente al container di eseguire ogni pulizia necessaria delle operazioni."
#. Tag: title
#: ri-spi.xml:216
@@ -639,17 +466,8 @@
#. Tag: para
#: ri-spi.xml:218
#, no-c-format
-msgid ""
-"The Web Beans RI implements JNDI binding and lookup according to standards, "
-"however you may want to alter the binding and lookup (for example in an "
-"environment where JNDI isn't available). To do this, implement <literal>org."
-"jboss.webbeans.resources.spi.NamingContext</literal>:"
-msgstr ""
-"Web Beans RI implementa la ricerca e l'associazione JNDI secondo gli "
-"standard, ma può capitare di dover modificare la ricerca e l'associazione "
-"(per esempio in un ambiente dove JNDI non è disponibile). Per fare questo "
-"occorre implementare <literal>org.jboss.webbeans.resources.spi."
-"NamingContext</literal>:"
+msgid "The Web Beans RI implements JNDI binding and lookup according to standards, however you may want to alter the binding and lookup (for example in an environment where JNDI isn't available). To do this, implement <literal>org.jboss.webbeans.resources.spi.NamingContext</literal>:"
+msgstr "Web Beans RI implementa la ricerca e l'associazione JNDI secondo gli standard, ma può capitare di dover modificare la ricerca e l'associazione (per esempio in un ambiente dove JNDI non è disponibile). Per fare questo occorre implementare <literal>org.jboss.webbeans.resources.spi.NamingContext</literal>:"
#. Tag: programlisting
#: ri-spi.xml:226
@@ -708,18 +526,8 @@
#. Tag: para
#: ri-spi.xml:233
#, no-c-format
-msgid ""
-"The Web Beans RI needs to load classes and resources from the classpath at "
-"various times. By default, they are loaded from the same classloader that "
-"was used to load the RI, however this may not be correct for some "
-"environments. If this is case, you can implement <literal>org.jboss.webbeans."
-"spi.ResourceLoader</literal>:"
-msgstr ""
-"Web Beans RI deve caricare le classi e le risorse dal classpath in vari "
-"momenti. Di default vengono caricati dallo stesso classloader usato per "
-"caricare RI, comunque questo potrebbe non essere corretto in alcuni "
-"ambienti. Se è questo il caso si può implementare <literal>org.jboss."
-"webbeans.spi.ResourceLoader</literal>:"
+msgid "The Web Beans RI needs to load classes and resources from the classpath at various times. By default, they are loaded from the same classloader that was used to load the RI, however this may not be correct for some environments. If this is case, you can implement <literal>org.jboss.webbeans.spi.ResourceLoader</literal>:"
+msgstr "Web Beans RI deve caricare le classi e le risorse dal classpath in vari momenti. Di default vengono caricati dallo stesso classloader usato per caricare RI, comunque questo potrebbe non essere corretto in alcuni ambienti. Se è questo il caso si può implementare <literal>org.jboss.webbeans.spi.ResourceLoader</literal>:"
#. Tag: programlisting
#: ri-spi.xml:241
@@ -794,38 +602,20 @@
#. Tag: para
#: ri-spi.xml:248
#, no-c-format
-msgid ""
-"Java EE / Servlet does not provide any hooks which can be used to provide "
-"injection into Servlets, so Web Beans provides an API to allow the container "
-"to request JSR-299 injection for a Servlet."
-msgstr ""
-"Java EE / Servlet non fornisce alcun hook da usare per fornire l'iniezione "
-"nei Servlet, quindi Web Beans fornisce un'API per consentire al container di "
-"richiedere l'iniezione JSR-299 per un Servlet."
+msgid "Java EE / Servlet does not provide any hooks which can be used to provide injection into Servlets, so Web Beans provides an API to allow the container to request JSR-299 injection for a Servlet."
+msgstr "Java EE / Servlet non fornisce alcun hook da usare per fornire l'iniezione nei Servlet, quindi Web Beans fornisce un'API per consentire al container di richiedere l'iniezione JSR-299 per un Servlet."
#. Tag: para
#: ri-spi.xml:254
#, no-c-format
-msgid ""
-"To be compliant with JSR-299, the container should request servlet injection "
-"for each newly instantiated servlet after the constructor returns and before "
-"the servlet is placed into service."
-msgstr ""
-"Per soddisfare la JSR-299 il container deve richiedere l'iniezione servlet "
-"per ogni nuovo servlet istanziato dopo che il costruttore ritorni e prima "
-"che il servlet sia messo in servizio."
+msgid "To be compliant with JSR-299, the container should request servlet injection for each newly instantiated servlet after the constructor returns and before the servlet is placed into service."
+msgstr "Per soddisfare la JSR-299 il container deve richiedere l'iniezione servlet per ogni nuovo servlet istanziato dopo che il costruttore ritorni e prima che il servlet sia messo in servizio."
#. Tag: para
#: ri-spi.xml:260
#, no-c-format
-msgid ""
-"To perform injection on a servlet call <literal>WebBeansManager.injectServlet"
-"()</literal>. The manager can be obtained from <literal>Bootstrap.getManager"
-"()</literal>."
-msgstr ""
-"Per eseguire l'iniezione su un servlet si chiami <literal>WebBeansManager."
-"injectServlet()</literal>. Il manager può essere ottenuto da "
-"<literal>Bootstrap.getManager()</literal>."
+msgid "To perform injection on a servlet call <literal>WebBeansManager.injectServlet()</literal>. The manager can be obtained from <literal>Bootstrap.getManager()</literal>."
+msgstr "Per eseguire l'iniezione su un servlet si chiami <literal>WebBeansManager.injectServlet()</literal>. Il manager può essere ottenuto da <literal>Bootstrap.getManager()</literal>."
#. Tag: title
#: ri-spi.xml:271
@@ -836,12 +626,8 @@
#. Tag: para
#: ri-spi.xml:273
#, no-c-format
-msgid ""
-"There are a number of requirements that the Web Beans RI places on the "
-"container for correct functioning that fall outside implementation of APIs"
-msgstr ""
-"Per il corretto funzionamento al di fuori dell'implementazione delle API, ci "
-"sono un numero di requisiti che Web Beans RI pone nel container."
+msgid "There are a number of requirements that the Web Beans RI places on the container for correct functioning that fall outside implementation of APIs"
+msgstr "Per il corretto funzionamento al di fuori dell'implementazione delle API, ci sono un numero di requisiti che Web Beans RI pone nel container."
#. Tag: term
#: ri-spi.xml:281
@@ -852,16 +638,8 @@
#. Tag: para
#: ri-spi.xml:285
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans RI into an environment that supports "
-"deployment of multiple applications, you must enable, automatically, or "
-"through user configuation, classloader isolation for each Web Beans "
-"application."
-msgstr ""
-"Se si integra Web Beans in un ambiente che supporta il deploy di "
-"applicazioni, occorre abilitare, automaticamente o attraverso la "
-"configurazione utente, l'isolamento del classloader per ogni applicazione "
-"Web Beans."
+msgid "If you are integrating the Web Beans RI into an environment that supports deployment of multiple applications, you must enable, automatically, or through user configuation, classloader isolation for each Web Beans application."
+msgstr "Se si integra Web Beans in un ambiente che supporta il deploy di applicazioni, occorre abilitare, automaticamente o attraverso la configurazione utente, l'isolamento del classloader per ogni applicazione Web Beans."
#. Tag: term
#: ri-spi.xml:294
@@ -872,32 +650,14 @@
#. Tag: para
#: ri-spi.xml:298
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans into a Servlet environment you must "
-"register <literal>org.jboss.webbeans.servlet.WebBeansListener</literal> as a "
-"Servlet listener, either automatically, or through user configuration, for "
-"each Web Beans application which uses Servlet."
-msgstr ""
-"Se si integra Web Beans in un ambiente Servlet occorre registrare "
-"<literal>org.jboss.webbeans.servlet.WebBeansListener</literal> come Servlet "
-"listener, o automaticamente, o attraverso una configurazione utente, per "
-"ciascuna applicazione Web Beans che usa Servlet."
+msgid "If you are integrating the Web Beans into a Servlet environment you must register <literal>org.jboss.webbeans.servlet.WebBeansListener</literal> as a Servlet listener, either automatically, or through user configuration, for each Web Beans application which uses Servlet."
+msgstr "Se si integra Web Beans in un ambiente Servlet occorre registrare <literal>org.jboss.webbeans.servlet.WebBeansListener</literal> come Servlet listener, o automaticamente, o attraverso una configurazione utente, per ciascuna applicazione Web Beans che usa Servlet."
#. Tag: para
#: ri-spi.xml:307
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans into a JSF environment you must "
-"register <literal>org.jboss.webbeans.servlet.ConversationPropagationFilter</"
-"literal> as a Servlet listener, either automatically, or through user "
-"configuration, for each Web Beans application which uses JSF. This filter "
-"can be registered for all Servlet deployment safely."
-msgstr ""
-"Se si integra Web Beans in un ambiente Servlet occorre registrare "
-"<literal>org.jboss.webbeans.servlet.ConversationPropagationFilter</literal> "
-"come Servlet listener, o automaticamente, o attraverso una configurazione "
-"utente, per ciascuna applicazione Web Beans che usa JSF. Questo filtro può "
-"venir registrato in modo sicuro per tutti i deploy dei servlet."
+msgid "If you are integrating the Web Beans into a JSF environment you must register <literal>org.jboss.webbeans.servlet.ConversationPropagationFilter</literal> as a Servlet listener, either automatically, or through user configuration, for each Web Beans application which uses JSF. This filter can be registered for all Servlet deployment safely."
+msgstr "Se si integra Web Beans in un ambiente Servlet occorre registrare <literal>org.jboss.webbeans.servlet.ConversationPropagationFilter</literal> come Servlet listener, o automaticamente, o attraverso una configurazione utente, per ciascuna applicazione Web Beans che usa JSF. Questo filtro può venir registrato in modo sicuro per tutti i deploy dei servlet."
#. Tag: term
#: ri-spi.xml:319
@@ -908,59 +668,35 @@
#. Tag: para
#: ri-spi.xml:323
#, no-c-format
-msgid ""
-"If you are integrating the Web Beans into an EJB environment you must "
-"register <literal>org.jboss.webbeans.ejb.SessionBeanInterceptor</literal> as "
-"a EJB interceptor for all EJBs in the application, either automatically, or "
-"through user configuration, for each Web Beans application which uses "
-"enterprise beans."
-msgstr ""
-"Se si integra Web Beans in un ambiente EJB occorre registrare <literal>org."
-"jboss.webbeans.ejb.SessionBeanInterceptor</literal> come interceptor EJB per "
-"ogni EJB dell'applicazione, o automaticamente o attraverso una "
-"configurazione utente, per ciascuna applicazione Web Beans che utilizza bean "
-"enterprise."
+msgid "If you are integrating the Web Beans into an EJB environment you must register <literal>org.jboss.webbeans.ejb.SessionBeanInterceptor</literal> as a EJB interceptor for all EJBs in the application, either automatically, or through user configuration, for each Web Beans application which uses enterprise beans."
+msgstr "Se si integra Web Beans in un ambiente EJB occorre registrare <literal>org.jboss.webbeans.ejb.SessionBeanInterceptor</literal> come interceptor EJB per ogni EJB dell'applicazione, o automaticamente o attraverso una configurazione utente, per ciascuna applicazione Web Beans che utilizza bean enterprise."
#. Tag: para
#: ri-spi.xml:333
#, no-c-format
-msgid ""
-"You must register the <literal>SessionBeanInterceptor</literal> as the inner "
-"most interceptor in the stack for all EJBs."
-msgstr ""
-"Occorre registrare il <literal>SessionBeanInterceptor</literal> come "
-"interceptor più interno allo stack per tutti gli EJB."
+msgid "You must register the <literal>SessionBeanInterceptor</literal> as the inner most interceptor in the stack for all EJBs."
+msgstr "Occorre registrare il <literal>SessionBeanInterceptor</literal> come interceptor più interno allo stack per tutti gli EJB."
#. Tag: term
#: ri-spi.xml:341
-#, fuzzy, no-c-format
+#, no-c-format
msgid "The <literal>webbeans-core.jar</literal>"
-msgstr "<literal>webbeans-ri.jar</literal>"
+msgstr "<literal>webbeans-core.jar</literal>"
#. Tag: para
#: ri-spi.xml:345
-#, fuzzy, no-c-format
-msgid ""
-"If you are integrating the Web Beans into an environment that supports "
-"deployment of applications, you must insert the <literal>webbeans-core.jar</"
-"literal> into the applications isolated classloader. It cannot be loaded "
-"from a shared classloader."
-msgstr ""
-"Se si integra Web Beans in un ambiente che supporta il deploy di "
-"applicazioni, occorre inserire <literal>webbeans-ri.jar</literal> nel "
-"classloader isolato delle applicazioni. Non può essere caricato da un "
-"classloader condiviso."
+#, no-c-format
+msgid "If you are integrating the Web Beans into an environment that supports deployment of applications, you must insert the <literal>webbeans-core.jar</literal> into the applications isolated classloader. It cannot be loaded from a shared classloader."
+msgstr "Se si integra Web Beans in un ambiente che supporta il deploy di applicazioni, occorre inserire <literal>webbeans-core.jar</literal> nel classloader isolato delle applicazioni. Non può essere caricato da un classloader condiviso."
#~ msgid "EJB Discovery"
#~ msgstr "EJB Discovery"
-
#~ msgid ""
#~ "<literal>@EJB</literal>, <literal>@PersistenceContext</literal> and "
#~ "<literal>@Resource</literal> resolution"
#~ msgstr ""
#~ "<literal>@EJB</literal>, <literal>@PersistenceContext</literal> e "
#~ "<literal>@Resource</literal> resolution"
-
#~ msgid ""
#~ "To boot the container you call <literal>Bootstrap.boot()</literal>. "
#~ "Before calling <literal>boot()</literal> you must have called "
@@ -973,7 +709,6 @@
#~ "<literal>Bootstrap.setWebBeanDiscovery()</literal>, <literal>Bootstrap."
#~ "setEjbDiscovery()</literal> e <literal>Bootstrap.setApplicationContext()</"
#~ "literal>."
-
#~ msgid ""
#~ "You can specify the implementation of an SPI either as a system property, "
#~ "or in a properties file <literal>META-INF/web-beans-ri.properties</"
@@ -986,7 +721,6 @@
#~ "properties</literal>. Tutti i nomi delle proprietà sono nomi di classi "
#~ "fully qualified dell'interfaccia di implementazione; tutti i valori sono "
#~ "nomi di classi fully qualified della classe di implementazione."
-
#~ msgid ""
#~ "The Web Beans RI can be told to load your implementation of "
#~ "<literal>WebBeanDiscovery</literal> using the property <literal>org.jboss."
@@ -997,26 +731,22 @@
#~ "<literal>WebBeanDiscovery</literal> usando la proprietà <literal>org."
#~ "jboss.webbeans.bootstrap.spi.WebBeanDiscovery</literal> con il nome della "
#~ "classe pienamente qualificato (fully qualified) come valore. Per esempio:"
-
#~ msgid ""
#~ "org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery= \\ \n"
#~ " org.jboss.webbeans.integration.jbossas.WebBeanDiscoveryImpl"
#~ msgstr ""
#~ "org.jboss.webbeans.bootstrap.spi.WebBeanDiscovery= \\ \n"
#~ " org.jboss.webbeans.integration.jbossas.WebBeanDiscoveryImpl"
-
#~ msgid ""
#~ "If the Web Beans RI is being used in a servlet container, it expects a "
#~ "constructor of the form:"
#~ msgstr ""
#~ "Se Web Beans RI viene usato in un servlet container, si aspetta un "
#~ "costruttore della forma:"
-
#~ msgid ""
#~ "<![CDATA[public WebBeanDiscoveryImpl(ServletContext servletContext) {}]]>"
#~ msgstr ""
#~ "<![CDATA[public WebBeanDiscoveryImpl(ServletContext servletContext) {}]]>"
-
#~ msgid ""
#~ "The servlet context can be used to allow your implementation of "
#~ "<literal>WebBeanDiscovery</literal> to interact with the container."
@@ -1024,7 +754,6 @@
#~ "Il contesto del servlet può essere usato per consentire "
#~ "all'implementazione di <literal>WebBeanDiscovery</literal> di interagire "
#~ "con il container."
-
#~ msgid ""
#~ "The Web Beans RI can be told to load your implementation of "
#~ "<literal>EjbDiscovery</literal> using the property <literal>org.jboss."
@@ -1035,19 +764,16 @@
#~ "<literal>EjbDiscovery</literal> usando la proprietà <literal>org.jboss."
#~ "webbeans.bootstrap.spi.EjbDiscovery</literal> con il nome della classe "
#~ "pienamente qualificato (fully qualified) come valore. Per esempio:"
-
#~ msgid ""
#~ "org.jboss.webbeans.bootstrap.spi.EjbDiscovery= \\\n"
#~ " org.jboss.webbeans.integration.jbossas.EjbDiscoveryImpl"
#~ msgstr ""
#~ "org.jboss.webbeans.bootstrap.spi.EjbDiscovery= \\\n"
#~ " org.jboss.webbeans.integration.jbossas.EjbDiscoveryImpl"
-
#~ msgid ""
#~ "<![CDATA[public EjbDiscoveryImpl(ServletContext servletContext) {}]]>"
#~ msgstr ""
#~ "<![CDATA[public EjbDiscoveryImpl(ServletContext servletContext) {}]]>"
-
#~ msgid ""
#~ "The servlet context can be used to allow your implementation of "
#~ "<literal>EjbDiscovery</literal> to interact with the container."
@@ -1055,19 +781,15 @@
#~ "Il contesto del servlet può essere usato per consentire "
#~ "all'implementazione di <literal>EjbDiscovery</literal> di interagire con "
#~ "il container."
-
#~ msgid "and tell the RI to use it:"
#~ msgstr "e dire a RI di usarlo:"
-
#~ msgid ""
#~ "org.jboss.webbeans.resources.spi.NamingContext=com.acme.MyNamingContext"
#~ msgstr ""
#~ "org.jboss.webbeans.resources.spi.NamingContext=com.acme.MyNamingContext"
-
#~ msgid "<![CDATA[public MyNamingContext(ServletContext servletContext) {}]]>"
#~ msgstr ""
#~ "<![CDATA[public MyNamingContext(ServletContext servletContext) {}]]>"
-
#~ msgid ""
#~ "The servlet context can be used to allow your implementation of "
#~ "<literal>NamingContext</literal> to interact with the container."
@@ -1075,17 +797,14 @@
#~ "Il contesto del servlet può essere usato per consentire "
#~ "all'implementazione di <literal>NamingContext</literal> di interagire con "
#~ "il container."
-
#~ msgid ""
#~ "org.jboss.webbeans.resources.spi.ResourceLoader=com.acme.ResourceLoader"
#~ msgstr ""
#~ "org.jboss.webbeans.resources.spi.ResourceLoader=com.acme.ResourceLoader"
-
#~ msgid ""
#~ "<![CDATA[public MyResourceLoader(ServletContext servletContext) {}]]>"
#~ msgstr ""
#~ "<![CDATA[public MyResourceLoader(ServletContext servletContext) {}]]>"
-
#~ msgid ""
#~ "The servlet context can be used to allow your implementation of "
#~ "<literal>ResourceLoader</literal> to interact with the container."
@@ -1093,15 +812,14 @@
#~ "Il contesto del servlet può essere usato per consentire "
#~ "all'implementazione di <literal>ResourceLoader</literal> di interagire "
#~ "con il container."
-
#~ msgid "Currently, the only SPI to implement is the bootstrap spi:"
#~ msgstr ""
#~ "Attualmente l'unico SPI (Service Provider Interface) da implementare è "
#~ "l'spi di bootstrap:"
-
#~ msgid ""
#~ "The property can either be specified as a system property, or in a "
#~ "properties file <literal>META-INF/web-beans-ri.properties</literal>."
#~ msgstr ""
#~ "La proprietà può essere specificata come proprietà di sistema o nel file "
#~ "di proprietà <literal>META-INF/web-beans-ri.properties</literal>."
+
Modified: doc/trunk/reference/it-IT/ri.po
===================================================================
--- doc/trunk/reference/it-IT/ri.po 2009-03-30 19:20:04 UTC (rev 2274)
+++ doc/trunk/reference/it-IT/ri.po 2009-03-30 19:49:39 UTC (rev 2275)
@@ -6,7 +6,7 @@
"Project-Id-Version: master.xml\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-03-28 17:09+0000\n"
-"PO-Revision-Date: 2009-03-17 21:28+0100\n"
+"PO-Revision-Date: 2009-03-30 21:48+0100\n"
"Last-Translator: Nicola Benaglia <nico.benaz(a)gmail.com>\n"
"Language-Team: none\n"
"MIME-Version: 1.0\n"
@@ -22,35 +22,14 @@
#. Tag: para
#: ri.xml:6
#, fuzzy, no-c-format
-msgid ""
-"The Web Beans is being developed at <ulink url=\"http://seamframework.org/"
-"WebBeans\">the Seam project</ulink>. You can download the latest developer "
-"release of Web Beans from the <ulink url=\"http://seamframework.org/Download"
-"\">the downloads page</ulink>."
-msgstr ""
-"La Web Beans Reference Implementation viene sviluppata all'indirizzo <ulink "
-"url=\"http://seamframework.org/WebBeans\">the Seam project</ulink>. Si può "
-"scaricare l'ultima release di Web Beans dalla <ulink url=\"http://"
-"seamframework.org/Download\">pagina di download</ulink>."
+msgid "The Web Beans is being developed at <ulink url=\"http://seamframework.org/WebBeans\">the Seam project</ulink>. You can download the latest developer release of Web Beans from the <ulink url=\"http://seamframework.org/Download\">the downloads page</ulink>."
+msgstr "La Web Beans Reference Implementation viene sviluppata all'indirizzo <ulink url=\"http://seamframework.org/WebBeans\">the Seam project</ulink>. Si può scaricare l'ultima release di Web Beans dalla <ulink url=\"http://seamframework.org/Download\">pagina di download</ulink>."
#. Tag: para
#: ri.xml:13
#, fuzzy, no-c-format
-msgid ""
-"Web Beans comes with a two deployable example applications: "
-"<literal>webbeans-numberguess</literal>, a war example, containing only "
-"simple beans, and <literal>webbeans-translator</literal> an ear example, "
-"containing enterprise beans. There are also two variations on the "
-"numberguess example, the tomcat example (suitable for deployment to Tomcat) "
-"and the jsf2 example, which you can use if you are running JSF2. To run the "
-"examples you'll need the following:"
-msgstr ""
-"La Web Beans RI (Reference Implementation) viene distribuita con due "
-"applicazioni deployabili d'esempio, <literal>webbeans-numberguess</literal>, "
-"un esempio in formato war, che contiene solo bean semplici, e "
-"<literal>webbeans-translator</literal>, un esempio in formato ear, che "
-"contiene bean enterprise. Per eseguire gli esempi occorre fare le seguenti "
-"cose:"
+msgid "Web Beans comes with a two deployable example applications: <literal>webbeans-numberguess</literal>, a war example, containing only simple beans, and <literal>webbeans-translator</literal> an ear example, containing enterprise beans. There are also two variations on the numberguess example, the tomcat example (suitable for deployment to Tomcat) and the jsf2 example, which you can use if you are running JSF2. To run the examples you'll need the following:"
+msgstr "La Web Beans RI (Reference Implementation) viene distribuita con due applicazioni deployabili d'esempio, <literal>webbeans-numberguess</literal>, un esempio in formato war, che contiene solo bean semplici, e <literal>webbeans-translator</literal>, un esempio in formato ear, che contiene bean enterprise. Per eseguire gli esempi occorre fare le seguenti cose:"
#. Tag: para
#: ri.xml:25
@@ -60,15 +39,15 @@
#. Tag: para
#: ri.xml:28
-#, fuzzy, no-c-format
+#, no-c-format
msgid "JBoss AS 5.0.1.GA, or"
-msgstr "JBoss AS 5.0.1.GA, e"
+msgstr "JBoss AS 5.0.1.GA, o"
#. Tag: para
#: ri.xml:31
#, no-c-format
msgid "Apache Tomcat 6.0.x, and"
-msgstr ""
+msgstr "Apache Tomcat 6.0.x, e"
#. Tag: para
#: ri.xml:34
@@ -80,19 +59,13 @@
#: ri.xml:39
#, no-c-format
msgid "Using JBoss AS 5"
-msgstr ""
+msgstr "Usare JBoss AS 5"
#. Tag: para
#: ri.xml:41
#, fuzzy, no-c-format
-msgid ""
-"You'll need to download JBoss AS 5.0.1.GA from <ulink url=\"http://www.jboss."
-"org/jbossas/downloads/\">jboss.org</ulink>, and unzip it. For example:"
-msgstr ""
-"Attualmente, la RI di Web Beans può essere eseguita solo sull'Application "
-"Server 5 di JBoss. Occorre scaricare JBoss AS 5.0.1.GA da <ulink url="
-"\"http://www.jboss.org/jbossas/downloads/\">jboss.org</ulink>, e "
-"scompattarlo. Per esempio:"
+msgid "You'll need to download JBoss AS 5.0.1.GA from <ulink url=\"http://www.jboss.org/jbossas/downloads/\">jboss.org</ulink>, and unzip it. For example:"
+msgstr "Attualmente, la RI di Web Beans può essere eseguita solo sull'Application Server 5 di JBoss. Occorre scaricare JBoss AS 5.0.1.GA da <ulink url=\"http://www.jboss.org/jbossas/downloads/\">jboss.org</ulink>, e scompattarlo. Per esempio:"
#. Tag: programlisting
#: ri.xml:47
@@ -105,17 +78,15 @@
"$ unzip ~/jboss-5.0.1.GA.zip]]>"
#. Tag: para
-#: ri.xml:49 ri.xml:170
+#: ri.xml:49
+#: ri.xml:170
#, fuzzy, no-c-format
-msgid ""
-"Next, download Web Beans from <ulink url=\"http://seamframework.org/Download"
-"\">seamframework.org</ulink>, and unzip it. For example"
-msgstr ""
-"Scaricare Web Beans RI da <ulink url=\"http://seamframework.org/Download"
-"\">seamframework.org</ulink>, e scompattarla. Per esempio"
+msgid "Next, download Web Beans from <ulink url=\"http://seamframework.org/Download\">seamframework.org</ulink>, and unzip it. For example"
+msgstr "Scaricare Web Beans RI da <ulink url=\"http://seamframework.org/Download\">seamframework.org</ulink>, e scompattarla. Per esempio"
#. Tag: programlisting
-#: ri.xml:55 ri.xml:176
+#: ri.xml:55
+#: ri.xml:176
#, no-c-format
msgid ""
"<![CDATA[$ cd ~/\n"
@@ -127,14 +98,8 @@
#. Tag: para
#: ri.xml:58
#, no-c-format
-msgid ""
-"Next, we need to tell Web Beans where JBoss is located. Edit <literal>jboss-"
-"as/build.properties</literal> and set the <literal>jboss.home</literal> "
-"property. For example:"
-msgstr ""
-"Quindi, occorre indicare a Web Beans dove è stato installato JBoss. "
-"Modificate il file <literal>jboss-as/build.properties</literal> e "
-"valorizzate la proprietà <literal>jboss.home</literal>. Per esempio:"
+msgid "Next, we need to tell Web Beans where JBoss is located. Edit <literal>jboss-as/build.properties</literal> and set the <literal>jboss.home</literal> property. For example:"
+msgstr "Quindi, occorre indicare a Web Beans dove è stato installato JBoss. Modificate il file <literal>jboss-as/build.properties</literal> e valorizzate la proprietà <literal>jboss.home</literal>. Per esempio:"
#. Tag: programlisting
#: ri.xml:64
@@ -145,12 +110,8 @@
#. Tag: para
#: ri.xml:66
#, no-c-format
-msgid ""
-"To install Web Beans, you'll need Ant 1.7.0 installed, and the "
-"<literal>ANT_HOME</literal> environment variable set. For example:"
-msgstr ""
-"Per installare Web Beans, occorre avere installato Ant 1.7.0, e avere "
-"valorizzato la variabile d'ambiente <literal>ANT_HOME</literal>. Per esempio:"
+msgid "To install Web Beans, you'll need Ant 1.7.0 installed, and the <literal>ANT_HOME</literal> environment variable set. For example:"
+msgstr "Per installare Web Beans, occorre avere installato Ant 1.7.0, e avere valorizzato la variabile d'ambiente <literal>ANT_HOME</literal>. Per esempio:"
#. Tag: programlisting
#: ri.xml:71
@@ -165,12 +126,8 @@
#. Tag: para
#: ri.xml:73
#, no-c-format
-msgid ""
-"Then, you can install the update. The update script will use Maven to "
-"download Web Beans automatically."
-msgstr ""
-"Quindi, è possibile installare gli aggiornamenti. Lo script di aggiornamento "
-"userà Maven per scaricare automaticamente Web Beans."
+msgid "Then, you can install the update. The update script will use Maven to download Web Beans automatically."
+msgstr "Quindi, è possibile installare gli aggiornamenti. Lo script di aggiornamento userà Maven per scaricare automaticamente Web Beans."
#. Tag: programlisting
#: ri.xml:78
@@ -191,37 +148,26 @@
#. Tag: para
#: ri.xml:85
#, fuzzy, no-c-format
-msgid ""
-"The build scripts for the examples offer a number of targets for JBoss AS, "
-"these are:"
-msgstr ""
-"Gli script di build degli esempio offrono una quantità di target, cioè:"
+msgid "The build scripts for the examples offer a number of targets for JBoss AS, these are:"
+msgstr "Gli script di build degli esempio offrono una quantità di target, cioè:"
#. Tag: para
#: ri.xml:91
#, no-c-format
msgid "<literal>ant restart</literal> - deploy the example in exploded format"
-msgstr ""
-"<literal>ant restart</literal> - fa il deploy dell'esempio in formato esploso"
+msgstr "<literal>ant restart</literal> - fa il deploy dell'esempio in formato esploso"
#. Tag: para
#: ri.xml:97
#, no-c-format
-msgid ""
-"<literal>ant explode</literal> - update an exploded example, without "
-"restarting the deployment"
-msgstr ""
-"<literal>ant explode</literal> - aggiorna un esempio in formato esploso, "
-"senza riavviare il deploy"
+msgid "<literal>ant explode</literal> - update an exploded example, without restarting the deployment"
+msgstr "<literal>ant explode</literal> - aggiorna un esempio in formato esploso, senza riavviare il deploy"
#. Tag: para
#: ri.xml:103
#, no-c-format
-msgid ""
-"<literal>ant deploy</literal> - deploy the example in compressed jar format"
-msgstr ""
-"<literal>ant deploy</literal> - fa il deploy dell'esempio in formato jar "
-"compresso"
+msgid "<literal>ant deploy</literal> - deploy the example in compressed jar format"
+msgstr "<literal>ant deploy</literal> - fa il deploy dell'esempio in formato jar compresso"
#. Tag: para
#: ri.xml:108
@@ -270,29 +216,17 @@
msgstr "Se si usa Windows, si usi lo script <literal>run.bat</literal>."
#. Tag: para
-#: ri.xml:138 ri.xml:240
+#: ri.xml:138
+#: ri.xml:240
#, no-c-format
-msgid ""
-"Wait for the application to deploy, and enjoy hours of fun at <ulink url="
-"\"http://localhost:8080/webbeans-numberguess\"></ulink>!"
-msgstr ""
-"Attendete che l'applicazione sia installata, e godetevi ore di divertimento "
-"all'indirizzo <ulink url=\"http://localhost:8080/webbeans-numberguess\"></"
-"ulink>!"
+msgid "Wait for the application to deploy, and enjoy hours of fun at <ulink url=\"http://localhost:8080/webbeans-numberguess\"></ulink>!"
+msgstr "Attendete che l'applicazione sia installata, e godetevi ore di divertimento all'indirizzo <ulink url=\"http://localhost:8080/webbeans-numberguess\"></ulink>!"
#. Tag: para
#: ri.xml:143
#, fuzzy, no-c-format
-msgid ""
-"Web Beans includes a second simple example that will translate your text "
-"into Latin. The numberguess example is a war example, and uses only simple "
-"beans; the translator example is an ear example, and includes enterprise "
-"beans, packaged in an EJB module. To try it out:"
-msgstr ""
-"La RI di Web Beans include un secondo semplice esempio che tradurrà i vostri "
-"testi in Latino. L'esempio Indovina Numero è in formato war, e usa soltanto "
-"bean semplici; l'esempio col traduttore è in formato ear, e include dei bean "
-"enterprise, assemblati in un modulo EJB. Per provarlo:"
+msgid "Web Beans includes a second simple example that will translate your text into Latin. The numberguess example is a war example, and uses only simple beans; the translator example is an ear example, and includes enterprise beans, packaged in an EJB module. To try it out:"
+msgstr "La RI di Web Beans include un secondo semplice esempio che tradurrà i vostri testi in Latino. L'esempio Indovina Numero è in formato war, e usa soltanto bean semplici; l'esempio col traduttore è in formato ear, e include dei bean enterprise, assemblati in un modulo EJB. Per provarlo:"
#. Tag: programlisting
#: ri.xml:150
@@ -307,100 +241,71 @@
#. Tag: para
#: ri.xml:152
#, no-c-format
-msgid ""
-"Wait for the application to deploy, and visit <ulink url=\"http://"
-"localhost:8080/webbeans-translator\"></ulink>!"
-msgstr ""
-"Attendete che l'applicazione sia installata, e visitate l'indirizzo <ulink "
-"url=\"http://localhost:8080/webbeans-translator\"></ulink>!"
+msgid "Wait for the application to deploy, and visit <ulink url=\"http://localhost:8080/webbeans-translator\"></ulink>!"
+msgstr "Attendete che l'applicazione sia installata, e visitate l'indirizzo <ulink url=\"http://localhost:8080/webbeans-translator\"></ulink>!"
#. Tag: title
#: ri.xml:160
#, no-c-format
msgid "Using Apache Tomcat 6.0"
-msgstr ""
+msgstr "Usare Apache Tomcat 6.0"
#. Tag: para
#: ri.xml:162
#, fuzzy, no-c-format
-msgid ""
-"You'll need to download Tomcat 6.0.18 or later from <ulink url=\"http://"
-"tomcat.apache.org/download-60.cgi\">tomcat.apache.org</ulink>, and unzip it. "
-"For example:"
-msgstr ""
-"Scaricare Web Beans RI da <ulink url=\"http://seamframework.org/Download"
-"\">seamframework.org</ulink>, e scompattarla. Per esempio"
+msgid "You'll need to download Tomcat 6.0.18 or later from <ulink url=\"http://tomcat.apache.org/download-60.cgi\">tomcat.apache.org</ulink>, and unzip it. For example:"
+msgstr "Scaricare Web Beans RI da <ulink url=\"http://seamframework.org/Download\">seamframework.org</ulink>, e scompattarla. Per esempio"
#. Tag: programlisting
#: ri.xml:168
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"<![CDATA[$ cd /Applications\n"
"$ unzip ~/apache-tomcat-6.0.18.zip]]>"
msgstr ""
"<![CDATA[$ cd /Applications\n"
-"$ unzip ~/jboss-5.0.1.GA.zip]]>"
+"$ unzip ~/apache-tomcat-6.0.18.zip]]>"
#. Tag: para
#: ri.xml:178
#, fuzzy, no-c-format
-msgid ""
-"Next, we need to tell Web Beans where Tomcat is located. Edit <literal>jboss-"
-"as/build.properties</literal> and set the <literal>tomcat.home</literal> "
-"property. For example:"
-msgstr ""
-"Quindi, occorre indicare a Web Beans dove è stato installato JBoss. "
-"Modificate il file <literal>jboss-as/build.properties</literal> e "
-"valorizzate la proprietà <literal>jboss.home</literal>. Per esempio:"
+msgid "Next, we need to tell Web Beans where Tomcat is located. Edit <literal>jboss-as/build.properties</literal> and set the <literal>tomcat.home</literal> property. For example:"
+msgstr "Quindi, occorre indicare a Web Beans dove è stato installato JBoss. Modificate il file <literal>jboss-as/build.properties</literal> e valorizzate la proprietà <literal>jboss.home</literal>. Per esempio:"
#. Tag: programlisting
#: ri.xml:184
-#, fuzzy, no-c-format
+#, no-c-format
msgid "tomcat.home=/Applications/apache-tomcat-6.0.18"
-msgstr "jboss.home=/Applications/jboss-5.0.1.GA"
+msgstr "tomcat.home=/Applications/apache-tomcat-6.0.18"
#. Tag: para
#: ri.xml:187
#, fuzzy, no-c-format
-msgid ""
-"The build scripts for the examples offer a number of targets for Tomcat, "
-"these are:"
-msgstr ""
-"Gli script di build degli esempio offrono una quantità di target, cioè:"
+msgid "The build scripts for the examples offer a number of targets for Tomcat, these are:"
+msgstr "Gli script di build degli esempio offrono una quantità di target, cioè:"
#. Tag: para
#: ri.xml:193
#, fuzzy, no-c-format
-msgid ""
-"<literal>ant tomcat.restart</literal> - deploy the example in exploded format"
-msgstr ""
-"<literal>ant restart</literal> - fa il deploy dell'esempio in formato esploso"
+msgid "<literal>ant tomcat.restart</literal> - deploy the example in exploded format"
+msgstr "<literal>ant restart</literal> - fa il deploy dell'esempio in formato esploso"
#. Tag: para
#: ri.xml:199
#, fuzzy, no-c-format
-msgid ""
-"<literal>ant tomcat.explode</literal> - update an exploded example, without "
-"restarting the deployment"
-msgstr ""
-"<literal>ant explode</literal> - aggiorna un esempio in formato esploso, "
-"senza riavviare il deploy"
+msgid "<literal>ant tomcat.explode</literal> - update an exploded example, without restarting the deployment"
+msgstr "<literal>ant explode</literal> - aggiorna un esempio in formato esploso, senza riavviare il deploy"
#. Tag: para
#: ri.xml:205
#, fuzzy, no-c-format
-msgid ""
-"<literal>ant tomcat.deploy</literal> - deploy the example in compressed jar "
-"format"
-msgstr ""
-"<literal>ant deploy</literal> - fa il deploy dell'esempio in formato jar "
-"compresso"
+msgid "<literal>ant tomcat.deploy</literal> - deploy the example in compressed jar format"
+msgstr "<literal>ant deploy</literal> - fa il deploy dell'esempio in formato jar compresso"
#. Tag: para
#: ri.xml:210
#, fuzzy, no-c-format
-msgid ""
-"<literal>ant tomcat.undeploy</literal> - remove the example from the server"
+msgid "<literal>ant tomcat.undeploy</literal> - remove the example from the server"
msgstr "<literal>ant undeploy</literal> - rimuove l'esempio dal server"
#. Tag: para
@@ -417,43 +322,43 @@
#. Tag: programlisting
#: ri.xml:226
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
"$ cd examples/tomcat\n"
"ant tomcat.deploy"
msgstr ""
-"$ cd examples/translator\n"
-"ant deploy"
+"$ cd examples/tomcat\n"
+"ant tomcat.deploy"
#. Tag: para
#: ri.xml:228
#, no-c-format
msgid "Start Tomcat:"
-msgstr ""
+msgstr "Avviare Tomcat:"
#. Tag: programlisting
#: ri.xml:232
-#, fuzzy, no-c-format
+#, no-c-format
msgid "$ /Applications/apache-tomcat-6.0.18/bin/startup.sh"
-msgstr "$ /Application/jboss-5.0.0.GA/bin/run.sh"
+msgstr "$ /Applications/apache-tomcat-6.0.18/bin/startup.sh"
#. Tag: para
#: ri.xml:235
-#, fuzzy, no-c-format
+#, no-c-format
msgid "If you use Windows, use the <literal>startup.bat</literal>script."
-msgstr "Se si usa Windows, si usi lo script <literal>run.bat</literal>."
+msgstr "Se si usa Windows, si usi lo script <literal>startup.bat</literal>."
#. Tag: title
#: ri.xml:248
#, no-c-format
msgid "Using GlassFish"
-msgstr ""
+msgstr "Usare GlassFish"
#. Tag: para
#: ri.xml:250
#, no-c-format
msgid "TODO"
-msgstr ""
+msgstr "DA FARE"
#. Tag: title
#: ri.xml:254
@@ -464,40 +369,20 @@
#. Tag: para
#: ri.xml:256
#, no-c-format
-msgid ""
-"In the numberguess application you get given 10 attempts to guess a number "
-"between 1 and 100. After each attempt, you will be told whether you are too "
-"high, or too low."
-msgstr ""
-"Nell'applicazione Indovina Numero avete a disposizione 10 tentativi per "
-"indovinare un numero tra 1 e 100. Dopo ciascun tentativo, siete informati se "
-"siete stati troppo alti o troppo bassi."
+msgid "In the numberguess application you get given 10 attempts to guess a number between 1 and 100. After each attempt, you will be told whether you are too high, or too low."
+msgstr "Nell'applicazione Indovina Numero avete a disposizione 10 tentativi per indovinare un numero tra 1 e 100. Dopo ciascun tentativo, siete informati se siete stati troppo alti o troppo bassi."
#. Tag: para
#: ri.xml:262
#, no-c-format
-msgid ""
-"The numberguess example is comprised of a number of Web Beans, configuration "
-"files, and Facelet JSF pages, packaged as a war. Let's start with the "
-"configuration files."
-msgstr ""
-"L'esempio Indovina Numero comprende un certo numero di Web Bean, file di "
-"configurazione e pagine JSF, assemblati in un war. Iniziamo dai file di "
-"configurazione."
+msgid "The numberguess example is comprised of a number of Web Beans, configuration files, and Facelet JSF pages, packaged as a war. Let's start with the configuration files."
+msgstr "L'esempio Indovina Numero comprende un certo numero di Web Bean, file di configurazione e pagine JSF, assemblati in un war. Iniziamo dai file di configurazione."
#. Tag: para
#: ri.xml:268
#, no-c-format
-msgid ""
-"All the configuration files for this example are located in <literal>WEB-INF/"
-"</literal>, which is stored in <literal>WebContent</literal> in the source "
-"tree. First, we have <literal>faces-config.xml</literal>, in which we tell "
-"JSF to use Facelets:"
-msgstr ""
-"Tutti i file di configurazione di questo esempio si trovano in <literal>WEB-"
-"INF/</literal>, che è situato in <literal>WebContent</literal> nell'albero "
-"dei sorgenti. Innanzitutto, c'è <literal>faces-config.xml</literal>, in cui "
-"JSF viene informata di usare Facelets:"
+msgid "All the configuration files for this example are located in <literal>WEB-INF/</literal>, which is stored in <literal>WebContent</literal> in the source tree. First, we have <literal>faces-config.xml</literal>, in which we tell JSF to use Facelets:"
+msgstr "Tutti i file di configurazione di questo esempio si trovano in <literal>WEB-INF/</literal>, che è situato in <literal>WebContent</literal> nell'albero dei sorgenti. Innanzitutto, c'è <literal>faces-config.xml</literal>, in cui JSF viene informata di usare Facelets:"
#. Tag: programlisting
#: ri.xml:276
@@ -507,8 +392,7 @@
"<faces-config version=\"1.2\"\n"
" xmlns=\"http://java.sun.com/xml/ns/javaee\"\n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://"
-"java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd\">\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd\">\n"
" \n"
" <application>\n"
" <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>\n"
@@ -520,8 +404,7 @@
"<faces-config version=\"1.2\"\n"
" xmlns=\"http://java.sun.com/xml/ns/javaee\"\n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://"
-"java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd\">\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd\">\n"
" \n"
" <application>\n"
" <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>\n"
@@ -532,12 +415,8 @@
#. Tag: para
#: ri.xml:278
#, no-c-format
-msgid ""
-"There is an empty <literal>web-beans.xml</literal> file, which marks this "
-"application as a Web Beans application."
-msgstr ""
-"Vi è un file vuoto <literal>web-beans.xml</literal>, che identifica "
-"l'applicazione come applicazione Web Beans."
+msgid "There is an empty <literal>web-beans.xml</literal> file, which marks this application as a Web Beans application."
+msgstr "Vi è un file vuoto <literal>web-beans.xml</literal>, che identifica l'applicazione come applicazione Web Beans."
#. Tag: para
#: ri.xml:283
@@ -547,19 +426,14 @@
#. Tag: section
#: ri.xml:285
-#, fuzzy, no-c-format
+#, no-c-format
msgid ""
-"<programlistingco> <areaspec> <area id=\"faces.servlet\" coords=\"12\"/> "
-"<area id=\"faces.servlet.mapping\" coords=\"18\"/> <area id=\"faces.default."
-"suffix\" coords=\"23\"/> <area id=\"session.timeout\" coords=\"28\"/> <area "
-"id=\"webbeans.listener\" coords=\"32\"/> </areaspec> <programlisting><![CDATA"
-"[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<programlistingco> <areaspec> <area id=\"faces.servlet\" coords=\"12\"/> <area id=\"faces.servlet.mapping\" coords=\"18\"/> <area id=\"faces.default.suffix\" coords=\"23\"/> <area id=\"session.timeout\" coords=\"28\"/> <area id=\"webbeans.listener\" coords=\"32\"/> </areaspec> <programlisting><![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"\n"
"<web-app version=\"2.5\"\n"
" xmlns=\"http://java.sun.com/xml/ns/javaee\"\n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun."
-"com/xml/ns/javaee/web-app_2_5.xsd\">\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\">\n"
" \n"
" <display-name>Web Beans Numbergues example</display-name>\n"
"\n"
@@ -585,23 +459,7 @@
" <session-timeout>10</session-timeout>\n"
" </session-config>\n"
"\n"
-"</web-app>]]></programlisting> <calloutlist> <callout arearefs=\"faces."
-"servlet\"> <para> Enable and load the JSF servlet </para> </callout> "
-"<callout arearefs=\"faces.servlet.mapping\"> <para> Configure requests to "
-"<literal>.jsf</literal> pages to be handled by JSF </para> </callout> "
-"<callout arearefs=\"faces.default.suffix\"> <para> Tell JSF that we will be "
-"giving our source files (facelets) an extension of <literal>.jsf</literal> </"
-"para> </callout> <callout arearefs=\"session.timeout\"> <para> Configure a "
-"session timeout of 10 minutes </para> </callout> </calloutlist> </"
-"programlistingco> <note> <para> Whilst this demo is a JSF demo, you can use "
-"Web Beans with any Servlet based web framework. </para> </note> <para> Let's "
-"take a look at the Facelet view: </para> <programlistingco> <areaspec> <area "
-"id=\"template\" coords=\"8\"/> <area id=\"messages\" coords=\"12\"/> <area "
-"id=\"instructions\" coords=\"19\"/> <area id=\"guess\" coords=\"25\"/> <area "
-"id=\"validator\" coords=\"30\"/> <area id=\"submit\" coords=\"33\"/> </"
-"areaspec> <programlisting><![CDATA[<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML "
-"1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional."
-"dtd\">\n"
+"</web-app>]]></programlisting> <calloutlist> <callout arearefs=\"faces.servlet\"> <para> Enable and load the JSF servlet </para> </callout> <callout arearefs=\"faces.servlet.mapping\"> <para> Configure requests to <literal>.jsf</literal> pages to be handled by JSF </para> </callout> <callout arearefs=\"faces.default.suffix\"> <para> Tell JSF that we will be giving our source files (facelets) an extension of <literal>.jsf</literal> </para> </callout> <callout arearefs=\"session.timeout\"> <para> Configure a session timeout of 10 minutes </para> </callout> </calloutlist> </programlistingco> <note> <para> Whilst this demo is a JSF demo, you can use Web Beans with any Servlet based web framework. </para> </note> <para> Let's take a look at the Facelet view: </para> <programlistingco> <areaspec> <area id=\"template\" coords=\"8\"/> <area id=\"messages\" coords=\"12\"/> <area id=\"instructions\" coords=\"19\"/> <area id=\"guess\" coords=\"25\"/> <area id=\"validator\" coords=\"3!
0\"/> <area id=\"submit\" coords=\"33\"/> </areaspec> <programlisting><![CDATA[<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\"\n"
" xmlns:ui=\"http://java.sun.com/jsf/facelets\"\n"
" xmlns:h=\"http://java.sun.com/jsf/html\"\n"
@@ -614,15 +472,12 @@
" <h:form id=\"NumberGuessMain\">\n"
" <div style=\"color: red\">\n"
" <h:messages id=\"messages\" globalOnly=\"false\"/>\n"
-" <h:outputText id=\"Higher\" value=\"Higher!\" rendered=\"#{game."
-"number gt game.guess and game.guess ne 0}\"/>\n"
-" <h:outputText id=\"Lower\" value=\"Lower!\" rendered=\"#{game."
-"number lt game.guess and game.guess ne 0}\"/>\n"
+" <h:outputText id=\"Higher\" value=\"Higher!\" rendered=\"#{game.number gt game.guess and game.guess ne 0}\"/>\n"
+" <h:outputText id=\"Lower\" value=\"Lower!\" rendered=\"#{game.number lt game.guess and game.guess ne 0}\"/>\n"
" </div>\n"
" \n"
" <div>\n"
-" I'm thinking of a number between #{game.smallest} and #{game."
-"biggest}.\n"
+" I'm thinking of a number between #{game.smallest} and #{game.biggest}.\n"
" You have #{game.remainingGuesses} guesses.\n"
" </div>\n"
" \n"
@@ -642,41 +497,19 @@
" disabled=\"#{game.number eq game.guess}\"/>\n"
" </div>\n"
" <div>\n"
-" <h:commandButton id=\"RestartButton\" value=\"Reset\" action=\"#"
-"{game.reset}\" immediate=\"true\" />\n"
+" <h:commandButton id=\"RestartButton\" value=\"Reset\" action=\"#{game.reset}\" immediate=\"true\" />\n"
" </div>\n"
" </h:form>\n"
" </ui:define>\n"
" </ui:composition>\n"
-"</html>]]></programlisting> <calloutlist> <callout arearefs=\"template\"> "
-"<para> Facelets is a templating language for JSF, here we are wrapping our "
-"page in a template which defines the header. </para> </callout> <callout "
-"arearefs=\"messages\"> <para> There are a number of messages which can be "
-"sent to the user, \"Higher!\", \"Lower!\" and \"Correct!\" </para> </"
-"callout> <callout arearefs=\"instructions\"> <para> As the user guesses, the "
-"range of numbers they can guess gets smaller - this sentance changes to make "
-"sure they know what range to guess in. </para> </callout> <callout arearefs="
-"\"guess\"> <para> This input field is bound to a Web Bean, using the value "
-"expression. </para> </callout> <callout arearefs=\"validator\"> <para> A "
-"range validator is used to make sure the user doesn't accidentally input a "
-"number outside of the range in which they can guess - if the validator "
-"wasn't here, the user might use up a guess on an out of range number. </"
-"para> </callout> <callout arearefs=\"submit\"> <para> And, of course, there "
-"must be a way for the user to send their guess to the server. Here we bind "
-"to an action method on the Web Bean. </para> </callout> </calloutlist> </"
-"programlistingco>"
+"</html>]]></programlisting> <calloutlist> <callout arearefs=\"template\"> <para> Facelets is a templating language for JSF, here we are wrapping our page in a template which defines the header. </para> </callout> <callout arearefs=\"messages\"> <para> There are a number of messages which can be sent to the user, \"Higher!\", \"Lower!\" and \"Correct!\" </para> </callout> <callout arearefs=\"instructions\"> <para> As the user guesses, the range of numbers they can guess gets smaller - this sentance changes to make sure they know what range to guess in. </para> </callout> <callout arearefs=\"guess\"> <para> This input field is bound to a Web Bean, using the value expression. </para> </callout> <callout arearefs=\"validator\"> <para> A range validator is used to make sure the user doesn't accidentally input a number outside of the range in which they can guess - if the validator wasn't here, the user might use up a guess on an out of range number. </para> </callout> <callout !
arearefs=\"submit\"> <para> And, of course, there must be a way for the user to send their guess to the server. Here we bind to an action method on the Web Bean. </para> </callout> </calloutlist> </programlistingco>"
msgstr ""
-"<programlistingco> <areaspec> <area id=\"faces.servlet\" coords=\"12\"/> "
-"<area id=\"faces.servlet.mapping\" coords=\"18\"/> <area id=\"faces.default."
-"suffix\" coords=\"23\"/> <area id=\"session.timeout\" coords=\"28\"/> <area "
-"id=\"webbeans.listener\" coords=\"32\"/> </areaspec> <programlisting><![CDATA"
-"[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+"<programlistingco> <areaspec> <area id=\"faces.servlet\" coords=\"12\"/> <area id=\"faces.servlet.mapping\" coords=\"18\"/> <area id=\"faces.default.suffix\" coords=\"23\"/> <area id=\"session.timeout\" coords=\"28\"/> <area id=\"webbeans.listener\" coords=\"32\"/> </areaspec> <programlisting><![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"\n"
"<web-app version=\"2.5\"\n"
" xmlns=\"http://java.sun.com/xml/ns/javaee\"\n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun."
-"com/xml/ns/javaee/web-app_2_5.xsd\">\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd\">\n"
" \n"
" <display-name>Web Beans Numbergues example</display-name>\n"
"\n"
@@ -702,23 +535,7 @@
" <session-timeout>10</session-timeout>\n"
" </session-config>\n"
"\n"
-"</web-app>]]></programlisting> <calloutlist> <callout arearefs=\"faces."
-"servlet\"> <para> Enable and load the JSF servlet </para> </callout> "
-"<callout arearefs=\"faces.servlet.mapping\"> <para> Configure requests to "
-"<literal>.jsf</literal> pages to be handled by JSF </para> </callout> "
-"<callout arearefs=\"faces.default.suffix\"> <para> Tell JSF that we will be "
-"giving our source files (facelets) an extension of <literal>.jsf</literal> </"
-"para> </callout> <callout arearefs=\"session.timeout\"> <para> Configure a "
-"session timeout of 10 minutes </para> </callout> </calloutlist> </"
-"programlistingco> <note> <para> Whilst this demo is a JSF demo, you can use "
-"the Web Beans RI with any Servlet based web framework. </para> </note> "
-"<para> Let's take a look at the Facelet view: </para> <programlistingco> "
-"<areaspec> <area id=\"template\" coords=\"8\"/> <area id=\"messages\" coords="
-"\"12\"/> <area id=\"instructions\" coords=\"19\"/> <area id=\"guess\" coords="
-"\"25\"/> <area id=\"validator\" coords=\"30\"/> <area id=\"submit\" coords="
-"\"33\"/> </areaspec> <programlisting><![CDATA[<!DOCTYPE html PUBLIC \"-//"
-"W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/"
-"xhtml1-transitional.dtd\">\n"
+"</web-app>]]></programlisting> <calloutlist> <callout arearefs=\"faces.servlet\"> <para> Enable and load the JSF servlet </para> </callout> <callout arearefs=\"faces.servlet.mapping\"> <para> Configure requests to <literal>.jsf</literal> pages to be handled by JSF </para> </callout> <callout arearefs=\"faces.default.suffix\"> <para> Tell JSF that we will be giving our source files (facelets) an extension of <literal>.jsf</literal> </para> </callout> <callout arearefs=\"session.timeout\"> <para> Configure a session timeout of 10 minutes </para> </callout> </calloutlist> </programlistingco> <note> <para> Whilst this demo is a JSF demo, you can use Web Beans with any Servlet based web framework. </para> </note> <para> Let's take a look at the Facelet view: </para> <programlistingco> <areaspec> <area id=\"template\" coords=\"8\"/> <area id=\"messages\" coords=\"12\"/> <area id=\"instructions\" coords=\"19\"/> <area id=\"guess\" coords=\"25\"/> <area id=\"validator\" coords=\"3!
0\"/> <area id=\"submit\" coords=\"33\"/> </areaspec> <programlisting><![CDATA[<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"
"<html xmlns=\"http://www.w3.org/1999/xhtml\"\n"
" xmlns:ui=\"http://java.sun.com/jsf/facelets\"\n"
" xmlns:h=\"http://java.sun.com/jsf/html\"\n"
@@ -731,15 +548,12 @@
" <h:form id=\"NumberGuessMain\">\n"
" <div style=\"color: red\">\n"
" <h:messages id=\"messages\" globalOnly=\"false\"/>\n"
-" <h:outputText id=\"Higher\" value=\"Higher!\" rendered=\"#{game."
-"number gt game.guess and game.guess ne 0}\"/>\n"
-" <h:outputText id=\"Lower\" value=\"Lower!\" rendered=\"#{game."
-"number lt game.guess and game.guess ne 0}\"/>\n"
+" <h:outputText id=\"Higher\" value=\"Higher!\" rendered=\"#{game.number gt game.guess and game.guess ne 0}\"/>\n"
+" <h:outputText id=\"Lower\" value=\"Lower!\" rendered=\"#{game.number lt game.guess and game.guess ne 0}\"/>\n"
" </div>\n"
" \n"
" <div>\n"
-" I'm thinking of a number between #{game.smallest} and #{game."
-"biggest}.\n"
+" I'm thinking of a number between #{game.smallest} and #{game.biggest}.\n"
" You have #{game.remainingGuesses} guesses.\n"
" </div>\n"
" \n"
@@ -759,41 +573,18 @@
" disabled=\"#{game.number eq game.guess}\"/>\n"
" </div>\n"
" <div>\n"
-" <h:commandButton id=\"RestartButton\" value=\"Reset\" action=\"#"
-"{game.reset}\" immediate=\"true\" />\n"
+" <h:commandButton id=\"RestartButton\" value=\"Reset\" action=\"#{game.reset}\" immediate=\"true\" />\n"
" </div>\n"
" </h:form>\n"
" </ui:define>\n"
" </ui:composition>\n"
-"</html>]]></programlisting> <calloutlist> <callout arearefs=\"template\"> "
-"<para> Facelets is a templating language for JSF, here we are wrapping our "
-"page in a template which defines the header. </para> </callout> <callout "
-"arearefs=\"messages\"> <para> There are a number of messages which can be "
-"sent to the user, \"Higher!\", \"Lower!\" and \"Correct!\" </para> </"
-"callout> <callout arearefs=\"instructions\"> <para> As the user guesses, the "
-"range of numbers they can guess gets smaller - this sentance changes to make "
-"sure they know what range to guess in. </para> </callout> <callout arearefs="
-"\"guess\"> <para> This input field is bound to a Web Bean, using the value "
-"expression. </para> </callout> <callout arearefs=\"validator\"> <para> A "
-"range validator is used to make sure the user doesn't accidentally input a "
-"number outside of the range in which they can guess - if the validator "
-"wasn't here, the user might use up a guess on an out of range number. </"
-"para> </callout> <callout arearefs=\"submit\"> <para> And, of course, there "
-"must be a way for the user to send their guess to the server. Here we bind "
-"to an action method on the Web Bean. </para> </callout> </calloutlist> </"
-"programlistingco>"
+"</html>]]></programlisting> <calloutlist> <callout arearefs=\"template\"> <para> Facelets is a templating language for JSF, here we are wrapping our page in a template which defines the header. </para> </callout> <callout arearefs=\"messages\"> <para> There are a number of messages which can be sent to the user, \"Higher!\", \"Lower!\" and \"Correct!\" </para> </callout> <callout arearefs=\"instructions\"> <para> As the user guesses, the range of numbers they can guess gets smaller - this sentance changes to make sure they know what range to guess in. </para> </callout> <callout arearefs=\"guess\"> <para> This input field is bound to a Web Bean, using the value expression. </para> </callout> <callout arearefs=\"validator\"> <para> A range validator is used to make sure the user doesn't accidentally input a number outside of the range in which they can guess - if the validator wasn't here, the user might use up a guess on an out of range number. </para> </callout> <callout !
arearefs=\"submit\"> <para> And, of course, there must be a way for the user to send their guess to the server. Here we bind to an action method on the Web Bean. </para> </callout> </calloutlist> </programlistingco>"
#. Tag: para
#: ri.xml:387
#, no-c-format
-msgid ""
-"The example exists of 4 classes, the first two of which are binding types. "
-"First, there is the <literal>@Random</literal> binding type, used for "
-"injecting a random number:"
-msgstr ""
-"L'esempio consiste di 4 classi, delle quali le prime due sono tipi di "
-"binding. Innanzitutto, c'è il tipo di binding <literal>@Random</literal>, "
-"usato per iniettare un numero casuale:"
+msgid "The example exists of 4 classes, the first two of which are binding types. First, there is the <literal>@Random</literal> binding type, used for injecting a random number:"
+msgstr "L'esempio consiste di 4 classi, delle quali le prime due sono tipi di binding. Innanzitutto, c'è il tipo di binding <literal>@Random</literal>, usato per iniettare un numero casuale:"
#. Tag: programlisting
#: ri.xml:393
@@ -814,12 +605,8 @@
#. Tag: para
#: ri.xml:395
#, no-c-format
-msgid ""
-"There is also the <literal>@MaxNumber</literal> binding type, used for "
-"injecting the maximum number that can be injected:"
-msgstr ""
-"C'è anche il tipo di binding <literal>@MaxNumber</literal>, usato per "
-"iniettare il numero massimo iniettatabile:"
+msgid "There is also the <literal>@MaxNumber</literal> binding type, used for injecting the maximum number that can be injected:"
+msgstr "C'è anche il tipo di binding <literal>@MaxNumber</literal>, usato per iniettare il numero massimo iniettatabile:"
#. Tag: programlisting
#: ri.xml:400
@@ -842,14 +629,8 @@
#. Tag: para
#: ri.xml:402
#, no-c-format
-msgid ""
-"The <literal>Generator</literal> class is responsible for creating the "
-"random number, via a producer method. It also exposes the maximum possible "
-"number via a producer method:"
-msgstr ""
-"Alla classe <literal>Generator</literal> è affidata la generazione del "
-"numero casuale, per mezzo di un metodo produttore. Inoltre essa espone il "
-"massimo numero possibile attraverso un metodo produttore:"
+msgid "The <literal>Generator</literal> class is responsible for creating the random number, via a producer method. It also exposes the maximum possible number via a producer method:"
+msgstr "Alla classe <literal>Generator</literal> è affidata la generazione del numero casuale, per mezzo di un metodo produttore. Inoltre essa espone il massimo numero possibile attraverso un metodo produttore:"
#. Tag: programlisting
#: ri.xml:408
@@ -858,8 +639,7 @@
"<![CDATA[@ApplicationScoped\n"
"public class Generator {\n"
" \n"
-" private java.util.Random random = new java.util.Random( System."
-"currentTimeMillis() );\n"
+" private java.util.Random random = new java.util.Random( System.currentTimeMillis() );\n"
" \n"
" private int maxNumber = 100;\n"
" \n"
@@ -882,8 +662,7 @@
"<![CDATA[@ApplicationScoped\n"
"public class Generator {\n"
" \n"
-" private java.util.Random random = new java.util.Random( System."
-"currentTimeMillis() );\n"
+" private java.util.Random random = new java.util.Random( System.currentTimeMillis() );\n"
" \n"
" private int maxNumber = 100;\n"
" \n"
@@ -906,39 +685,20 @@
#. Tag: para
#: ri.xml:410
#, no-c-format
-msgid ""
-"You'll notice that the <literal>Generator</literal> is application scoped; "
-"therefore we don't get a different random each time."
-msgstr ""
-"E' possibile notare che <literal>Generator</literal> ha scope applicazione; "
-"quindi non si ottiene un diverso numero casuale ogni volta."
+msgid "You'll notice that the <literal>Generator</literal> is application scoped; therefore we don't get a different random each time."
+msgstr "E' possibile notare che <literal>Generator</literal> ha scope applicazione; quindi non si ottiene un diverso numero casuale ogni volta."
#. Tag: para
#: ri.xml:415
#, no-c-format
-msgid ""
-"The final Web Bean in the application is the session scoped <literal>Game</"
-"literal>."
-msgstr ""
-"Il Web Bean finale nell'applicazione è <literal>Game</literal> avente scope "
-"di sessione."
+msgid "The final Web Bean in the application is the session scoped <literal>Game</literal>."
+msgstr "Il Web Bean finale nell'applicazione è <literal>Game</literal> avente scope di sessione."
#. Tag: para
#: ri.xml:420
#, no-c-format
-msgid ""
-"You'll note that we've used the <literal>@Named</literal> annotation, so "
-"that we can use the bean through EL in the JSF page. Finally, we've used "
-"constructor injection to initialize the game with a random number. And of "
-"course, we need to tell the player when they've won, so we give feedback "
-"with a <literal>FacesMessage</literal>."
-msgstr ""
-"Si noti anche che è stata usata l'annotazione <literal>@Named</literal>, in "
-"modo che sia possibile usare il bean in espressioni EL presenti nelle pagine "
-"JSF. Infine, si è utilizzata l'iniezione del costruttore per inizializzare "
-"il gioco con un numero casuale. E naturalmente, è necessario dire al "
-"giocatore se ha vinto, informazione di feedback che viene fornita con un "
-"<literal>FacesMessage</literal>."
+msgid "You'll note that we've used the <literal>@Named</literal> annotation, so that we can use the bean through EL in the JSF page. Finally, we've used constructor injection to initialize the game with a random number. And of course, we need to tell the player when they've won, so we give feedback with a <literal>FacesMessage</literal>."
+msgstr "Si noti anche che è stata usata l'annotazione <literal>@Named</literal>, in modo che sia possibile usare il bean in espressioni EL presenti nelle pagine JSF. Infine, si è utilizzata l'iniezione del costruttore per inizializzare il gioco con un numero casuale. E naturalmente, è necessario dire al giocatore se ha vinto, informazione di feedback che viene fornita con un <literal>FacesMessage</literal>."
#. Tag: programlisting
#: ri.xml:428
@@ -1022,8 +782,7 @@
" }\n"
" if (guess == number)\n"
" {\n"
-" FacesContext.getCurrentInstance().addMessage(null, new FacesMessage"
-"(\"Correct!\"));\n"
+" FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"Correct!\"));\n"
" }\n"
" remainingGuesses--;\n"
" return null;\n"
@@ -1035,8 +794,7 @@
" this.smallest = 0;\n"
" this.guess = 0;\n"
" this.remainingGuesses = 10;\n"
-" this.number = manager.getInstanceByType(Integer.class, new "
-"AnnotationLiteral<Random>(){});\n"
+" this.number = manager.getInstanceByType(Integer.class, new AnnotationLiteral<Random>(){});\n"
" }\n"
" \n"
"}]]>"
@@ -1119,8 +877,7 @@
" }\n"
" if (guess == number)\n"
" {\n"
-" FacesContext.getCurrentInstance().addMessage(null, new FacesMessage"
-"(\"Correct!\"));\n"
+" FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(\"Correct!\"));\n"
" }\n"
" remainingGuesses--;\n"
" return null;\n"
@@ -1132,43 +889,33 @@
" this.smallest = 0;\n"
" this.guess = 0;\n"
" this.remainingGuesses = 10;\n"
-" this.number = manager.getInstanceByType(Integer.class, new "
-"AnnotationLiteral<Random>(){});\n"
+" this.number = manager.getInstanceByType(Integer.class, new AnnotationLiteral<Random>(){});\n"
" }\n"
" \n"
"}]]>"
#. Tag: title
#: ri.xml:431
-#, fuzzy, no-c-format
+#, no-c-format
msgid "The numberguess example for Tomcat"
-msgstr "Esempio Indovina Numero"
+msgstr "Esempio Indovina Numero per Tomcat"
#. Tag: para
#: ri.xml:433
#, no-c-format
-msgid ""
-"The numberguess for Tomcat differs in a couple of ways. Firstly, Web Beans "
-"should be deployed as a Web Application library in <literal>WEB-INF/lib</"
-"literal>. For your convenience we provide a single jar suitable for running "
-"Web Beans on Tomcat <literal>webbeans-tomcat.jar</literal>."
+msgid "The numberguess for Tomcat differs in a couple of ways. Firstly, Web Beans should be deployed as a Web Application library in <literal>WEB-INF/lib</literal>. For your convenience we provide a single jar suitable for running Web Beans on Tomcat <literal>webbeans-tomcat.jar</literal>."
msgstr ""
#. Tag: para
#: ri.xml:442
#, no-c-format
-msgid ""
-"Of course, you must also include JSF and EL, as well common annotations "
-"(<literal>jsr250-api.jar</literal>) which a JEE server includes by default."
+msgid "Of course, you must also include JSF and EL, as well common annotations (<literal>jsr250-api.jar</literal>) which a JEE server includes by default."
msgstr ""
#. Tag: para
#: ri.xml:449
#, no-c-format
-msgid ""
-"Secondly, we need to explicitly specify the Tomcat servlet listener (used to "
-"boot Web Beans, and control it's interaction with requests) in <literal>web."
-"xml</literal>:"
+msgid "Secondly, we need to explicitly specify the Tomcat servlet listener (used to boot Web Beans, and control it's interaction with requests) in <literal>web.xml</literal>:"
msgstr ""
#. Tag: programlisting
@@ -1176,10 +923,12 @@
#, no-c-format
msgid ""
"<![CDATA[<listener>\n"
-" <listener-class>org.jboss.webbeans.environment.tomcat.Listener</listener-"
-"class>\n"
+" <listener-class>org.jboss.webbeans.environment.tomcat.Listener</listener-class>\n"
"</listener>]]>"
msgstr ""
+"<![CDATA[<listener>\n"
+" <listener-class>org.jboss.webbeans.environment.tomcat.Listener</listener-class>\n"
+"</listener>]]>"
#. Tag: title
#: ri.xml:461
@@ -1190,44 +939,26 @@
#. Tag: para
#: ri.xml:463
#, no-c-format
-msgid ""
-"The translator example will take any sentences you enter, and translate them "
-"to Latin."
-msgstr ""
-"L'esempio Traduttore prende le frasi che vengono inserite e le traduce in "
-"latino."
+msgid "The translator example will take any sentences you enter, and translate them to Latin."
+msgstr "L'esempio Traduttore prende le frasi che vengono inserite e le traduce in latino."
#. Tag: para
#: ri.xml:468
#, no-c-format
-msgid ""
-"The translator example is built as an ear, and contains EJBs. As a result, "
-"it's structure is more complex than the numberguess example."
-msgstr ""
-"L'esempio Traduttore è assemblato in un ear, e contiene EJB. Di conseguenza, "
-"la sua struttura è più complessa di quella dell'esempio Indovina Numero."
+msgid "The translator example is built as an ear, and contains EJBs. As a result, it's structure is more complex than the numberguess example."
+msgstr "L'esempio Traduttore è assemblato in un ear, e contiene EJB. Di conseguenza, la sua struttura è più complessa di quella dell'esempio Indovina Numero."
#. Tag: para
#: ri.xml:474
#, no-c-format
-msgid ""
-"EJB 3.1 and Jave EE 6 allow you to package EJBs in a war, which will make "
-"this structure much simpler!"
-msgstr ""
-"EJB 3.1 and Java EE 6 permettono di assemblare gli EJB in un war, cosa che "
-"rende questa struttura molto più semplice!"
+msgid "EJB 3.1 and Jave EE 6 allow you to package EJBs in a war, which will make this structure much simpler!"
+msgstr "EJB 3.1 and Java EE 6 permettono di assemblare gli EJB in un war, cosa che rende questa struttura molto più semplice!"
#. Tag: para
#: ri.xml:480
#, no-c-format
-msgid ""
-"First, let's take a look at the ear aggregator, which is located in "
-"<literal>webbeans-translator-ear</literal> module. Maven automatically "
-"generates the <literal>application.xml</literal> for us:"
-msgstr ""
-"Innanzitutto, diamo un'occhiata all'aggregatore ear, che è situato nel "
-"modulo <literal>webbeans-translator-ear</literal>. Maven genera "
-"automaticamente il file <literal>application.xml</literal>:"
+msgid "First, let's take a look at the ear aggregator, which is located in <literal>webbeans-translator-ear</literal> module. Maven automatically generates the <literal>application.xml</literal> for us:"
+msgstr "Innanzitutto, diamo un'occhiata all'aggregatore ear, che è situato nel modulo <literal>webbeans-translator-ear</literal>. Maven genera automaticamente il file <literal>application.xml</literal>:"
#. Tag: programlisting
#: ri.xml:486
@@ -1264,24 +995,14 @@
#. Tag: para
#: ri.xml:488
#, no-c-format
-msgid ""
-"Here we set the context path, which gives us a nice url (<ulink url=\"http://"
-"localhost:8080/webbeans-translator\">http://localhost:8080/webbeans-"
-"translator</ulink>)."
-msgstr ""
-"Qua viene impostato il context path, in modo da avere un url gradevole "
-"(<ulink url=\"http://localhost:8080/webbeans-translator\">http://"
-"localhost:8080/webbeans-translator</ulink>)."
+msgid "Here we set the context path, which gives us a nice url (<ulink url=\"http://localhost:8080/webbeans-translator\">http://localhost:8080/webbeans-translator</ulink>)."
+msgstr "Qua viene impostato il context path, in modo da avere un url gradevole (<ulink url=\"http://localhost:8080/webbeans-translator\">http://localhost:8080/webbeans-translator</ulink>)."
#. Tag: para
#: ri.xml:494
#, no-c-format
-msgid ""
-"If you aren't using Maven to generate these files, you would need "
-"<literal>META-INF/application.xml</literal>:"
-msgstr ""
-"Se non si sta usando Maven per generare questi file, sarebbe necessario "
-"avere il file <literal>META-INF/application.xml</literal>:"
+msgid "If you aren't using Maven to generate these files, you would need <literal>META-INF/application.xml</literal>:"
+msgstr "Se non si sta usando Maven per generare questi file, sarebbe necessario avere il file <literal>META-INF/application.xml</literal>:"
#. Tag: programlisting
#: ri.xml:499
@@ -1290,12 +1011,10 @@
"<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<application xmlns=\"http://java.sun.com/xml/ns/javaee\" \n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://"
-"java.sun.com/xml/ns/javaee/application_5.xsd\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd\"\n"
" version=\"5\">\n"
" <display-name>webbeans-translator-ear</display-name>\n"
-" <description>Ear Example for the reference implementation of JSR 299: Web "
-"Beans</description>\n"
+" <description>Ear Example for the reference implementation of JSR 299: Web Beans</description>\n"
" \n"
" <module>\n"
" <web>\n"
@@ -1311,12 +1030,10 @@
"<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<application xmlns=\"http://java.sun.com/xml/ns/javaee\" \n"
" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"
-" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://"
-"java.sun.com/xml/ns/javaee/application_5.xsd\"\n"
+" xsi:schemaLocation=\"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd\"\n"
" version=\"5\">\n"
" <display-name>webbeans-translator-ear</display-name>\n"
-" <description>Ear Example for the reference implementation of JSR 299: Web "
-"Beans</description>\n"
+" <description>Ear Example for the reference implementation of JSR 299: Web Beans</description>\n"
" \n"
" <module>\n"
" <web>\n"
@@ -1332,27 +1049,14 @@
#. Tag: para
#: ri.xml:502
#, no-c-format
-msgid ""
-"Next, lets look at the war. Just as in the numberguess example, we have a "
-"<literal>faces-config.xml</literal> (to enable Facelets) and a <literal>web."
-"xml</literal> (to enable JSF) in <literal>WebContent/WEB-INF</literal>."
-msgstr ""
-"Quindi, esaminiamo il war. Proprio come nell'esempio Indovina Numero, "
-"abbiamo un <literal>faces-config.xml</literal> (per abilitare Facelets) e un "
-"<literal>web.xml</literal> (per abilitare JSF) in <literal>WebContent/WEB-"
-"INF</literal>."
+msgid "Next, lets look at the war. Just as in the numberguess example, we have a <literal>faces-config.xml</literal> (to enable Facelets) and a <literal>web.xml</literal> (to enable JSF) in <literal>WebContent/WEB-INF</literal>."
+msgstr "Quindi, esaminiamo il war. Proprio come nell'esempio Indovina Numero, abbiamo un <literal>faces-config.xml</literal> (per abilitare Facelets) e un <literal>web.xml</literal> (per abilitare JSF) in <literal>WebContent/WEB-INF</literal>."
#. Tag: para
#: ri.xml:509
#, no-c-format
-msgid ""
-"More intersting is the facelet used to translate text. Just as in the "
-"numberguess example we have a template, which surrounds the form (ommitted "
-"here for brevity):"
-msgstr ""
-"Più interessante è il facelet usato per tradurre il testo. Proprio come "
-"nell'esempio Indovina Numero c'è un template, che circoscrive la form (qui "
-"omessa per brevità):"
+msgid "More intersting is the facelet used to translate text. Just as in the numberguess example we have a template, which surrounds the form (ommitted here for brevity):"
+msgstr "Più interessante è il facelet usato per tradurre il testo. Proprio come nell'esempio Indovina Numero c'è un template, che circoscrive la form (qui omessa per brevità):"
#. Tag: programlisting
#: ri.xml:515
@@ -1371,8 +1075,7 @@
" </tr>\n"
" <tr>\n"
" <td>\n"
-" <h:inputTextarea id=\"text\" value=\"#{translator.text}\" "
-"required=\"true\" rows=\"5\" cols=\"80\" />\n"
+" <h:inputTextarea id=\"text\" value=\"#{translator.text}\" required=\"true\" rows=\"5\" cols=\"80\" />\n"
" </td>\n"
" <td>\n"
" <h:outputText value=\"#{translator.translatedText}\" />\n"
@@ -1380,8 +1083,7 @@
" </tr>\n"
" </table>\n"
" <div>\n"
-" <h:commandButton id=\"button\" value=\"Translate\" action=\"#"
-"{translator.translate}\"/>\n"
+" <h:commandButton id=\"button\" value=\"Translate\" action=\"#{translator.translate}\"/>\n"
" </div>\n"
" \n"
"</h:form>]]>"
@@ -1399,8 +1101,7 @@
" </tr>\n"
" <tr>\n"
" <td>\n"
-" <h:inputTextarea id=\"text\" value=\"#{translator.text}\" "
-"required=\"true\" rows=\"5\" cols=\"80\" />\n"
+" <h:inputTextarea id=\"text\" value=\"#{translator.text}\" required=\"true\" rows=\"5\" cols=\"80\" />\n"
" </td>\n"
" <td>\n"
" <h:outputText value=\"#{translator.translatedText}\" />\n"
@@ -1408,8 +1109,7 @@
" </tr>\n"
" </table>\n"
" <div>\n"
-" <h:commandButton id=\"button\" value=\"Translate\" action=\"#"
-"{translator.translate}\"/>\n"
+" <h:commandButton id=\"button\" value=\"Translate\" action=\"#{translator.translate}\"/>\n"
" </div>\n"
" \n"
"</h:form>]]>"
@@ -1417,56 +1117,26 @@
#. Tag: para
#: ri.xml:517
#, no-c-format
-msgid ""
-"The user can enter some text in the lefthand textarea, and hit the translate "
-"button to see the result to the right."
-msgstr ""
-"L'utente può inserire del testo nell'area di testo sulla sinistra e premere "
-"il pulsante di traduzione per vedere il risultato sulla destra."
+msgid "The user can enter some text in the lefthand textarea, and hit the translate button to see the result to the right."
+msgstr "L'utente può inserire del testo nell'area di testo sulla sinistra e premere il pulsante di traduzione per vedere il risultato sulla destra."
#. Tag: para
#: ri.xml:522
#, no-c-format
-msgid ""
-"Finally, let's look at the ejb module, <literal>webbeans-translator-ejb</"
-"literal>. In <literal>src/main/resources/META-INF</literal> there is just an "
-"empty <literal>web-beans.xml</literal>, used to mark the archive as "
-"containing Web Beans."
-msgstr ""
-"Infine, si esamini il modulo ejb, <literal>webbeans-translator-ejb</"
-"literal>. In <literal>src/main/resources/META-INF</literal> si trova un file "
-"vuoto <literal>web-beans.xml</literal>, usato per marcare l'archivio come "
-"contenente Web Beans."
+msgid "Finally, let's look at the ejb module, <literal>webbeans-translator-ejb</literal>. In <literal>src/main/resources/META-INF</literal> there is just an empty <literal>web-beans.xml</literal>, used to mark the archive as containing Web Beans."
+msgstr "Infine, si esamini il modulo ejb, <literal>webbeans-translator-ejb</literal>. In <literal>src/main/resources/META-INF</literal> si trova un file vuoto <literal>web-beans.xml</literal>, usato per marcare l'archivio come contenente Web Beans."
#. Tag: para
#: ri.xml:530
#, no-c-format
-msgid ""
-"We've saved the most interesting bit to last, the code! The project has two "
-"simple beans, <literal>SentenceParser</literal> and <literal>TextTranslator</"
-"literal> and two enterprise beans, <literal>TranslatorControllerBean</"
-"literal> and <literal>SentenceTranslator</literal>. You should be getting "
-"quite familiar with what a Web Bean looks like by now, so we'll just "
-"highlight the most interesting bits here."
-msgstr ""
-"Abbiamo lasciato per ultimo il boccone più prelibato, il codice! Il progetto "
-"ha due bean semplici, <literal>SentenceParser</literal> e "
-"<literal>TextTranslator</literal> e due bean enterprise, "
-"<literal>TranslatorControllerBean</literal> e <literal>SentenceTranslator</"
-"literal>. Dovreste ormai essere piuttosto familiari all'aspetto di un Web "
-"Bean, così ci limiteremo a evidenziare le parti più interessanti."
+msgid "We've saved the most interesting bit to last, the code! The project has two simple beans, <literal>SentenceParser</literal> and <literal>TextTranslator</literal> and two enterprise beans, <literal>TranslatorControllerBean</literal> and <literal>SentenceTranslator</literal>. You should be getting quite familiar with what a Web Bean looks like by now, so we'll just highlight the most interesting bits here."
+msgstr "Abbiamo lasciato per ultimo il boccone più prelibato, il codice! Il progetto ha due bean semplici, <literal>SentenceParser</literal> e <literal>TextTranslator</literal> e due bean enterprise, <literal>TranslatorControllerBean</literal> e <literal>SentenceTranslator</literal>. Dovreste ormai essere piuttosto familiari all'aspetto di un Web Bean, così ci limiteremo a evidenziare le parti più interessanti."
#. Tag: para
#: ri.xml:540
#, no-c-format
-msgid ""
-"Both <literal>SentenceParser</literal> and <literal>TextTranslator</literal> "
-"are dependent beans, and <literal>TextTranslator</literal> uses constructor "
-"initialization:"
-msgstr ""
-"Sia <literal>SentenceParser</literal> che <literal>TextTranslator</literal> "
-"sono bean dependenti, e <literal>TextTranslator</literal> usa "
-"l'inizializzazione via costruttore:"
+msgid "Both <literal>SentenceParser</literal> and <literal>TextTranslator</literal> are dependent beans, and <literal>TextTranslator</literal> uses constructor initialization:"
+msgstr "Sia <literal>SentenceParser</literal> che <literal>TextTranslator</literal> sono bean dependenti, e <literal>TextTranslator</literal> usa l'inizializzazione via costruttore:"
#. Tag: programlisting
#: ri.xml:546
@@ -1477,8 +1147,7 @@
" private Translator sentenceTranslator; \n"
" \n"
" @Initializer\n"
-" TextTranslator(SentenceParser sentenceParser, Translator "
-"sentenceTranslator) \n"
+" TextTranslator(SentenceParser sentenceParser, Translator sentenceTranslator) \n"
" { \n"
" this.sentenceParser = sentenceParser; \n"
" this.sentenceTranslator = sentenceTranslator;]]>"
@@ -1488,8 +1157,7 @@
" private Translator sentenceTranslator; \n"
" \n"
" @Initializer\n"
-" TextTranslator(SentenceParser sentenceParser, Translator "
-"sentenceTranslator) \n"
+" TextTranslator(SentenceParser sentenceParser, Translator sentenceTranslator) \n"
" { \n"
" this.sentenceParser = sentenceParser; \n"
" this.sentenceTranslator = sentenceTranslator;]]>"
@@ -1497,14 +1165,8 @@
#. Tag: para
#: ri.xml:548
#, no-c-format
-msgid ""
-"<literal>TextTranslator</literal> is a stateless bean (with a local business "
-"interface), where the magic happens - of course, we couldn't develop a full "
-"translator, but we gave it a good go!"
-msgstr ""
-"<literal>TextTranslator</literal> è un bean stateless (con un'interfaccia "
-"business locale), dove avviene la magia - naturalmente, non potevamo "
-"sviluppare un traduttore completo, ma gli abbiamo dato un buon avvio!"
+msgid "<literal>TextTranslator</literal> is a stateless bean (with a local business interface), where the magic happens - of course, we couldn't develop a full translator, but we gave it a good go!"
+msgstr "<literal>TextTranslator</literal> è un bean stateless (con un'interfaccia business locale), dove avviene la magia - naturalmente, non potevamo sviluppare un traduttore completo, ma gli abbiamo dato un buon avvio!"
# This is a request scoped, named, stateful session bean, which injects the translator.
# se è request scoped come può essere statefull session??????
@@ -1512,15 +1174,8 @@
#. Tag: para
#: ri.xml:554
#, no-c-format
-msgid ""
-"Finally, there is UI orientated controller, that collects the text from the "
-"user, and dispatches it to the translator. This is a request scoped, named, "
-"stateful session bean, which injects the translator."
-msgstr ""
-"Infine, vi è un controller orientato all'UI, che raccoglie il testo "
-"dall'utente, e lo invia al traduttore. Questo è un bean stateful di "
-"sessione, dotato di nome, con scope richiesta, in cui viene iniettato il "
-"traduttore."
+msgid "Finally, there is UI orientated controller, that collects the text from the user, and dispatches it to the translator. This is a request scoped, named, stateful session bean, which injects the translator."
+msgstr "Infine, vi è un controller orientato all'UI, che raccoglie il testo dall'utente, e lo invia al traduttore. Questo è un bean stateful di sessione, dotato di nome, con scope richiesta, in cui viene iniettato il traduttore."
#. Tag: programlisting
#: ri.xml:560
@@ -1546,17 +1201,13 @@
#: ri.xml:562
#, no-c-format
msgid "The bean also has getters and setters for all the fields on the page."
-msgstr ""
-"Il bean possiede pure dei metodi getter e setter per tutti i campi della "
-"pagina."
+msgstr "Il bean possiede pure dei metodi getter e setter per tutti i campi della pagina."
#. Tag: para
#: ri.xml:566
#, no-c-format
msgid "As this is a stateful session bean, we have to have a remove method:"
-msgstr ""
-"Poichè si tratta di un bean stateful di sessione, è necessario un metodo di "
-"rimozione (remove method):"
+msgstr "Poichè si tratta di un bean stateful di sessione, è necessario un metodo di rimozione (remove method):"
#. Tag: programlisting
#: ri.xml:570
@@ -1577,36 +1228,20 @@
#. Tag: para
#: ri.xml:572
#, no-c-format
-msgid ""
-"The Web Beans manager will call the remove method for you when the bean is "
-"destroyed; in this case at the end of the request."
-msgstr ""
-"Il manager Web Beans chiamerà il metodo di rimozione quando il bean verrà "
-"distrutto; in questo caso al termine della richiesta."
+msgid "The Web Beans manager will call the remove method for you when the bean is destroyed; in this case at the end of the request."
+msgstr "Il manager Web Beans chiamerà il metodo di rimozione quando il bean verrà distrutto; in questo caso al termine della richiesta."
#. Tag: para
#: ri.xml:578
#, no-c-format
-msgid ""
-"That concludes our short tour of the Web Beans examples. For more on Web "
-"Beans , or to help out, please visit <ulink url=\"http://www.seamframework."
-"org/WebBeans/Development\">http://www.seamframework.org/WebBeans/"
-"Development</ulink>."
-msgstr ""
-"Ciò conclude il nostro breve tour degli esempi della RI di Web Beans. Per "
-"saperne di più, o per trovare ulteriore aiuto, per favore visitate <ulink "
-"url=\"http://www.seamframework.org/WebBeans/Development\">http://www."
-"seamframework.org/WebBeans/Development</ulink>."
+msgid "That concludes our short tour of the Web Beans examples. For more on Web Beans , or to help out, please visit <ulink url=\"http://www.seamframework.org/WebBeans/Development\">http://www.seamframework.org/WebBeans/Development</ulink>."
+msgstr "Ciò conclude il nostro breve tour degli esempi della RI di Web Beans. Per saperne di più, o per trovare ulteriore aiuto, per favore visitate <ulink url=\"http://www.seamframework.org/WebBeans/Development\">http://www.seamframework.org/WebBeans/Development</ulink>."
#. Tag: para
#: ri.xml:584
#, no-c-format
-msgid ""
-"We need help in all areas - bug fixing, writing new features, writing "
-"examples and translating this reference guide."
-msgstr ""
-"Abbiamo bisogno di aiuto in tutte le aree - soluzione dei bug, scrittura di "
-"nuove caratteristiche ed esempi e traduzione di questa guida."
+msgid "We need help in all areas - bug fixing, writing new features, writing examples and translating this reference guide."
+msgstr "Abbiamo bisogno di aiuto in tutte le aree - soluzione dei bug, scrittura di nuove caratteristiche ed esempi e traduzione di questa guida."
#~ msgid ""
#~ "A new deployer, <literal>webbeans.deployer</literal> is added to JBoss "
@@ -1618,10 +1253,8 @@
#~ "JBoss AS. Questo aggiunge a JBoss AS il supporto degli archivi Web Bean, "
#~ "e consente a Web Beans RI di interrogare il container EJB3 e scoprire "
#~ "quali EJB sono installati nell'applicazione."
-
#~ msgid "Web Beans is bundled with JBoss AS 5.1 and above."
#~ msgstr "Web Beans viene fornito con JBoss AS 5.1 e superiore."
-
#~ msgid ""
#~ "As Web Beans is a new piece of software, you need to update JBoss AS to "
#~ "run the Web Beans RI. Future versions of JBoss AS will include these "
@@ -1630,7 +1263,6 @@
#~ "Poiché Web Beans è un software nuovo, occorre aggiornare JBoss AS per "
#~ "poter eseguire la RI di Web Beans. Versioni future di JBoss AS "
#~ "includeranno questi update, e questa operazione non sarà necessaria."
-
#~ msgid ""
#~ "The final Web Bean in the application is the session scoped "
#~ "<literal>Game</literal>. By making <literal>Game</literal> session "
@@ -1642,7 +1274,6 @@
#~ "possibile giocare una sola volta per sessione del browser. Potreste "
#~ "facilmente aggiungere un pulsante di reset - un buon esercizio lasciato "
#~ "al lettore :-)"
-
#~ msgid ""
#~ "<![CDATA[@Named\n"
#~ "@SessionScoped\n"
@@ -1721,7 +1352,6 @@
#~ " }\n"
#~ " \n"
#~ "}]]>"
-
#~ msgid ""
#~ "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
#~ "<!DOCTYPE jboss-app\n"
@@ -1740,10 +1370,8 @@
#~ " <loader-repository>webbeans.jboss.org:loader=webbeans-translator</"
#~ "loader-repository>\n"
#~ "</jboss-app>]]>"
-
#~ msgid "and <literal>META-INF/application.xml</literal>:"
#~ msgstr "e <literal>META-INF/application.xml</literal>:"
-
#~ msgid ""
#~ "<![CDATA[<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
#~ "<ejb-jar xmlns=\"http://java.sun.com/xml/ns/javaee\" \n"
@@ -1792,3 +1420,4 @@
#~ " </assembly-descriptor>\n"
#~ " \n"
#~ "</ejb-jar>]]>"
+
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2274 - ri/trunk/tests.
by webbeans-commits@lists.jboss.org
Author: danielc.roth
Date: 2009-03-30 15:20:04 -0400 (Mon, 30 Mar 2009)
New Revision: 2274
Modified:
ri/trunk/tests/pom.xml
Log:
just testing my credentials /daniel
Modified: ri/trunk/tests/pom.xml
===================================================================
--- ri/trunk/tests/pom.xml 2009-03-30 16:23:55 UTC (rev 2273)
+++ ri/trunk/tests/pom.xml 2009-03-30 19:20:04 UTC (rev 2274)
@@ -222,6 +222,4 @@
</build>
</profile>
</profiles>
-
-
</project>
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2273 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 10 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-30 12:23:55 -0400 (Mon, 30 Mar 2009)
New Revision: 2273
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/ChildManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.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/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/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/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/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/xml/checker/bean/ext/SessionBeanElementChecker.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/bean/ext/SimpleBeanElementChecker.java
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
Log:
Refactor in prep for child activities
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -63,9 +63,9 @@
public class BeanValidator
{
- private final ManagerImpl manager;
+ private final RootManager manager;
- public BeanValidator(ManagerImpl manager)
+ public BeanValidator(RootManager manager)
{
this.manager = manager;
}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/ChildManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ChildManager.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ChildManager.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -0,0 +1,169 @@
+package org.jboss.webbeans;
+
+import java.io.InputStream;
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.List;
+import java.util.Set;
+
+import javax.context.Context;
+import javax.context.CreationalContext;
+import javax.event.Observer;
+import javax.inject.TypeLiteral;
+import javax.inject.manager.Bean;
+import javax.inject.manager.Decorator;
+import javax.inject.manager.InjectionPoint;
+import javax.inject.manager.InterceptionType;
+import javax.inject.manager.Interceptor;
+import javax.inject.manager.Manager;
+
+import org.jboss.webbeans.manager.api.WebBeansManager;
+
+public class ChildManager implements WebBeansManager, Serializable
+{
+
+ private final WebBeansManager parentManager;
+
+ public ChildManager(WebBeansManager manager)
+ {
+ this.parentManager = manager;
+ }
+
+ public void injectNonContextualInstance(Object instance)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public void shutdown()
+ {
+ throw new UnsupportedOperationException("Must call shutdown() on root manager");
+ }
+
+ public Manager addBean(Bean<?> bean)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Manager addContext(Context context)
+ {
+ throw new UnsupportedOperationException("Must add contexts to root manager");
+ }
+
+ public Manager addDecorator(Decorator decorator)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Manager addInterceptor(Interceptor interceptor)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> Manager addObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Manager createActivity()
+ {
+ return new ChildManager(this);
+ }
+
+ public void fireEvent(Object event, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Context getContext(Class<? extends Annotation> scopeType)
+ {
+ return parentManager.getContext(scopeType);
+ }
+
+ public <T> T getInstance(Bean<T> bean)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Object getInstanceByName(String name)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> T getInstanceToInject(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> T getInstanceToInject(InjectionPoint injectionPoint)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Manager parse(InputStream xmlStream)
+ {
+ throw new UnsupportedOperationException("Can only add XML metadata to root manager");
+ }
+
+ public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> Manager removeObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Set<Bean<?>> resolveByName(String name)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> type, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public List<Decorator> resolveDecorators(Set<Type> types, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public List<Interceptor> resolveInterceptors(InterceptionType type, Annotation... interceptorBindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
+ {
+ throw new UnsupportedOperationException("Not yet implemented");
+ }
+
+ public Manager setCurrent(Class<? extends Annotation> scopeType)
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/ChildManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java 2009-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/CurrentManager.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -26,14 +26,14 @@
public class CurrentManager
{
// The root manager instance
- protected static ManagerImpl rootManager;
+ protected static RootManager rootManager;
/**
* Gets the root manager
*
* @return The root manager
*/
- public static ManagerImpl rootManager()
+ public static RootManager rootManager()
{
return rootManager;
}
@@ -43,7 +43,7 @@
*
* @param rootManager The root manager
*/
- public static void setRootManager(ManagerImpl rootManager)
+ public static void setRootManager(RootManager rootManager)
{
CurrentManager.rootManager = rootManager;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -35,7 +35,7 @@
{
- public static <I> Instance<I> of(Class<I> clazz, ManagerImpl manager, Set<Annotation> annotations)
+ public static <I> Instance<I> of(Class<I> clazz, RootManager manager, Set<Annotation> annotations)
{
return new InstanceImpl<I>(clazz, manager, annotations);
}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -1,1043 +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.InputStream;
-import java.io.Serializable;
-import java.lang.annotation.Annotation;
-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.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Stack;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import javax.context.Context;
-import javax.context.ContextNotActiveException;
-import javax.context.CreationalContext;
-import javax.event.Observer;
-import javax.inject.AmbiguousDependencyException;
-import javax.inject.BindingType;
-import javax.inject.DeploymentException;
-import javax.inject.DuplicateBindingTypeException;
-import javax.inject.Production;
-import javax.inject.Standard;
-import javax.inject.TypeLiteral;
-import javax.inject.UnproxyableDependencyException;
-import javax.inject.UnsatisfiedDependencyException;
-import javax.inject.manager.Bean;
-import javax.inject.manager.Decorator;
-import javax.inject.manager.InjectionPoint;
-import javax.inject.manager.InterceptionType;
-import javax.inject.manager.Interceptor;
-import javax.inject.manager.Manager;
-
-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.ContextMap;
-import org.jboss.webbeans.context.CreationalContextImpl;
-import org.jboss.webbeans.ejb.EjbDescriptorCache;
-import org.jboss.webbeans.event.EventManager;
-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.introspector.AnnotatedMethod;
-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.resources.spi.NamingContext;
-import org.jboss.webbeans.util.Beans;
-import org.jboss.webbeans.util.Reflections;
-
-/**
- * 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 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";
-
- // The enabled deployment types from web-beans.xml
- private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
- // The Web Beans event manager
- private transient final EventManager eventManager;
-
- // An executor service for asynchronous tasks
- private transient final ExecutorService taskExecutor = Executors.newSingleThreadExecutor();
-
- // An injection point metadata beans factory
- private transient final ThreadLocal<Stack<InjectionPoint>> currentInjectionPoint;
-
- // The bean resolver
- private transient final Resolver resolver;
-
- // The registered contexts
- private transient final ContextMap contextMap;
- // The client proxy pool
- private transient final ClientProxyProvider clientProxyProvider;
- // The registered beans
- private transient List<Bean<?>> beans;
- // The registered beans, mapped by implementation class
- private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeanMap;
-
- private transient final Map<String, RIBean<?>> riBeans;
-
- // The registered decorators
- private transient final Set<Decorator> decorators;
- // The registered interceptors
- private transient final Set<Interceptor> interceptors;
-
- // The EJB resolver provided by the container
- private transient final ServiceRegistry simpleServiceRegistry;
-
- private transient final EjbDescriptorCache ejbDescriptorCache;
-
- private final transient Map<Bean<?>, Bean<?>> specializedBeans;
-
- private final transient NonContextualInjector nonContextualInjector;
-
- /**
- * Create a new manager
- *
- * @param ejbServices
- * the ejbResolver to use
- */
- public ManagerImpl(ServiceRegistry simpleServiceRegistry)
- {
- this.simpleServiceRegistry = simpleServiceRegistry;
- this.beans = new CopyOnWriteArrayList<Bean<?>>();
- this.newEnterpriseBeanMap = new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>();
- this.riBeans = new ConcurrentHashMap<String, RIBean<?>>();
- this.resolver = new Resolver(this);
- this.clientProxyProvider = new ClientProxyProvider();
- this.decorators = new HashSet<Decorator>();
- this.interceptors = new HashSet<Interceptor>();
- this.contextMap = new ContextMap();
- this.eventManager = new EventManager();
- this.ejbDescriptorCache = new EjbDescriptorCache();
- this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
- {
- @Override
- protected Stack<InjectionPoint> initialValue()
- {
- return new Stack<InjectionPoint>();
- }
- };
- this.specializedBeans = new HashMap<Bean<?>, Bean<?>>();
- this.nonContextualInjector = new NonContextualInjector(this);
- List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
- defaultEnabledDeploymentTypes.add(0, Standard.class);
- defaultEnabledDeploymentTypes.add(1, Production.class);
- setEnabledDeploymentTypes(defaultEnabledDeploymentTypes);
- }
-
- /**
- * 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.inject.manager.Manager#addBean(javax.inject.manager.Bean)
- */
- public Manager addBean(Bean<?> bean)
- {
- if (beans.contains(bean))
- {
- return this;
- }
- resolver.clear();
- beans.add(bean);
- return this;
- }
-
- /**
- * 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<AnnotatedMethod<?>> resolveDisposalMethods(Class<T> apiType, Annotation... bindings)
- {
- return Collections.emptySet();
- }
-
- /**
- * Resolves observers for given event and bindings
- *
- * @param event
- * The event to match
- * @param bindings
- * The binding types to match
- * @return The set of matching observers
- *
- * @see javax.inject.manager.Manager#resolveObservers(java.lang.Object,
- * java.lang.annotation.Annotation[])
- */
- @SuppressWarnings("unchecked")
- public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
- {
- Class<?> clazz = event.getClass();
- for (Annotation annotation : bindings)
- {
- if (!MetaDataCache.instance().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);
- }
- Type t = new Reflections.HierarchyDiscovery(clazz).getResolvedType();
- for (Type type : Reflections.getActualTypeArguments(clazz))
- {
- if (type instanceof WildcardType)
- {
- throw new IllegalArgumentException("Cannot resolve an event type parameterized with a wildcard " + clazz);
- }
- if (type instanceof TypeVariable)
- {
- throw new IllegalArgumentException("Cannot resolve an event type parameterized with a type parameter " + clazz);
- }
- }
- return eventManager.getObservers(event, bindings);
- }
-
- /**
- * 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();
- }
-
- /**
- * Resolves beans by API type and binding types
- *
- * @param type
- * The API type to match
- * @param bindings
- * The binding types to match
- * @return The set of matching beans
- *
- * @see javax.inject.manager.Manager#resolveByType(java.lang.Class,
- * java.lang.annotation.Annotation[])
- */
- public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... bindings)
- {
- return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
- }
-
- /**
- * Resolves beans by API type literal and binding types
- *
- * @param type
- * The API type literal to match
- * @param bindings
- * The binding types to match
- * @return The set of matching beans
- *
- * @see javax.inject.manager.Manager#resolveByType(javax.inject.TypeLiteral,
- * java.lang.annotation.Annotation[])
- */
- public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> type, Annotation... bindings)
- {
- return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
- }
-
- public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, InjectionPoint injectionPoint, Annotation... bindings)
- {
- boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
- try
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().push(injectionPoint);
- }
- return resolveByType(element, bindings);
- }
- finally
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().pop();
- }
- }
- }
-
- /**
- * Check the resolution request is valid, and then ask the resolver to
- * perform the resolution. For internal use.
- *
- * @param element
- * The item to resolve
- * @param bindings
- * The binding types to match
- * @return The set of matching beans
- */
- public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, Annotation... bindings)
- {
- for (Annotation annotation : element.getAnnotationsAsSet())
- {
- if (!MetaDataCache.instance().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.length > element.getMetaAnnotations(BindingType.class).size())
- {
- throw new DuplicateBindingTypeException("Duplicate bindings (" + Arrays.asList(bindings) + ") type passed " + element.toString());
- }
- return resolver.get(element);
- }
-
- /**
- * 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.beans = new CopyOnWriteArrayList<Bean<?>>(beans);
- for (RIBean<?> bean : beans)
- {
- if (bean instanceof NewEnterpriseBean)
- {
- newEnterpriseBeanMap.put(bean.getType(), (EnterpriseBean<?>) bean);
- }
- riBeans.put(bean.getId(), bean);
- }
- resolver.clear();
- }
- }
-
- /**
- * Gets the class-mapped beans. For internal use.
- *
- * @return The bean map
- */
- public Map<Class<?>, EnterpriseBean<?>> getNewEnterpriseBeanMap()
- {
- return newEnterpriseBeanMap;
- }
-
- /**
- * The beans registered with the Web Bean manager. For internal use
- *
- * @return The list of known beans
- */
- public List<Bean<?>> getBeans()
- {
- return Collections.unmodifiableList(beans);
- }
-
- 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.inject.manager.Manager#addContext(javax.context.Context)
- */
- public Manager addContext(Context context)
- {
- contextMap.add(context);
- return this;
- }
-
- /**
- * Registers a decorator with the manager
- *
- * @param decorator
- * The decorator to register
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#addDecorator(javax.inject.manager.Decorator)
- */
- public Manager addDecorator(Decorator decorator)
- {
- decorators.add(decorator);
- return this;
- }
-
- /**
- * Registers an interceptor with the manager
- *
- * @param interceptor
- * The interceptor to register
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#addInterceptor(javax.inject.manager.Interceptor)
- */
- public Manager addInterceptor(Interceptor interceptor)
- {
- interceptors.add(interceptor);
- return this;
- }
-
- /**
- * Registers an observer for a given event type and binding types
- *
- * @param observer
- * The observer to register
- * @param eventType
- * The event type to match
- * @param bindings
- * The bindings to match
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#addObserver(javax.event.Observer,
- * java.lang.Class, java.lang.annotation.Annotation[])
- */
- public <T> Manager addObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
- {
- this.eventManager.addObserver(observer, eventType, bindings);
- return this;
- }
-
- public <T> Manager addObserver(ObserverImpl<T> observer)
- {
- this.eventManager.addObserver(observer, observer.getEventType(), observer.getBindingsAsArray());
- return this;
- }
-
- /**
- * Registers an observer for a given event type literal and binding types
- *
- * @param observer
- * The observer to register
- * @param eventType
- * The event type literal to match
- * @param bindings
- * The bindings to match
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#addObserver(javax.event.Observer,
- * javax.inject.TypeLiteral, java.lang.annotation.Annotation[])
- */
- public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
- {
- eventManager.addObserver(observer, eventType.getType(), bindings);
- return this;
- }
-
- /**
- * 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.inject.manager.Manager#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.inject.manager.Manager#getContext(java.lang.Class)
- */
- public Context getContext(Class<? extends Annotation> scopeType)
- {
- List<Context> activeContexts = new ArrayList<Context>();
- for (Context context : contextMap.getContext(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();
- }
-
- /**
- * Direct access to built in contexts. For internal use.
- *
- * @param scopeType
- * The scope type of the context
- * @return The context
- */
- public Context getBuiltInContext(Class<? extends Annotation> scopeType)
- {
- return contextMap.getBuiltInContext(scopeType);
- }
-
- /**
- * Returns an instance of a bean
- *
- * @param bean
- * The bean to instantiate
- * @return An instance of the bean
- *
- * @see javax.inject.manager.Manager#getInstance(javax.inject.manager.Bean)
- */
- public <T> T getInstance(Bean<T> bean)
- {
- return getInstance(bean, true);
- }
-
- public <T> T getInstance(Bean<T> bean, boolean create)
- {
- if (create)
- {
- return getInstance(bean, new CreationalContextImpl<T>(bean));
- }
- else
- {
- return getInstance(bean, null);
- }
- }
-
- /**
- * Returns an instance of a bean
- *
- * @param bean
- * The bean to instantiate
- * @return An instance of the bean
- *
- * @see javax.inject.manager.Manager#getInstance(javax.inject.manager.Bean)
- */
- @SuppressWarnings("unchecked")
- private <T> T getInstance(Bean<T> bean, CreationalContextImpl<T> creationalContext)
- {
- if (specializedBeans.containsKey(bean))
- {
- return getInstance((Bean<T>) specializedBeans.get(bean), creationalContext);
- }
- else if (MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal())
- {
- if (creationalContext != null || (creationalContext == null && getContext(bean.getScopeType()).get(bean) != null))
- {
- return (T) clientProxyProvider.getClientProxy(bean);
- }
- else
- {
- return null;
- }
- }
- else
- {
- return getContext(bean.getScopeType()).get(bean, creationalContext);
- }
- }
-
- public <T> T getInstanceToInject(InjectionPoint injectionPoint)
- {
- return this.<T> getInstanceToInject(injectionPoint, null);
- }
-
- public void injectNonContextualInstance(Object instance)
- {
- nonContextualInjector.inject(instance);
- }
-
- @SuppressWarnings("unchecked")
- public <T> T getInstanceToInject(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
- {
- boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
- try
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().push(injectionPoint);
- }
- AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]));
- Bean<T> bean = getBeanByType(element, element.getBindingsAsArray());
- if (creationalContext instanceof CreationalContextImpl)
- {
- CreationalContextImpl<?> ctx = (CreationalContextImpl<?>) creationalContext;
- if (ctx.containsIncompleteInstance(bean))
- {
- return ctx.getIncompleteInstance(bean);
- }
- else
- {
- return getInstance(bean, ctx.getCreationalContext(bean));
- }
- }
- else
- {
- return getInstance(bean);
- }
- }
- finally
- {
- if (registerInjectionPoint)
- {
- currentInjectionPoint.get().pop();
- }
- }
- }
-
- /**
- * Gets an instance by name, returning null if none is found and throwing an
- * exception if too many beans match
- *
- * @param name
- * The name to match
- * @return An instance of the bean
- *
- * @see javax.inject.manager.Manager#getInstanceByName(java.lang.String)
- */
- public Object getInstanceByName(String name)
- {
- Set<Bean<?>> beans = resolveByName(name);
- if (beans.size() == 0)
- {
- return null;
- }
- else if (beans.size() > 1)
- {
- throw new AmbiguousDependencyException("Resolved multiple Web Beans with " + name);
- }
- else
- {
- return getInstance(beans.iterator().next());
- }
- }
-
- /**
- * 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
- *
- * @see javax.inject.manager.Manager#getInstanceByType(java.lang.Class,
- * java.lang.annotation.Annotation[])
- */
- public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
- {
- return getInstanceByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
- }
-
- /**
- * Returns an instance by type literal and binding types
- *
- * @param type
- * The type to match
- * @param bindings
- * The binding types to match
- * @return An instance of the bean
- *
- * @see javax.inject.manager.Manager#getInstanceByType(javax.inject.TypeLiteral,
- * java.lang.annotation.Annotation[])
- */
- public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindings)
- {
- return getInstanceByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
- }
-
- /**
- * Resolve an instance, verify that the resolved bean can be instantiated,
- * and return
- *
- * @param element
- * The annotated item to match
- * @param bindings
- * The binding types to match
- * @return An instance of the bean
- */
- private <T> T getInstanceByType(AnnotatedItem<T, ?> element, Annotation... bindings)
- {
- return getInstance(getBeanByType(element, bindings));
- }
-
- public <T> Bean<T> getBeanByType(AnnotatedItem<T, ?> element, Annotation... bindings)
- {
- Set<Bean<T>> beans = resolveByType(element, bindings);
- if (beans.size() == 0)
- {
- throw new UnsatisfiedDependencyException(element + "Unable to resolve any Web Beans");
- }
- else if (beans.size() > 1)
- {
- throw new AmbiguousDependencyException(element + "Resolved multiple Web Beans");
- }
- Bean<T> bean = beans.iterator().next();
- boolean normalScoped = MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal();
- if (normalScoped && !Beans.isBeanProxyable(bean))
- {
- throw new UnproxyableDependencyException("Normal scoped bean " + bean + " is not proxyable");
- }
- return bean;
- }
-
- /**
- * Removes an observer
- *
- * @param observer
- * The observer to remove
- * @param eventType
- * The event type to match
- * @param bindings
- * the binding types to match
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#removeObserver(javax.event.Observer,
- * java.lang.Class, java.lang.annotation.Annotation[])
- */
- public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
- {
- this.eventManager.removeObserver(observer, eventType, bindings);
- return this;
- }
-
- /**
- * Removes an observer
- *
- * @param observer
- * The observer to remove
- * @param eventType
- * The event type to match
- * @param bindings
- * the binding types to match
- * @return A reference to the manager
- *
- * @see javax.inject.manager.Manager#removeObserver(javax.event.Observer,
- * javax.inject.TypeLiteral, java.lang.annotation.Annotation[])
- */
- public <T> Manager removeObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
- {
- this.eventManager.removeObserver(observer, eventType.getRawType(), bindings);
- return this;
- }
-
- /**
- * Resolves a set of beans based on their name
- *
- * @param The
- * name to match
- * @return The set of matching beans
- *
- * @see javax.inject.manager.Manager#resolveByName(java.lang.String)
- */
- public Set<Bean<?>> resolveByName(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.inject.manager.Manager#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.inject.manager.Manager#resolveInterceptors(javax.inject.manager.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;
- }
-
- public EjbDescriptorCache getEjbDescriptorCache()
- {
- return ejbDescriptorCache;
- }
-
- /**
- * 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: " + contextMap.keySet() + "\n");
- buffer.append("Registered beans: " + getBeans().size() + "\n");
- buffer.append("Registered decorators: " + decorators.size() + "\n");
- buffer.append("Registered interceptors: " + interceptors.size() + "\n");
- buffer.append("Specialized beans: " + specializedBeans.size() + "\n");
- return buffer.toString();
- }
-
- public Manager parse(InputStream xmlStream)
- {
- throw new UnsupportedOperationException();
- }
-
- public Manager createActivity()
- {
- throw new UnsupportedOperationException();
- }
-
- public Manager setCurrent(Class<? extends Annotation> scopeType)
- {
- throw new UnsupportedOperationException();
- }
-
- public ServiceRegistry getServices()
- {
- return simpleServiceRegistry;
- }
-
- /**
- * 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.rootManager();
- }
-
- /**
- * 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);
- getServices().get(NamingContext.class).unbind(ManagerImpl.JNDI_KEY);
- }
-
- /**
- * 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();
- }
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java (from rev 2255, ri/trunk/impl/src/main/java/org/jboss/webbeans/ManagerImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -0,0 +1,1043 @@
+/*
+ * 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.InputStream;
+import java.io.Serializable;
+import java.lang.annotation.Annotation;
+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.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Stack;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import javax.context.Context;
+import javax.context.ContextNotActiveException;
+import javax.context.CreationalContext;
+import javax.event.Observer;
+import javax.inject.AmbiguousDependencyException;
+import javax.inject.BindingType;
+import javax.inject.DeploymentException;
+import javax.inject.DuplicateBindingTypeException;
+import javax.inject.Production;
+import javax.inject.Standard;
+import javax.inject.TypeLiteral;
+import javax.inject.UnproxyableDependencyException;
+import javax.inject.UnsatisfiedDependencyException;
+import javax.inject.manager.Bean;
+import javax.inject.manager.Decorator;
+import javax.inject.manager.InjectionPoint;
+import javax.inject.manager.InterceptionType;
+import javax.inject.manager.Interceptor;
+import javax.inject.manager.Manager;
+
+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.ContextMap;
+import org.jboss.webbeans.context.CreationalContextImpl;
+import org.jboss.webbeans.ejb.EjbDescriptorCache;
+import org.jboss.webbeans.event.EventManager;
+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.introspector.AnnotatedMethod;
+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.resources.spi.NamingContext;
+import org.jboss.webbeans.util.Beans;
+import org.jboss.webbeans.util.Reflections;
+
+/**
+ * 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 RootManager implements WebBeansManager, Serializable
+{
+
+ private static final Log log = Logging.getLog(RootManager.class);
+
+ private static final long serialVersionUID = 3021562879133838561L;
+
+ // The JNDI key to place the manager under
+ public static final String JNDI_KEY = "java:app/Manager";
+
+ // The enabled deployment types from web-beans.xml
+ private transient List<Class<? extends Annotation>> enabledDeploymentTypes;
+ // The Web Beans event manager
+ private transient final EventManager eventManager;
+
+ // An executor service for asynchronous tasks
+ private transient final ExecutorService taskExecutor = Executors.newSingleThreadExecutor();
+
+ // An injection point metadata beans factory
+ private transient final ThreadLocal<Stack<InjectionPoint>> currentInjectionPoint;
+
+ // The bean resolver
+ private transient final Resolver resolver;
+
+ // The registered contexts
+ private transient final ContextMap contextMap;
+ // The client proxy pool
+ private transient final ClientProxyProvider clientProxyProvider;
+ // The registered beans
+ private transient List<Bean<?>> beans;
+ // The registered beans, mapped by implementation class
+ private transient final Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeanMap;
+
+ private transient final Map<String, RIBean<?>> riBeans;
+
+ // The registered decorators
+ private transient final Set<Decorator> decorators;
+ // The registered interceptors
+ private transient final Set<Interceptor> interceptors;
+
+ // The EJB resolver provided by the container
+ private transient final ServiceRegistry simpleServiceRegistry;
+
+ private transient final EjbDescriptorCache ejbDescriptorCache;
+
+ private final transient Map<Bean<?>, Bean<?>> specializedBeans;
+
+ private final transient NonContextualInjector nonContextualInjector;
+
+ /**
+ * Create a new manager
+ *
+ * @param ejbServices
+ * the ejbResolver to use
+ */
+ public RootManager(ServiceRegistry simpleServiceRegistry)
+ {
+ this.simpleServiceRegistry = simpleServiceRegistry;
+ this.beans = new CopyOnWriteArrayList<Bean<?>>();
+ this.newEnterpriseBeanMap = new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>();
+ this.riBeans = new ConcurrentHashMap<String, RIBean<?>>();
+ this.resolver = new Resolver(this);
+ this.clientProxyProvider = new ClientProxyProvider();
+ this.decorators = new HashSet<Decorator>();
+ this.interceptors = new HashSet<Interceptor>();
+ this.contextMap = new ContextMap();
+ this.eventManager = new EventManager();
+ this.ejbDescriptorCache = new EjbDescriptorCache();
+ this.currentInjectionPoint = new ThreadLocal<Stack<InjectionPoint>>()
+ {
+ @Override
+ protected Stack<InjectionPoint> initialValue()
+ {
+ return new Stack<InjectionPoint>();
+ }
+ };
+ this.specializedBeans = new HashMap<Bean<?>, Bean<?>>();
+ this.nonContextualInjector = new NonContextualInjector(this);
+ List<Class<? extends Annotation>> defaultEnabledDeploymentTypes = new ArrayList<Class<? extends Annotation>>();
+ defaultEnabledDeploymentTypes.add(0, Standard.class);
+ defaultEnabledDeploymentTypes.add(1, Production.class);
+ setEnabledDeploymentTypes(defaultEnabledDeploymentTypes);
+ }
+
+ /**
+ * 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.inject.manager.Manager#addBean(javax.inject.manager.Bean)
+ */
+ public Manager addBean(Bean<?> bean)
+ {
+ if (beans.contains(bean))
+ {
+ return this;
+ }
+ resolver.clear();
+ beans.add(bean);
+ return this;
+ }
+
+ /**
+ * 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<AnnotatedMethod<?>> resolveDisposalMethods(Class<T> apiType, Annotation... bindings)
+ {
+ return Collections.emptySet();
+ }
+
+ /**
+ * Resolves observers for given event and bindings
+ *
+ * @param event
+ * The event to match
+ * @param bindings
+ * The binding types to match
+ * @return The set of matching observers
+ *
+ * @see javax.inject.manager.Manager#resolveObservers(java.lang.Object,
+ * java.lang.annotation.Annotation[])
+ */
+ @SuppressWarnings("unchecked")
+ public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
+ {
+ Class<?> clazz = event.getClass();
+ for (Annotation annotation : bindings)
+ {
+ if (!MetaDataCache.instance().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);
+ }
+ Type t = new Reflections.HierarchyDiscovery(clazz).getResolvedType();
+ for (Type type : Reflections.getActualTypeArguments(clazz))
+ {
+ if (type instanceof WildcardType)
+ {
+ throw new IllegalArgumentException("Cannot resolve an event type parameterized with a wildcard " + clazz);
+ }
+ if (type instanceof TypeVariable)
+ {
+ throw new IllegalArgumentException("Cannot resolve an event type parameterized with a type parameter " + clazz);
+ }
+ }
+ return eventManager.getObservers(event, bindings);
+ }
+
+ /**
+ * 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();
+ }
+
+ /**
+ * Resolves beans by API type and binding types
+ *
+ * @param type
+ * The API type to match
+ * @param bindings
+ * The binding types to match
+ * @return The set of matching beans
+ *
+ * @see javax.inject.manager.Manager#resolveByType(java.lang.Class,
+ * java.lang.annotation.Annotation[])
+ */
+ public <T> Set<Bean<T>> resolveByType(Class<T> type, Annotation... bindings)
+ {
+ return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
+ }
+
+ /**
+ * Resolves beans by API type literal and binding types
+ *
+ * @param type
+ * The API type literal to match
+ * @param bindings
+ * The binding types to match
+ * @return The set of matching beans
+ *
+ * @see javax.inject.manager.Manager#resolveByType(javax.inject.TypeLiteral,
+ * java.lang.annotation.Annotation[])
+ */
+ public <T> Set<Bean<T>> resolveByType(TypeLiteral<T> type, Annotation... bindings)
+ {
+ return resolveByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
+ }
+
+ public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, InjectionPoint injectionPoint, Annotation... bindings)
+ {
+ boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
+ try
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().push(injectionPoint);
+ }
+ return resolveByType(element, bindings);
+ }
+ finally
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+ }
+
+ /**
+ * Check the resolution request is valid, and then ask the resolver to
+ * perform the resolution. For internal use.
+ *
+ * @param element
+ * The item to resolve
+ * @param bindings
+ * The binding types to match
+ * @return The set of matching beans
+ */
+ public <T> Set<Bean<T>> resolveByType(AnnotatedItem<T, ?> element, Annotation... bindings)
+ {
+ for (Annotation annotation : element.getAnnotationsAsSet())
+ {
+ if (!MetaDataCache.instance().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.length > element.getMetaAnnotations(BindingType.class).size())
+ {
+ throw new DuplicateBindingTypeException("Duplicate bindings (" + Arrays.asList(bindings) + ") type passed " + element.toString());
+ }
+ return resolver.get(element);
+ }
+
+ /**
+ * 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.beans = new CopyOnWriteArrayList<Bean<?>>(beans);
+ for (RIBean<?> bean : beans)
+ {
+ if (bean instanceof NewEnterpriseBean)
+ {
+ newEnterpriseBeanMap.put(bean.getType(), (EnterpriseBean<?>) bean);
+ }
+ riBeans.put(bean.getId(), bean);
+ }
+ resolver.clear();
+ }
+ }
+
+ /**
+ * Gets the class-mapped beans. For internal use.
+ *
+ * @return The bean map
+ */
+ public Map<Class<?>, EnterpriseBean<?>> getNewEnterpriseBeanMap()
+ {
+ return newEnterpriseBeanMap;
+ }
+
+ /**
+ * The beans registered with the Web Bean manager. For internal use
+ *
+ * @return The list of known beans
+ */
+ public List<Bean<?>> getBeans()
+ {
+ return Collections.unmodifiableList(beans);
+ }
+
+ 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.inject.manager.Manager#addContext(javax.context.Context)
+ */
+ public Manager addContext(Context context)
+ {
+ contextMap.add(context);
+ return this;
+ }
+
+ /**
+ * Registers a decorator with the manager
+ *
+ * @param decorator
+ * The decorator to register
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#addDecorator(javax.inject.manager.Decorator)
+ */
+ public Manager addDecorator(Decorator decorator)
+ {
+ decorators.add(decorator);
+ return this;
+ }
+
+ /**
+ * Registers an interceptor with the manager
+ *
+ * @param interceptor
+ * The interceptor to register
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#addInterceptor(javax.inject.manager.Interceptor)
+ */
+ public Manager addInterceptor(Interceptor interceptor)
+ {
+ interceptors.add(interceptor);
+ return this;
+ }
+
+ /**
+ * Registers an observer for a given event type and binding types
+ *
+ * @param observer
+ * The observer to register
+ * @param eventType
+ * The event type to match
+ * @param bindings
+ * The bindings to match
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#addObserver(javax.event.Observer,
+ * java.lang.Class, java.lang.annotation.Annotation[])
+ */
+ public <T> Manager addObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
+ {
+ this.eventManager.addObserver(observer, eventType, bindings);
+ return this;
+ }
+
+ public <T> Manager addObserver(ObserverImpl<T> observer)
+ {
+ this.eventManager.addObserver(observer, observer.getEventType(), observer.getBindingsAsArray());
+ return this;
+ }
+
+ /**
+ * Registers an observer for a given event type literal and binding types
+ *
+ * @param observer
+ * The observer to register
+ * @param eventType
+ * The event type literal to match
+ * @param bindings
+ * The bindings to match
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#addObserver(javax.event.Observer,
+ * javax.inject.TypeLiteral, java.lang.annotation.Annotation[])
+ */
+ public <T> Manager addObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
+ {
+ eventManager.addObserver(observer, eventType.getType(), bindings);
+ return this;
+ }
+
+ /**
+ * 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.inject.manager.Manager#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.inject.manager.Manager#getContext(java.lang.Class)
+ */
+ public Context getContext(Class<? extends Annotation> scopeType)
+ {
+ List<Context> activeContexts = new ArrayList<Context>();
+ for (Context context : contextMap.getContext(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();
+ }
+
+ /**
+ * Direct access to built in contexts. For internal use.
+ *
+ * @param scopeType
+ * The scope type of the context
+ * @return The context
+ */
+ public Context getBuiltInContext(Class<? extends Annotation> scopeType)
+ {
+ return contextMap.getBuiltInContext(scopeType);
+ }
+
+ /**
+ * Returns an instance of a bean
+ *
+ * @param bean
+ * The bean to instantiate
+ * @return An instance of the bean
+ *
+ * @see javax.inject.manager.Manager#getInstance(javax.inject.manager.Bean)
+ */
+ public <T> T getInstance(Bean<T> bean)
+ {
+ return getInstance(bean, true);
+ }
+
+ public <T> T getInstance(Bean<T> bean, boolean create)
+ {
+ if (create)
+ {
+ return getInstance(bean, new CreationalContextImpl<T>(bean));
+ }
+ else
+ {
+ return getInstance(bean, null);
+ }
+ }
+
+ /**
+ * Returns an instance of a bean
+ *
+ * @param bean
+ * The bean to instantiate
+ * @return An instance of the bean
+ *
+ * @see javax.inject.manager.Manager#getInstance(javax.inject.manager.Bean)
+ */
+ @SuppressWarnings("unchecked")
+ private <T> T getInstance(Bean<T> bean, CreationalContextImpl<T> creationalContext)
+ {
+ if (specializedBeans.containsKey(bean))
+ {
+ return getInstance((Bean<T>) specializedBeans.get(bean), creationalContext);
+ }
+ else if (MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal())
+ {
+ if (creationalContext != null || (creationalContext == null && getContext(bean.getScopeType()).get(bean) != null))
+ {
+ return (T) clientProxyProvider.getClientProxy(bean);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ else
+ {
+ return getContext(bean.getScopeType()).get(bean, creationalContext);
+ }
+ }
+
+ public <T> T getInstanceToInject(InjectionPoint injectionPoint)
+ {
+ return this.<T> getInstanceToInject(injectionPoint, null);
+ }
+
+ public void injectNonContextualInstance(Object instance)
+ {
+ nonContextualInjector.inject(instance);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> T getInstanceToInject(InjectionPoint injectionPoint, CreationalContext<?> creationalContext)
+ {
+ boolean registerInjectionPoint = !injectionPoint.getType().equals(InjectionPoint.class);
+ try
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().push(injectionPoint);
+ }
+ AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]));
+ Bean<T> bean = getBeanByType(element, element.getBindingsAsArray());
+ if (creationalContext instanceof CreationalContextImpl)
+ {
+ CreationalContextImpl<?> ctx = (CreationalContextImpl<?>) creationalContext;
+ if (ctx.containsIncompleteInstance(bean))
+ {
+ return ctx.getIncompleteInstance(bean);
+ }
+ else
+ {
+ return getInstance(bean, ctx.getCreationalContext(bean));
+ }
+ }
+ else
+ {
+ return getInstance(bean);
+ }
+ }
+ finally
+ {
+ if (registerInjectionPoint)
+ {
+ currentInjectionPoint.get().pop();
+ }
+ }
+ }
+
+ /**
+ * Gets an instance by name, returning null if none is found and throwing an
+ * exception if too many beans match
+ *
+ * @param name
+ * The name to match
+ * @return An instance of the bean
+ *
+ * @see javax.inject.manager.Manager#getInstanceByName(java.lang.String)
+ */
+ public Object getInstanceByName(String name)
+ {
+ Set<Bean<?>> beans = resolveByName(name);
+ if (beans.size() == 0)
+ {
+ return null;
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousDependencyException("Resolved multiple Web Beans with " + name);
+ }
+ else
+ {
+ return getInstance(beans.iterator().next());
+ }
+ }
+
+ /**
+ * 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
+ *
+ * @see javax.inject.manager.Manager#getInstanceByType(java.lang.Class,
+ * java.lang.annotation.Annotation[])
+ */
+ public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
+ {
+ return getInstanceByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
+ }
+
+ /**
+ * Returns an instance by type literal and binding types
+ *
+ * @param type
+ * The type to match
+ * @param bindings
+ * The binding types to match
+ * @return An instance of the bean
+ *
+ * @see javax.inject.manager.Manager#getInstanceByType(javax.inject.TypeLiteral,
+ * java.lang.annotation.Annotation[])
+ */
+ public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindings)
+ {
+ return getInstanceByType(ResolvableAnnotatedClass.of(type, bindings), bindings);
+ }
+
+ /**
+ * Resolve an instance, verify that the resolved bean can be instantiated,
+ * and return
+ *
+ * @param element
+ * The annotated item to match
+ * @param bindings
+ * The binding types to match
+ * @return An instance of the bean
+ */
+ private <T> T getInstanceByType(AnnotatedItem<T, ?> element, Annotation... bindings)
+ {
+ return getInstance(getBeanByType(element, bindings));
+ }
+
+ public <T> Bean<T> getBeanByType(AnnotatedItem<T, ?> element, Annotation... bindings)
+ {
+ Set<Bean<T>> beans = resolveByType(element, bindings);
+ if (beans.size() == 0)
+ {
+ throw new UnsatisfiedDependencyException(element + "Unable to resolve any Web Beans");
+ }
+ else if (beans.size() > 1)
+ {
+ throw new AmbiguousDependencyException(element + "Resolved multiple Web Beans");
+ }
+ Bean<T> bean = beans.iterator().next();
+ boolean normalScoped = MetaDataCache.instance().getScopeModel(bean.getScopeType()).isNormal();
+ if (normalScoped && !Beans.isBeanProxyable(bean))
+ {
+ throw new UnproxyableDependencyException("Normal scoped bean " + bean + " is not proxyable");
+ }
+ return bean;
+ }
+
+ /**
+ * Removes an observer
+ *
+ * @param observer
+ * The observer to remove
+ * @param eventType
+ * The event type to match
+ * @param bindings
+ * the binding types to match
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#removeObserver(javax.event.Observer,
+ * java.lang.Class, java.lang.annotation.Annotation[])
+ */
+ public <T> Manager removeObserver(Observer<T> observer, Class<T> eventType, Annotation... bindings)
+ {
+ this.eventManager.removeObserver(observer, eventType, bindings);
+ return this;
+ }
+
+ /**
+ * Removes an observer
+ *
+ * @param observer
+ * The observer to remove
+ * @param eventType
+ * The event type to match
+ * @param bindings
+ * the binding types to match
+ * @return A reference to the manager
+ *
+ * @see javax.inject.manager.Manager#removeObserver(javax.event.Observer,
+ * javax.inject.TypeLiteral, java.lang.annotation.Annotation[])
+ */
+ public <T> Manager removeObserver(Observer<T> observer, TypeLiteral<T> eventType, Annotation... bindings)
+ {
+ this.eventManager.removeObserver(observer, eventType.getRawType(), bindings);
+ return this;
+ }
+
+ /**
+ * Resolves a set of beans based on their name
+ *
+ * @param The
+ * name to match
+ * @return The set of matching beans
+ *
+ * @see javax.inject.manager.Manager#resolveByName(java.lang.String)
+ */
+ public Set<Bean<?>> resolveByName(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.inject.manager.Manager#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.inject.manager.Manager#resolveInterceptors(javax.inject.manager.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;
+ }
+
+ public EjbDescriptorCache getEjbDescriptorCache()
+ {
+ return ejbDescriptorCache;
+ }
+
+ /**
+ * 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: " + contextMap.keySet() + "\n");
+ buffer.append("Registered beans: " + getBeans().size() + "\n");
+ buffer.append("Registered decorators: " + decorators.size() + "\n");
+ buffer.append("Registered interceptors: " + interceptors.size() + "\n");
+ buffer.append("Specialized beans: " + specializedBeans.size() + "\n");
+ return buffer.toString();
+ }
+
+ public Manager parse(InputStream xmlStream)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Manager createActivity()
+ {
+ return new ChildManager(this);
+ }
+
+ public Manager setCurrent(Class<? extends Annotation> scopeType)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public ServiceRegistry getServices()
+ {
+ return simpleServiceRegistry;
+ }
+
+ /**
+ * 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.rootManager();
+ }
+
+ /**
+ * 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);
+ getServices().get(NamingContext.class).unbind(RootManager.JNDI_KEY);
+ }
+
+ /**
+ * 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();
+ }
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/RootManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -34,7 +34,7 @@
import javax.inject.Standard;
import javax.inject.manager.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.DependentInstancesStore;
import org.jboss.webbeans.conversation.ConversationImpl;
@@ -62,7 +62,7 @@
{
@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, RootManager.class, ConversationImpl.class));
private boolean proxyable;
@@ -112,7 +112,7 @@
// If the type a primitive?
private boolean primitive;
// The Web Beans manager
- protected ManagerImpl manager;
+ protected RootManager manager;
protected boolean _serializable;
@@ -128,7 +128,7 @@
*
* @param manager The Web Beans manager
*/
- public AbstractBean(ManagerImpl manager)
+ public AbstractBean(RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -33,7 +33,7 @@
import javax.inject.Produces;
import javax.inject.Production;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.FieldInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
@@ -75,7 +75,7 @@
* @param type The type
* @param manager The Web Beans manager
*/
- protected AbstractClassBean(AnnotatedClass<T> type, ManagerImpl manager)
+ protected AbstractClassBean(AnnotatedClass<T> type, RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -37,7 +37,7 @@
import javax.inject.Produces;
import javax.inject.manager.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.CreationalContextImpl;
import org.jboss.webbeans.context.DependentContext;
@@ -71,7 +71,7 @@
* @param declaringBean The declaring bean
* @param manager The Web Beans manager
*/
- public AbstractProducerBean(AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ public AbstractProducerBean(AbstractClassBean<?> declaringBean, RootManager manager)
{
super(manager);
this.declaringBean = 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -35,7 +35,7 @@
import javax.inject.DefinitionException;
import javax.interceptor.Interceptor;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bean.proxy.EnterpriseBeanInstance;
import org.jboss.webbeans.bean.proxy.EnterpriseBeanProxyMethodHandler;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
@@ -77,7 +77,7 @@
* @param manager the current manager
* @return An Enterprise Web Bean
*/
- public static <T> EnterpriseBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager)
+ public static <T> EnterpriseBean<T> of(AnnotatedClass<T> clazz, RootManager manager)
{
return new EnterpriseBean<T>(clazz, manager);
}
@@ -88,7 +88,7 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- protected EnterpriseBean(AnnotatedClass<T> type, ManagerImpl manager)
+ protected EnterpriseBean(AnnotatedClass<T> type, RootManager manager)
{
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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -24,7 +24,7 @@
import javax.context.Dependent;
import javax.inject.Standard;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
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 NewEnterpriseBean instance
*/
- public static <T> NewEnterpriseBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager)
+ public static <T> NewEnterpriseBean<T> of(AnnotatedClass<T> clazz, RootManager manager)
{
return new NewEnterpriseBean<T>(clazz, manager);
}
@@ -55,7 +55,7 @@
* @param type An annotated class
* @param manager The Web Beans manager
*/
- protected NewEnterpriseBean(AnnotatedClass<T> type, ManagerImpl manager)
+ protected NewEnterpriseBean(AnnotatedClass<T> type, RootManager manager)
{
super(type, manager);
}
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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -25,7 +25,7 @@
import javax.context.Dependent;
import javax.inject.Standard;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
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 NewSimpleBean instance
*/
- public static <T> NewSimpleBean<T> of(AnnotatedClass<T> clazz, ManagerImpl manager)
+ public static <T> NewSimpleBean<T> of(AnnotatedClass<T> clazz, RootManager manager)
{
return new NewSimpleBean<T>(clazz, manager);
}
@@ -56,7 +56,7 @@
* @param type An annotated class
* @param manager The Web Beans manager
*/
- protected NewSimpleBean(AnnotatedClass<T> type, ManagerImpl manager)
+ protected NewSimpleBean(AnnotatedClass<T> type, RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -21,7 +21,7 @@
import javax.context.CreationalContext;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.util.Names;
@@ -47,7 +47,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, RootManager manager)
{
return new ProducerFieldBean<T>(field, declaringBean, manager);
}
@@ -59,7 +59,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, RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -28,7 +28,7 @@
import javax.inject.DefinitionException;
import javax.inject.Disposes;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.MethodInjectionPoint;
import org.jboss.webbeans.injection.ParameterInjectionPoint;
@@ -65,12 +65,12 @@
* 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, RootManager manager)
{
return new ProducerMethodBean<T>(method, declaringBean, manager);
}
- protected ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, ManagerImpl manager)
+ protected ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -24,7 +24,7 @@
import javax.context.Dependent;
import javax.inject.manager.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
@@ -38,9 +38,9 @@
private static final ConcurrentMap<String, AtomicInteger> ids = new ConcurrentHashMap<String, AtomicInteger>();
- private final ManagerImpl manager;
+ private final RootManager manager;
- protected RIBean(ManagerImpl manager)
+ protected RIBean(RootManager manager)
{
super(manager);
this.manager = manager;
@@ -54,7 +54,7 @@
}
@Override
- protected ManagerImpl getManager()
+ protected RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -27,7 +27,7 @@
import javax.inject.DefinitionException;
import javax.inject.Initializer;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.context.DependentStorageRequest;
@@ -83,7 +83,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, RootManager manager)
{
return new SimpleBean<T>(clazz, manager);
}
@@ -94,7 +94,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, RootManager manager)
{
super(type, manager);
initType();
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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractFacadeBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -9,13 +9,13 @@
import javax.context.CreationalContext;
import javax.inject.manager.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.context.DependentContext;
public abstract class AbstractFacadeBean<T> extends AbstractStandardBean<T>
{
- protected AbstractFacadeBean(ManagerImpl manager)
+ protected AbstractFacadeBean(RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -9,7 +9,7 @@
import javax.context.Dependent;
import javax.inject.Standard;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
@@ -23,7 +23,7 @@
private final String id;
- protected AbstractStandardBean(ManagerImpl manager)
+ protected AbstractStandardBean(RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -11,7 +11,7 @@
import javax.inject.Obtains;
import javax.inject.TypeLiteral;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.event.EventImpl;
import org.jboss.webbeans.injection.resolution.AnnotatedItemTransformer;
import org.jboss.webbeans.literal.FiresLiteral;
@@ -27,12 +27,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(RootManager manager)
{
return new EventBean(manager);
}
- protected EventBean(ManagerImpl manager)
+ protected EventBean(RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InjectionPointBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -25,7 +25,7 @@
import javax.context.CreationalContext;
import javax.inject.manager.InjectionPoint;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
/**
* Bean for InjectionPoint metadata
@@ -48,12 +48,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(RootManager manager)
{
return new InjectionPointBean(manager);
}
- protected InjectionPointBean(ManagerImpl manager)
+ protected InjectionPointBean(RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -11,7 +11,7 @@
import javax.inject.TypeLiteral;
import org.jboss.webbeans.InstanceImpl;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.injection.resolution.AnnotatedItemTransformer;
import org.jboss.webbeans.literal.ObtainsLiteral;
@@ -26,12 +26,12 @@
public static final AnnotatedItemTransformer TRANSFORMER = new FacadeBeanAnnotatedItemTransformer(TYPE, OBTAINS);
- public static AbstractFacadeBean<Instance<?>> of(ManagerImpl manager)
+ public static AbstractFacadeBean<Instance<?>> of(RootManager manager)
{
return new InstanceBean(manager);
}
- protected InstanceBean(ManagerImpl manager)
+ protected InstanceBean(RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/ManagerBean.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -11,32 +11,32 @@
import javax.context.CreationalContext;
import javax.inject.manager.Manager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
-public class ManagerBean extends AbstractStandardBean<ManagerImpl>
+public class ManagerBean extends AbstractStandardBean<RootManager>
{
- private static final Set<Type> TYPES = new HashSet<Type>(Arrays.asList(ManagerImpl.class, Manager.class));
+ private static final Set<Type> TYPES = new HashSet<Type>(Arrays.asList(RootManager.class, Manager.class));
- public static final ManagerBean of(ManagerImpl manager)
+ public static final ManagerBean of(RootManager manager)
{
return new ManagerBean(manager);
}
- protected ManagerBean(ManagerImpl manager)
+ protected ManagerBean(RootManager manager)
{
super(manager);
}
- public ManagerImpl create(CreationalContext<ManagerImpl> creationalContext)
+ public RootManager create(CreationalContext<RootManager> creationalContext)
{
return getManager();
}
@Override
- public Class<ManagerImpl> getType()
+ public Class<RootManager> getType()
{
- return ManagerImpl.class;
+ return RootManager.class;
}
@Override
@@ -45,7 +45,7 @@
return TYPES;
}
- public void destroy(ManagerImpl instance)
+ public void destroy(RootManager instance)
{
// 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -12,7 +12,7 @@
import javax.inject.Produces;
import javax.inject.Realizes;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bean.AbstractClassBean;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.NewEnterpriseBean;
@@ -44,9 +44,9 @@
private final BeanDeployerEnvironment beanDeployerEnvironment;
private final Set<AnnotatedClass<?>> classes;
- private final ManagerImpl manager;
+ private final RootManager manager;
- public BeanDeployer(ManagerImpl manager)
+ public BeanDeployer(RootManager manager)
{
this.manager = manager;
this.beanDeployerEnvironment = new BeanDeployerEnvironment();
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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/WebBeansBootstrap.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -25,7 +25,7 @@
import org.jboss.webbeans.BeanValidator;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bean.standard.EventBean;
import org.jboss.webbeans.bean.standard.InjectionPointBean;
import org.jboss.webbeans.bean.standard.InstanceBean;
@@ -77,7 +77,7 @@
private static Log log = Logging.getLog(WebBeansBootstrap.class);
// The Web Beans manager
- private ManagerImpl manager;
+ private RootManager manager;
public WebBeansBootstrap()
{
// initialize default services
@@ -97,17 +97,17 @@
log.info("EJB services not available. Session beans will be simple beans, injection into non-contextual EJBs, injection of @Resource, @PersistenceContext and @EJB in simple beans, injection of Java EE resources and JMS resources will not be available.");
}
addImplementationServices();
- this.manager = new ManagerImpl(ServiceRegistries.unmodifiableServiceRegistry(getServices()));
+ this.manager = new RootManager(ServiceRegistries.unmodifiableServiceRegistry(getServices()));
try
{
- getServices().get(NamingContext.class).unbind(ManagerImpl.JNDI_KEY);
+ getServices().get(NamingContext.class).unbind(RootManager.JNDI_KEY);
}
catch (ExecutionException e)
{
}
finally
{
- getServices().get(NamingContext.class).bind(ManagerImpl.JNDI_KEY, getManager());
+ getServices().get(NamingContext.class).bind(RootManager.JNDI_KEY, getManager());
}
CurrentManager.setRootManager(manager);
initializeContexts();
@@ -121,7 +121,7 @@
getServices().add(ServletApiAbstraction.class, new ServletApiAbstraction(resourceLoader));
}
- public ManagerImpl getManager()
+ public RootManager getManager()
{
return manager;
}
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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -17,7 +17,7 @@
package org.jboss.webbeans.event;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bean.AbstractClassBean;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.transaction.spi.TransactionServices;
@@ -38,7 +38,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, RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -35,7 +35,7 @@
import javax.inject.Produces;
import javax.inject.manager.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.context.DependentInstancesStore;
@@ -61,7 +61,7 @@
protected final MethodInjectionPoint<?> observerMethod;
private final boolean conditional;
private final boolean asynchronous;
- protected ManagerImpl manager;
+ protected RootManager manager;
private final Type eventType;
private final Annotation[] bindings;
@@ -73,7 +73,7 @@
* @param observerBean The observer bean
* @param manager The Web Beans manager
*/
- protected ObserverImpl(final AnnotatedMethod<?> observer, final Bean<?> observerBean, final ManagerImpl manager)
+ protected ObserverImpl(final AnnotatedMethod<?> observer, final Bean<?> observerBean, final RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -29,7 +29,7 @@
import javax.inject.manager.Bean;
import javax.transaction.Synchronization;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.transaction.spi.TransactionServices;
@@ -73,7 +73,7 @@
* @param observerBean The bean declaring the observer method
* @param manager The JCDI manager in use
*/
- protected TransactionalObserverImpl(AnnotatedMethod<?> observer, Bean<?> observerBean, ManagerImpl manager)
+ protected TransactionalObserverImpl(AnnotatedMethod<?> observer, Bean<?> observerBean, RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -30,7 +30,7 @@
import javax.context.CreationalContext;
import javax.inject.manager.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
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(RootManager 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, RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -25,7 +25,7 @@
import javax.context.CreationalContext;
import javax.inject.manager.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
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, RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -29,7 +29,7 @@
import javax.context.CreationalContext;
import javax.inject.manager.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
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, RootManager 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, RootManager 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, RootManager 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, RootManager 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, RootManager 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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/NonContextualInjector.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -3,7 +3,7 @@
import java.util.Set;
import java.util.concurrent.Callable;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
import org.jboss.webbeans.util.Beans;
import org.jboss.webbeans.util.collections.ConcurrentCache;
@@ -12,9 +12,9 @@
{
private final ConcurrentCache<Class<?>, Set<FieldInjectionPoint<?>>> instances;
- private final ManagerImpl manager;
+ private final RootManager manager;
- public NonContextualInjector(ManagerImpl manager)
+ public NonContextualInjector(RootManager manager)
{
this.manager = manager;
this.instances = new ConcurrentCache<Class<?>, Set<FieldInjectionPoint<?>>>();
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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -23,7 +23,7 @@
import javax.context.CreationalContext;
import javax.inject.manager.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.ForwardingAnnotatedParameter;
@@ -77,7 +77,7 @@
throw new UnsupportedOperationException();
}
- public T getValueToInject(ManagerImpl manager, CreationalContext<?> creationalContext)
+ public T getValueToInject(RootManager manager, CreationalContext<?> creationalContext)
{
return manager.<T>getInstanceToInject(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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -30,7 +30,7 @@
import javax.inject.TypeLiteral;
import javax.inject.manager.Bean;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.bean.standard.EventBean;
import org.jboss.webbeans.bean.standard.InstanceBean;
import org.jboss.webbeans.introspector.AnnotatedItem;
@@ -59,7 +59,7 @@
// The resolved names
private ConcurrentCache<String, Set<Bean<?>>> resolvedNames;
// The Web Beans manager
- private ManagerImpl manager;
+ private RootManager manager;
private final Set<AnnotatedItemTransformer> transformers;
/**
@@ -67,7 +67,7 @@
*
* @param manager The Web Beans manager
*/
- public Resolver(ManagerImpl manager)
+ public Resolver(RootManager manager)
{
this.injectionPoints = new HashSet<AnnotatedItem<?, ?>>();
this.resolvedInjectionPoints = new ConcurrentCache<ResolvableAnnotatedItem<?, ?>, Set<Bean<?>>>();
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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -25,7 +25,7 @@
import java.util.Collections;
import java.util.List;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.AnnotatedType;
@@ -181,7 +181,7 @@
* @throws InstantiationException
* @throws IllegalArgumentException
*
- * @see org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(ManagerImpl)
+ * @see org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(RootManager)
*/
public T newInstance(Object... parameters) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/bean/ext/SessionBeanElementChecker.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/bean/ext/SessionBeanElementChecker.java 2009-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/bean/ext/SessionBeanElementChecker.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -2,7 +2,7 @@
import org.dom4j.Element;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.xml.XmlConstants;
import org.jboss.webbeans.xml.checker.beanchildren.BeanChildrenChecker;
@@ -16,7 +16,7 @@
public boolean accept(Element beanElement, AnnotatedClass<?> beanClass)
{
- ManagerImpl manager = CurrentManager.rootManager();
+ RootManager manager = CurrentManager.rootManager();
if (manager.getEjbDescriptorCache().containsKey(beanElement.getName()) ||
beanElement.attribute(XmlConstants.EJB_NAME) != null)
return true;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/bean/ext/SimpleBeanElementChecker.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/bean/ext/SimpleBeanElementChecker.java 2009-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/checker/bean/ext/SimpleBeanElementChecker.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -6,7 +6,7 @@
import org.dom4j.Element;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.xml.ParseXmlHelper;
import org.jboss.webbeans.xml.XmlConstants;
@@ -22,7 +22,7 @@
public boolean accept(Element beanElement, AnnotatedClass<?> beanClass)
{
- ManagerImpl manager = CurrentManager.rootManager();
+ RootManager manager = CurrentManager.rootManager();
boolean isSessionBean = manager.getEjbDescriptorCache().containsKey(beanElement.getName()) ||
beanElement.attribute(XmlConstants.EJB_NAME) != null;
Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java 2009-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/StandaloneContainersImpl.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -7,7 +7,7 @@
import org.jboss.testharness.api.DeploymentException;
import org.jboss.testharness.spi.StandaloneContainers;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.mock.MockEELifecycle;
import org.jboss.webbeans.mock.MockWebBeanDiscovery;
@@ -27,7 +27,7 @@
lifecycle.initialize();
try
{
- ManagerImpl manager = lifecycle.getBootstrap().getManager();
+ RootManager manager = lifecycle.getBootstrap().getManager();
if (enabledDeploymentTypes != null)
{
manager.setEnabledDeploymentTypes(enabledDeploymentTypes);
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java 2009-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -11,7 +11,7 @@
import org.jboss.testharness.AbstractTest;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.util.EnumerationIterable;
import org.testng.ITestContext;
@@ -54,7 +54,7 @@
protected static final int BUILT_IN_BEANS = 3;
- protected ManagerImpl manager;
+ protected RootManager manager;
public static boolean visited = false;
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-03-30 15:24:13 UTC (rev 2272)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-03-30 16:23:55 UTC (rev 2273)
@@ -9,7 +9,7 @@
import javax.inject.manager.Bean;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.ManagerImpl;
+import org.jboss.webbeans.RootManager;
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 RootManager manager;
@BeforeClass
public void beforeClass() throws Throwable
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2272 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/activities and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-30 11:24:13 -0400 (Mon, 30 Mar 2009)
New Revision: 2272
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/CurrentActivityTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Field.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/DuplicateBeanOnDirectParentTest.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java
tck/trunk/impl/src/main/resources/tck-audit.xml
Log:
11.6 tests
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,97 @@
+package org.jboss.jsr299.tck;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.context.CreationalContext;
+import javax.inject.manager.Bean;
+import javax.inject.manager.InjectionPoint;
+import javax.inject.manager.Manager;
+
+public abstract class ForwardingBean<T> extends Bean<T>
+{
+
+ protected ForwardingBean(Manager manager)
+ {
+ super(manager);
+ }
+
+ protected abstract Bean<T> delegate();
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return delegate().getBindings();
+ }
+
+ @Override
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return delegate().getDeploymentType();
+ }
+
+ @Override
+ public Set<? extends InjectionPoint> getInjectionPoints()
+ {
+ return delegate().getInjectionPoints();
+ }
+
+ @Override
+ public String getName()
+ {
+ return delegate().getName();
+ }
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return delegate().getScopeType();
+ }
+
+ @Override
+ public Set<Type> getTypes()
+ {
+ return delegate().getTypes();
+ }
+
+ @Override
+ public boolean isNullable()
+ {
+ return delegate().isNullable();
+ }
+
+ @Override
+ public boolean isSerializable()
+ {
+ return delegate().isSerializable();
+ }
+
+ public T create(CreationalContext<T> creationalContext)
+ {
+ return delegate().create(creationalContext);
+ }
+
+ public void destroy(T instance)
+ {
+ delegate().destroy(instance);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-03-30 13:07:40 UTC (rev 2271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -12,13 +12,16 @@
import javax.context.CreationalContext;
import javax.context.Dependent;
import javax.event.Observer;
+import javax.inject.AnnotationLiteral;
import javax.inject.Production;
import javax.inject.manager.Bean;
import javax.inject.manager.InjectionPoint;
import javax.inject.manager.Manager;
import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.ForwardingBean;
import org.jboss.testharness.impl.packaging.Artifact;
import org.testng.annotations.Test;
@@ -30,8 +33,9 @@
{
final Set<InjectionPoint> injectionPoints = new HashSet<InjectionPoint>();
final Set<Type> types = new HashSet<Type>();
+ final Set<Annotation> bindings = new HashSet<Annotation>();
+ bindings.add(new AnnotationLiteral<Tame>() {});
types.add(Object.class);
- types.add(injectionPointType);
final Bean<?> bean = new Bean<Object>(manager)
{
@@ -40,7 +44,7 @@
@Override
public Set<Annotation> getBindings()
{
- return Collections.emptySet();
+ return bindings;
}
@Override
@@ -126,7 +130,7 @@
public Type getType()
{
- return Object.class;
+ return injectionPointType;
}
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
@@ -139,8 +143,6 @@
return bean;
}
- private static @interface Dummy {}
-
private static class DummyContext implements Context
{
@@ -167,7 +169,10 @@
}
@Test(groups="ri-broken")
- @SpecAssertion(section="11.6", id="b")
+ @SpecAssertions({
+ @SpecAssertion(section="11.6", id="b"),
+ @SpecAssertion(section="11.6", id="m")
+ })
public void testBeanBelongingToParentActivityBelongsToChildActivity()
{
assert getCurrentManager().resolveByType(Cow.class).size() == 1;
@@ -190,7 +195,10 @@
}
@Test(groups="ri-broken")
- @SpecAssertion(section="11.6", id="j")
+ @SpecAssertions({
+ @SpecAssertion(section="11.6", id="j"),
+ @SpecAssertion(section="11.6", id="n")
+ })
public void testObserverBelongingToParentActivityBelongsToChildActivity()
{
assert getCurrentManager().resolveObservers(new NightTime()).size() == 1;
@@ -219,4 +227,63 @@
assert childActivity.getContext(Dummy.class) != null;
}
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6", id="o")
+ public void testBeanBelongingToChildActivityCannotBeInjectedIntoParentActivityBean()
+ {
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ Manager childActivity = getCurrentManager().createActivity();
+ Bean<?> dummyBean = createDummyBean(childActivity, Cow.class);
+ childActivity.addBean(dummyBean);
+ assert getCurrentManager().resolveByType(Object.class, new AnnotationLiteral<Tame>() {}).size() == 0;
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6", id="p")
+ public void testInstanceProcessedByCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ final Bean<Cow> bean = getCurrentManager().resolveByType(Cow.class).iterator().next();
+ Manager childActivity = getCurrentManager().createActivity();
+ final Set<Annotation> bindingTypes = new HashSet<Annotation>();
+ bindingTypes.add(new AnnotationLiteral<Tame>() {});
+ childActivity.addBean(new ForwardingBean<Cow>(childActivity)
+ {
+
+ @Override
+ protected Bean<Cow> delegate()
+ {
+ return bean;
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return bindingTypes;
+ }
+
+ });
+ assert getCurrentManager().getInstanceByType(Field.class).get() == null;
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6", id="s")
+ public void testObserverBelongingToChildDoesNotFireForParentActivity()
+ {
+ Manager childActivity = getCurrentManager().createActivity();
+ Observer<NightTime> observer = new Observer<NightTime>()
+ {
+
+ public void notify(NightTime event)
+ {
+ assert false;
+ }
+
+ };
+ childActivity.addObserver(observer, NightTime.class);
+ getCurrentManager().fireEvent(new NightTime());
+ }
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java 2009-03-30 13:07:40 UTC (rev 2271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -1,6 +1,6 @@
package org.jboss.jsr299.tck.tests.activities;
-public class Cow
+class Cow
{
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.jsr299.tck.tests.activities;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.context.ScopeType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@ScopeType
+@Inherited
+@interface Dummy {}
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.activities;
+
+import javax.inject.Instance;
+import javax.inject.Obtains;
+
+class Field
+{
+
+ @Obtains @Tame Instance<Cow> instance;
+
+ public Cow get()
+ {
+ return instance.get();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java 2009-03-30 13:07:40 UTC (rev 2271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -2,7 +2,7 @@
import javax.event.Observes;
-public class Fox
+class Fox
{
private static boolean observed = false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java 2009-03-30 13:07:40 UTC (rev 2271)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -1,6 +1,6 @@
package org.jboss.jsr299.tck.tests.activities;
-public class NightTime
+class NightTime
{
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.activities;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+class Cow
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/CurrentActivityTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/CurrentActivityTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/CurrentActivityTest.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,216 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import java.lang.annotation.Annotation;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.context.Context;
+import javax.context.ContextNotActiveException;
+import javax.context.Contextual;
+import javax.context.CreationalContext;
+import javax.event.Observer;
+import javax.inject.AnnotationLiteral;
+import javax.inject.manager.Bean;
+import javax.inject.manager.Manager;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.hibernate.tck.annotations.SpecAssertions;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.jsr299.tck.ForwardingBean;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.testng.annotations.Test;
+
+@Artifact
+public class CurrentActivityTest extends AbstractJSR299Test
+{
+
+ static interface TestableObserver<T> extends Observer<T>
+ {
+
+ boolean isObserved();
+
+ }
+
+
+ private static class DummyContext implements Context
+ {
+
+ private boolean active = true;
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return null;
+ }
+
+ public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return active;
+ }
+
+ public void setActive(boolean active)
+ {
+ this.active = active;
+ }
+
+ }
+
+ private static class NonNormalContext extends DummyContext
+ {
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return NonNormalScope.class;
+ }
+
+ }
+
+ @Test(groups="ri-broken", expectedExceptions=ContextNotActiveException.class)
+ @SpecAssertion(section="11.6.1", id="b")
+ public void testInactiveScope()
+ {
+ DummyContext dummyContext = new DummyContext();
+ dummyContext.setActive(false);
+ getCurrentManager().addContext(dummyContext);
+ Manager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ }
+
+ @Test(groups="ri-broken", expectedExceptions=IllegalArgumentException.class)
+ @SpecAssertion(section="11.6.1", id="c")
+ public void testNonNormalScope()
+ {
+ Context dummyContext = new NonNormalContext();
+ getCurrentManager().addContext(dummyContext);
+ Manager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6.1", id="d")
+ public void testELEvaluationProcessedByCurrentActivty()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ final Bean<Cow> bean = getCurrentManager().resolveByType(Cow.class).iterator().next();
+ Manager childActivity = getCurrentManager().createActivity();
+ childActivity.addBean(new ForwardingBean<Cow>(childActivity)
+ {
+
+ @Override
+ protected Bean<Cow> delegate()
+ {
+ return bean;
+ }
+
+ @Override
+ public String getName()
+ {
+ return "daisy";
+ }
+
+ });
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert getCurrentConfiguration().getEl().evaluateValueExpression("#{daisy}", Cow.class) != null;
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6.1", id="e")
+ public void testInjectedManagerIsCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ Manager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert getCurrentManager().getInstanceByType(Horse.class).getManager().equals(childActivity);
+ }
+
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6.1", id="f")
+ public void testJndiManagerIsCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ Manager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert getCurrentManager().getInstanceByType(Donkey.class).getManager().equals(childActivity);
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertions({
+ @SpecAssertion(section="11.6.1", id="g"),
+ @SpecAssertion(section="11.6.1", id="m")
+ })
+ public void testEventProcessedByCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ Manager childActivity = getCurrentManager().createActivity();
+ TestableObserver<NightTime> observer = new TestableObserver<NightTime>()
+ {
+
+ boolean observed = false;
+
+ public void notify(NightTime event)
+ {
+ observed = true;
+ }
+
+ public boolean isObserved()
+ {
+ return observed;
+ }
+
+ };
+ childActivity.addObserver(observer, NightTime.class);
+ childActivity.setCurrent(dummyContext.getScopeType());
+ getCurrentManager().getInstanceByType(Dusk.class).ping();
+ assert observer.isObserved();
+ }
+
+ @Test(groups="ri-broken")
+ @SpecAssertion(section="11.6.1", id="h")
+ public void testInstanceProcessedByCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ final Bean<Cow> bean = getCurrentManager().resolveByType(Cow.class).iterator().next();
+ Manager childActivity = getCurrentManager().createActivity();
+ final Set<Annotation> bindingTypes = new HashSet<Annotation>();
+ bindingTypes.add(new AnnotationLiteral<Tame>() {});
+ childActivity.addBean(new ForwardingBean<Cow>(childActivity)
+ {
+
+ @Override
+ protected Bean<Cow> delegate()
+ {
+ return bean;
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return bindingTypes;
+ }
+
+ });
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert getCurrentManager().getInstanceByType(Field.class).get() != null;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/CurrentActivityTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.inject.manager.Manager;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+class Donkey
+{
+
+ Manager manager;
+
+ public Donkey() throws NamingException
+ {
+ manager = (Manager) new InitialContext().lookup("java:app/Manager");
+ }
+
+ public Manager getManager()
+ {
+ return manager;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.context.ScopeType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@ScopeType
+@Inherited
+@interface Dummy {}
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.event.Event;
+import javax.event.Fires;
+import javax.inject.Initializer;
+
+class Dusk
+{
+
+ @Initializer
+ public Dusk(@Fires Event<NightTime> event)
+ {
+ event.fire(new NightTime());
+ }
+
+ public void ping() {}
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Field.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Field.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Field.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.inject.Instance;
+import javax.inject.Obtains;
+
+class Field
+{
+
+ @Obtains @Tame Instance<Cow> instance;
+
+ public Cow get()
+ {
+ return instance.get();
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Field.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.inject.Current;
+import javax.inject.manager.Manager;
+
+class Horse
+{
+
+ @Current Manager manager;
+
+ public Manager getManager()
+ {
+ return manager;
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+class NightTime
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.context.ScopeType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@ScopeType(normal=false)
+@Inherited
+@interface NonNormalScope {}
\ No newline at end of file
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/DuplicateBeanOnDirectParentTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/DuplicateBeanOnDirectParentTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/DuplicateBeanOnDirectParentTest.java 2009-03-30 15:24:13 UTC (rev 2272)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.activities.duplicateOnParent;
+
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+
+@Artifact
+public class DuplicateBeanOnDirectParentTest extends AbstractJSR299Test
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/DuplicateBeanOnDirectParentTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/resources/tck-audit.xml
===================================================================
--- tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-30 13:07:40 UTC (rev 2271)
+++ tck/trunk/impl/src/main/resources/tck-audit.xml 2009-03-30 15:24:13 UTC (rev 2272)
@@ -6369,8 +6369,9 @@
</section>
<section id="11.6.1" title="Current Activity">
- <assertion id="a">
+ <assertion id="a" testable="false">
<text>An activity may be associated with the current context for a normal scope by calling |setCurrent()|, passing the normal scope type</text>
+ <note>A statement of intent</note>
</assertion>
<assertion id="b">
@@ -6401,18 +6402,6 @@
<text>~All EL evaluations (as defined Section 5.10, "EL name resolution"), all calls to any injected |Manager| object or |Manager| object obtained via JNDI lookup (as defined by Section 5.7, "The Manager object"), all calls to any injected |Event| object (as defined in Section 7.6, "The Event interface") and ~all calls to any injected |Instance| object (as defined by Section 5.8, "Dynamic lookup") are processed by the current activity</text>
</assertion>
- <assertion id="j">
- <text>If the root activity has no active normal scope such that the current context for that scope has an associated activity, the root activity is the current activity.</text>
- </assertion>
-
- <assertion id="k">
- <text>If the root activity has exactly one active normal scope such that the current context for that scope has an associated activity, that activity is the current activity.</text>
- </assertion>
-
- <assertion id="l" testable="false">
- <text>Otherwise, there is no well-defined current activity, and the behavior is undefined. Portable frameworks and applications should not depend upon the behavior of the container when two different current contexts have an associated activity.</text>
- </assertion>
-
<assertion id="m">
<text>A bean registered with an activity is only available to Unified EL expressions that are evaluated when that activity or one of its children is the current activity.</text>
</assertion>
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2270 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-30 08:29:03 -0400 (Mon, 30 Mar 2009)
New Revision: 2270
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/Bean_Broken.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/BrokenInitializerBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/ManagerObserver.java
Log:
WBRI-213
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/Bean_Broken.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/Bean_Broken.java 2009-03-30 12:19:59 UTC (rev 2269)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/Bean_Broken.java 2009-03-30 12:29:03 UTC (rev 2270)
@@ -1,9 +0,0 @@
-package org.jboss.jsr299.tck.tests.deployment.lifecycle.fail;
-
-import javax.inject.Production;
-
-@Production
-class Bean_Broken<T>
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/BrokenInitializerBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/BrokenInitializerBean.java 2009-03-30 12:19:59 UTC (rev 2269)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/BrokenInitializerBean.java 2009-03-30 12:29:03 UTC (rev 2270)
@@ -1,11 +1,12 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle.fail;
+import javax.event.Observes;
import javax.inject.Initializer;
class BrokenInitializerBean
{
@Initializer
- public <T> void initialize(Bean_Broken<T> farmer)
+ public void initialize(@Observes String string)
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/ManagerObserver.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/ManagerObserver.java 2009-03-30 12:19:59 UTC (rev 2269)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/ManagerObserver.java 2009-03-30 12:29:03 UTC (rev 2270)
@@ -8,6 +8,6 @@
{
public void managerInitialized(@Observes @Initialized Manager manager)
{
- throw new IllegalStateException("Deployment should have already failed!");
+ assert false : "Deployment should already have failed";
}
}
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2269 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-30 08:19:59 -0400 (Mon, 30 Mar 2009)
New Revision: 2269
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/DeploymentFailureTest.java
Log:
WBRI-213
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/DeploymentFailureTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/DeploymentFailureTest.java 2009-03-30 07:39:29 UTC (rev 2268)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/fail/DeploymentFailureTest.java 2009-03-30 12:19:59 UTC (rev 2269)
@@ -15,7 +15,7 @@
@ExpectedDeploymentException(DefinitionException.class)
public class DeploymentFailureTest extends AbstractJSR299Test
{
- @Test(groups = "ri-broken")
+ @Test
@SpecAssertion(section = "11.1", id = "a")
public void testDeploymentFailsBeforeInitialization()
{
15 years, 9 months