openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r836311 - in /incubator/openwebbeans/trunk/webbeans-impl/src: main/java/org/apache/webbeans/component/ main/java/org/apache/webbeans/component/creation/ main/java/org/apache/webbeans/config/ main/java/org/apache/webbeans/container/ main/jav...
Date Sun, 15 Nov 2009 01:50:34 GMT
Author: gerdogdu
Date: Sun Nov 15 01:50:33 2009
New Revision: 836311

URL: http://svn.apache.org/viewvc?rev=836311&view=rev
Log:
Update while running TCK.

Added:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java   (with props)
Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectedTargetBeanCreator.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/InjectedTargetBeanCreator.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java   (contents, props changed)
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
    incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/log4j.properties
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/literals/InstanceTypeLiteralBean.java
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/specializes/logger/LoggerSpecializationTest.java
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypeLiteralTest.java

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractInjectionTargetBean.java Sun Nov 15 01:50:33 2009
@@ -133,6 +133,12 @@
         }
 
         afterConstructor(instance, creationalContext);
+        
+        if(this.creationalContext instanceof CreationalContextImpl)
+        {
+            CreationalContextImpl<T> impl = (CreationalContextImpl<T>)this.creationalContext;
+            impl.remove();
+        }
 
         return instance;
     }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/AbstractProducerBean.java Sun Nov 15 01:50:33 2009
@@ -150,11 +150,11 @@
 
         if (specialize != null)
         {
-            parentInstance = getManager().getReference(specialize, null, null);
+            parentInstance = getManager().getReference(specialize, null, getManager().createCreationalContext(specialize));
         }
         else
         {
-            parentInstance = getManager().getReference(this.ownerComponent, null, null);
+            parentInstance = getManager().getReference(this.ownerComponent, null, getManager().createCreationalContext(this.ownerComponent));
         }
 
         return parentInstance;

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/ConversationBean.java Sun Nov 15 01:50:33 2009
@@ -36,15 +36,26 @@
         
         String conversationId = conversationService.getConversationId();
         
+        String sessionId = conversationService.getConversationSessionId();
+        
         Conversation conversation = null;
 
         if (conversationId != null)
         {
-            conversation = ConversationManager.getInstance().getConversation(conversationId);
+            conversation = ConversationManager.getInstance().getConversation(conversationId,sessionId);
         }
         else
         {
-            conversation = new ConversationImpl(conversationService.getConversationSessionId());
+            if(sessionId != null)
+            {
+                conversation = new ConversationImpl(conversationService.getConversationSessionId());    
+            }
+            else
+            {
+                //Used in Tests
+                conversation = new ConversationImpl();
+            }
+            
         }
 
         return conversation;

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectedTargetBeanCreator.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectedTargetBeanCreator.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectedTargetBeanCreator.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/AbstractInjectedTargetBeanCreator.java Sun Nov 15 01:50:33 2009
@@ -17,6 +17,7 @@
 
 import javax.enterprise.context.spi.CreationalContext;
 import javax.enterprise.inject.spi.InjectionTarget;
+import javax.enterprise.inject.spi.ObserverMethod;
 
 import org.apache.webbeans.component.AbstractInjectionTargetBean;
 import org.apache.webbeans.component.ProducerFieldBean;
@@ -108,15 +109,15 @@
      * {@inheritDoc}
      */
     @Override
-    public void defineObserverMethods()
+    public Set<ObserverMethod<?>> defineObserverMethods()
     {   
         if(isDefaultMetaDataProvider())
         {
-            DefinitionUtil.defineObserverMethods(getBean(), getBean().getReturnType());
+            return DefinitionUtil.defineObserverMethods(getBean(), getBean().getReturnType());
         }
         else
         {
-            //TODO
+            return null;
         }
     }
 

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/InjectedTargetBeanCreator.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/InjectedTargetBeanCreator.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/InjectedTargetBeanCreator.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/component/creation/InjectedTargetBeanCreator.java Sun Nov 15 01:50:33 2009
@@ -16,6 +16,7 @@
 import java.util.Set;
 
 import javax.enterprise.inject.spi.InjectionTarget;
+import javax.enterprise.inject.spi.ObserverMethod;
 
 import org.apache.webbeans.component.InjectionTargetBean;
 import org.apache.webbeans.component.ProducerFieldBean;
@@ -66,7 +67,7 @@
     /**
      * Define observer methods, a.k.a method parameter with <code>@Observes</code>
      */
-    public void defineObserverMethods();    
+    public Set<ObserverMethod<?>> defineObserverMethods();    
     
     /**
      * Gets injection target.

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/BeansDeployer.java Sun Nov 15 01:50:33 2009
@@ -33,6 +33,7 @@
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.Decorator;
 import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.ObserverMethod;
 import javax.enterprise.inject.spi.Producer;
 import javax.interceptor.Interceptor;
 
@@ -48,6 +49,7 @@
 import org.apache.webbeans.decorator.WebBeansDecorator;
 import org.apache.webbeans.deployment.StereoTypeManager;
 import org.apache.webbeans.deployment.StereoTypeModel;
+import org.apache.webbeans.event.ObserverMethodImpl;
 import org.apache.webbeans.exception.WebBeansConfigurationException;
 import org.apache.webbeans.exception.WebBeansDeploymentException;
 import org.apache.webbeans.exception.inject.InconsistentSpecializationException;
@@ -654,7 +656,8 @@
             Set<ProducerFieldBean<?>> producerFields = managedBeanCreator.defineProducerFields();           
             managedBeanCreator.defineInjectedFields();
             managedBeanCreator.defineInjectedMethods();
-            managedBeanCreator.defineObserverMethods();
+            
+            Set<ObserverMethod<?>> observerMethods = managedBeanCreator.defineObserverMethods();
                                     
             //Fires ProcessInjectionTarget
             ProcessInjectionTargetImpl<T> processInjectionTargetEvent = WebBeansUtil.fireProcessInjectionTargetEvent(managedBean);            
@@ -695,6 +698,15 @@
                 producerEvent.setProducerSet(false);
             }
 
+            Map<ObserverMethod<?>,AnnotatedMethod<?>> observerMethodsMap = new HashMap<ObserverMethod<?>, AnnotatedMethod<?>>(); 
+            for(ObserverMethod<?> observerMethod : observerMethods)
+            {
+                ObserverMethodImpl<?> impl = (ObserverMethodImpl<?>)observerMethod;
+                AnnotatedMethod<?> method = AnnotatedElementFactory.newAnnotatedMethod(impl.getObserverMethod(), impl.getBeanClass());
+                
+                observerMethodsMap.put(observerMethod, method);
+            }
+            
             //Fires ProcessManagedBean
             ProcessBeanImpl<T> processBeanEvent = new GProcessManagedBean(managedBean,annotatedType);            
             BeanManagerImpl.getManager().fireEvent(processBeanEvent, new Annotation[0]);
@@ -705,6 +717,9 @@
             //Fires ProcessProducerField
             WebBeansUtil.fireProcessProducerFieldBeanEvent(annotatedFields);
             
+            //Fire ObservableMethods
+            WebBeansUtil.fireProcessObservableMethodBeanEvent(observerMethodsMap);
+            
             //Set InjectionTarget that is used by the container to inject dependencies!
             if(managedBeanCreator.isInjectionTargetSet())
             {

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/config/DefinitionUtil.java Sun Nov 15 01:50:33 2009
@@ -39,6 +39,7 @@
 import javax.enterprise.inject.spi.AnnotatedType;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.InjectionPoint;
+import javax.enterprise.inject.spi.ObserverMethod;
 import javax.enterprise.util.NonBinding;
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -1063,7 +1064,7 @@
         WebBeansDecoratorConfig.configureDecarotors(bean, object);
     }
 
-    public static <T> void defineObserverMethods(InjectionTargetBean<T> component, Class<T> clazz)
+    public static <T> Set<ObserverMethod<?>> defineObserverMethods(InjectionTargetBean<T> component, Class<T> clazz)
     {
         Asserts.assertNotNull(component, "component parameter can not be null");
         Asserts.nullCheckForClass(clazz);
@@ -1075,7 +1076,7 @@
         // From normal
         createObserverMethods(component, clazz, candidateMethods);
 
-        manager.addObservableComponentMethods(component);
+        return manager.addObservableComponentMethods(component);
 
     }
 

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java Sun Nov 15 01:50:33 2009
@@ -304,6 +304,7 @@
         this.notificationManager.fireEvent(event, bindings);
     }
     
+    @Deprecated
     public Object getInstanceByName(String name)
     {
         AbstractBean<?> component = null;
@@ -328,17 +329,20 @@
     }
     
     
+    @Deprecated
     public <T> T getInstanceToInject(InjectionPoint injectionPoint, CreationalContext<?> context)
     {
         return (T)getInjectableReference(injectionPoint, context);
     }
     
+    @Deprecated
     public Object getInstanceToInject(InjectionPoint injectionPoint)
     {        
         return getInstanceToInject(injectionPoint, null);
     }
 
     
+    @Deprecated
     public <T> T getInstanceByType(Class<T> type, Annotation... bindingTypes)
     {
         ResolutionUtil.getInstanceByTypeConditions(bindingTypes);
@@ -349,7 +353,7 @@
         return (T)getInstance(set.iterator().next());
     }
 
-    
+    @Deprecated
     public <T> T getInstanceByType(TypeLiteral<T> type, Annotation... bindingTypes)
     {
         ResolutionUtil.getInstanceByTypeConditions(bindingTypes);
@@ -360,13 +364,13 @@
         return (T)getInstance(set.iterator().next());
     }
 
-    
+    @Deprecated
     public Set<Bean<?>> resolveByName(String name)
     {
         return this.injectionResolver.implResolveByName(name);
     }
 
-    
+    @Deprecated
     public Set<Bean<?>> resolveByType(Class<?> apiType, Annotation... bindingTypes)
     {
         ResolutionUtil.getInstanceByTypeConditions(bindingTypes);
@@ -374,7 +378,7 @@
         return this.injectionResolver.implResolveByType(apiType, bindingTypes);
     }
 
-    
+    @Deprecated
     public Set<Bean<?>> resolveByType(TypeLiteral<?> apiType, Annotation... bindingTypes)
     {
         ParameterizedType ptype = (ParameterizedType) apiType.getType();
@@ -406,9 +410,10 @@
     }
 
     
+    @Deprecated
     public <T> T getInstance(Bean<T> bean)
     {
-        return (T)getReference(bean, null, null);
+        return (T)getReference(bean, null, createCreationalContext(bean));
     }
     
     /**
@@ -681,12 +686,6 @@
         AbstractBean<Object> beanInstance = (AbstractBean<Object>)bean;
         CreationalContext<Object> creationalContext = (CreationalContext<Object>)ctx;
         
-        //Always create reference if not exist
-        if(creationalContext == null)
-        {
-            creationalContext = createCreationalContext(beanInstance);
-        }
-        
         //Set creational context
         beanInstance.setCreationalContext(creationalContext);
         
@@ -926,9 +925,9 @@
     }
 
     @Override
-    public <T> Set<ObserverMethod<? super T>> resolveObserverMethods( T event, Annotation... qualifiers ) {
-        // TODO Auto-generated method stub
-        return null;
+    public <T> Set<ObserverMethod<? super T>> resolveObserverMethods( T event, Annotation... qualifiers ) 
+    {
+        return this.notificationManager.resolveObservers(event, qualifiers);
     }
 
     @Override

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ContextFactory.java Sun Nov 15 01:50:33 2009
@@ -73,6 +73,16 @@
     {
         throw new UnsupportedOperationException();
     }
+    
+    public static void initializeThreadLocals()
+    {
+        requestContext.remove();
+        sessionContext.remove();
+        applicationContext.remove();
+        conversationContext.remove();
+        dependentContext.remove();
+        singletonContext.remove();
+    }
 
     /**
      * Initialize requext context with the given request object.

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/context/ConversationContext.java Sun Nov 15 01:50:33 2009
@@ -27,7 +27,7 @@
     /*
      * Constructor
      */
-    protected ConversationContext()
+    public ConversationContext()
     {
         super(ContextTypes.CONVERSATION);
     }

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationImpl.java Sun Nov 15 01:50:33 2009
@@ -18,11 +18,14 @@
 
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.context.ConversationContext;
+import org.apache.webbeans.logger.WebBeansLogger;
 import org.apache.webbeans.util.Asserts;
 import org.apache.webbeans.util.StringUtil;
 
 public class ConversationImpl implements Conversation
 {
+    private static final WebBeansLogger logger = WebBeansLogger.getLogger(ConversationImpl.class);
+    
     private String id;
 
     private boolean isTransient = true;
@@ -47,25 +50,53 @@
 
     public void begin()
     {
-        this.isTransient = false;
-        this.id = StringUtil.generateUUIDStringWithoutDash();
-
-        ConversationManager.getInstance().addConversationContext(this, (ConversationContext) BeanManagerImpl.getManager().getContext(ConversationScoped.class));
+        if(this.isTransient)
+        {
+            this.isTransient = false;
+            this.id = StringUtil.generateUUIDStringWithoutDash();
+            
+            ConversationManager manager = ConversationManager.getInstance();
+            
+            try
+            {
+                manager.addConversationContext(this, (ConversationContext) BeanManagerImpl.getManager().getContext(ConversationScoped.class));
+                
+            }catch(Exception e)
+            {
+                //TCK tests
+                manager.addConversationContext(this, new ConversationContext());
+            }            
+        }
+        else
+        {
+            logger.warn("Conversation with cid=" + id + " is already began!");
+        }
     }
 
     public void begin(String id)
     {
-        this.isTransient = false;
-        this.id = id;
+        if(this.isTransient)
+        {
+            this.isTransient = false;
+            this.id = id;
 
-        ConversationManager.getInstance().addConversationContext(this, (ConversationContext) BeanManagerImpl.getManager().getContext(ConversationScoped.class));
+            ConversationManager.getInstance().addConversationContext(this, (ConversationContext) BeanManagerImpl.getManager().getContext(ConversationScoped.class));            
+        }
     }
 
     public void end()
     {
-        this.isTransient = true;
-        
-        ConversationManager.getInstance().removeConversation(this);
+        if(!this.isTransient)
+        {
+            this.isTransient = true;
+            
+            ConversationManager.getInstance().removeConversation(this);            
+        }
+    }
+    
+    public void setTransient(boolean value)
+    {
+        this.isTransient = value;
     }
 
     public String getId()

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java Sun Nov 15 01:50:33 2009
@@ -27,18 +27,30 @@
 import org.apache.webbeans.context.ConversationContext;
 import org.apache.webbeans.util.Asserts;
 
+/**
+ * Manager for the conversations.
+ * Each conversation is related with conversation id and session id.
+ * 
+ * @version $Rev$ $Date$
+ *
+ */
 public class ConversationManager
 {
-    private Map<Conversation, ConversationContext> conversations = null;
+    /**Current conversations*/
+    private Map<Conversation, ConversationContext> conversations = new ConcurrentHashMap<Conversation, ConversationContext>();
 
+    /**
+     * Creates new conversation maanger
+     */
     public ConversationManager()
     {
-        if(conversations == null)
-        {
-            conversations = new ConcurrentHashMap<Conversation, ConversationContext>();   
-        }
+        
     }
 
+    /**
+     * Gets conversation manager instance.
+     * @return conversation manager
+     */
     public static ConversationManager getInstance()
     {
         ConversationManager manager = (ConversationManager) WebBeansFinder.getSingletonInstance(WebBeansFinder.SINGLETON_CONVERSATION_MANAGER);
@@ -46,11 +58,21 @@
         return manager;
     }
 
+    /**
+     * Adds new conversation context.
+     * @param conversation new conversation
+     * @param context new context
+     */
     public void addConversationContext(Conversation conversation, ConversationContext context)
     {
         conversations.put(conversation, context);
     }
 
+    /**
+     * Remove given conversation.
+     * @param conversation conversation instance
+     * @return context
+     */
     public ConversationContext removeConversation(Conversation conversation)
     {
         Asserts.assertNotNull(conversation, "conversation can not be null");
@@ -58,6 +80,11 @@
         return conversations.remove(conversation);
     }
 
+    /**
+     * Gets conversation's context instance.
+     * @param conversation conversation instance
+     * @return conversation related context
+     */
     public ConversationContext getConversationContext(Conversation conversation)
     {
         Asserts.assertNotNull(conversation, "conversation can not be null");
@@ -65,9 +92,16 @@
         return conversations.get(conversation);
     }
 
-    public Conversation getConversation(String conversationId)
+    /**
+     * Gets conversation with id and session id.
+     * @param conversationId conversation id
+     * @param sessionId session id
+     * @return conversation
+     */
+    public Conversation getConversation(String conversationId, String sessionId)
     {
         Asserts.assertNotNull(conversationId, "conversationId parameter can not be null");
+        Asserts.assertNotNull(sessionId,"sessionId parameter can not be null");
 
         ConversationImpl conv = null;
         Set<Conversation> set = conversations.keySet();
@@ -76,7 +110,7 @@
         while (it.hasNext())
         {
             conv = (ConversationImpl) it.next();
-            if (conv.getId().equals(conversationId))
+            if (conv.getId().equals(conversationId) && conv.getSessionId().equals(sessionId))
             {
                 return conv;
             }
@@ -86,6 +120,10 @@
 
     }
 
+    /**
+     * Destroy conversations with given session id.
+     * @param sessionId session id
+     */
     public void destroyConversationContextWithSessionId(String sessionId)
     {
         Asserts.assertNotNull(sessionId, "sessionId parameter can not be null");
@@ -104,16 +142,24 @@
         }
     }
 
-    public Conversation createNewConversation()
+    /**
+     * Creates new conversation instance.
+     * @return new conversation instance
+     */
+    public Conversation createNewConversationInstance()
     {
-        Conversation conversation = getCurrentConversation();
+        Conversation conversation = getConversationInstance();
 
         return conversation;
 
     }
 
+    /**
+     * Gets conversation instance from conversation bean.
+     * @return conversation instance
+     */
     @SuppressWarnings("unchecked")
-    public Conversation getCurrentConversation()
+    public Conversation getConversationInstance()
     {
 
         Bean<Conversation> bean = (Bean<Conversation>)BeanManagerImpl.getManager().resolveByType(Conversation.class, new DefaultLiteral()).iterator().next();
@@ -122,6 +168,9 @@
         return conversation;
     }
 
+    /**
+     * Destroy unactive conversations.
+     */
     public void destroyWithRespectToTimout()
     {
         ConversationImpl conv = null;
@@ -143,6 +192,9 @@
         }
     }
 
+    /**
+     * Destroys all conversations
+     */
     public void destroyAllConversations()
     {
         if (conversations != null)

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/conversation/ConversationManager.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/NotificationManager.java Sun Nov 15 01:50:33 2009
@@ -121,7 +121,7 @@
         removeObserver(observer, typeLiteral.getRawType(), annotations);
     }
 
-    public <T> Set<ObserverMethod<T>> resolveObservers(T event, Annotation... eventQualifiers)
+    public <T> Set<ObserverMethod<? super T>> resolveObservers(T event, Annotation... eventQualifiers)
     {
         EventUtil.checkEventBindings(eventQualifiers);
 
@@ -130,16 +130,16 @@
         Class<T> eventType = (Class<T>) event.getClass();
         // EventUtil.checkEventType(eventType);
 
-        Set<ObserverMethod<T>> observers = filterByType(eventType);
+        Set<ObserverMethod<? super T>> observers = filterByType(eventType);
 
         observers = filterByQualifiers(observers, qualifiers);
 
         return observers;
     }
 
-    private <T> Set<ObserverMethod<T>> filterByType(Class<T> eventType)
+    private <T> Set<ObserverMethod<? super T>> filterByType(Class<T> eventType)
     {
-        Set<ObserverMethod<T>> matching = new HashSet<ObserverMethod<T>>();
+        Set<ObserverMethod<? super T>> matching = new HashSet<ObserverMethod<? super T>>();
 
         Set<Type> types = new HashSet<Type>();
         ClassUtil.setTypeHierarchy(types, eventType);
@@ -169,16 +169,16 @@
      * filter out all {@code ObserverMethod}s which do not fit the given
      * qualifiers.
      */
-    private <T> Set<ObserverMethod<T>> filterByQualifiers(Set<ObserverMethod<T>> observers, Set<Annotation> eventQualifiers)
+    private <T> Set<ObserverMethod<? super T>> filterByQualifiers(Set<ObserverMethod<? super T>> observers, Set<Annotation> eventQualifiers)
     {
         if (eventQualifiers.size() == 1 && eventQualifiers.iterator().next() instanceof Any)
         {
             return observers;
         }
 
-        Set<ObserverMethod<T>> matching = new HashSet<ObserverMethod<T>>();
+        Set<ObserverMethod<? super T>> matching = new HashSet<ObserverMethod<? super T>>();
 
-        search: for (ObserverMethod<T> ob : observers)
+        search: for (ObserverMethod<? super T> ob : observers)
         {
             Set<Annotation> qualifiers = ob.getObservedQualifiers();
 
@@ -205,9 +205,9 @@
     {
         Transaction transaction = transactionService.getTransaction();
 
-        Set<ObserverMethod<Object>> observers = resolveObservers(event, qualifiers);
+        Set<ObserverMethod<? super Object>> observers = resolveObservers(event, qualifiers);
 
-        for (ObserverMethod<Object> observer : observers)
+        for (ObserverMethod<? super Object> observer : observers)
         {
             try
             {
@@ -264,10 +264,11 @@
         }
     }
 
-    public <T> void addObservableComponentMethods(InjectionTargetBean<?> component)
+    public <T> Set<ObserverMethod<?>> addObservableComponentMethods(InjectionTargetBean<?> component)
     {
         Asserts.assertNotNull(component, "component parameter can not be null");
         Set<Method> observableMethods = component.getObservableMethods();
+        Set<ObserverMethod<?>> observerMethods = new HashSet<ObserverMethod<?>>();
 
         for (Method observableMethod : observableMethods)
         {
@@ -285,8 +286,11 @@
             Class<T> clazz = (Class<T>) AnnotationUtil.getMethodFirstParameterTypeClazzWithAnnotation(observableMethod, Observes.class);
 
             addObserver(observer, clazz);
+            
+            observerMethods.add(observer);
         }
 
+        return observerMethods;
     }
 
     /**

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/event/ObserverMethodImpl.java Sun Nov 15 01:50:33 2009
@@ -316,5 +316,10 @@
     {
         return phase;
     }
+    
+    public Method getObserverMethod()
+    {
+        return this.observerMethod;
+    }
 
 }
\ No newline at end of file

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/intercept/WebBeansInterceptorConfig.java Sun Nov 15 01:50:33 2009
@@ -63,7 +63,7 @@
      */
     public static <T> void configureInterceptorClass(AbstractBean<T> delegate, Annotation[] interceptorBindingTypes)
     {
-        logger.info("Configuring the Web Beans Interceptor Class : " + delegate.getReturnType().getName() + " started");
+        logger.info("Configuring the Web Beans Interceptor Class : " + delegate.getReturnType() + " started");
 
         WebBeansInterceptor<T> interceptor = new WebBeansInterceptor<T>(delegate);
 

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/lifecycle/EnterpriseLifeCycle.java Sun Nov 15 01:50:33 2009
@@ -25,6 +25,7 @@
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletRequestEvent;
 import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpSessionEvent;
 import javax.servlet.jsp.JspApplicationContext;
 import javax.servlet.jsp.JspFactory;
@@ -110,7 +111,24 @@
     public void requestStarted(ServletRequestEvent event)
     {
         logger.debug("Starting a new request : " + event.getServletRequest().getRemoteAddr());
+        
+        ContextFactory.initializeThreadLocals();
+        
+        //Init Request Context
         ContextFactory.initRequestContext(event);
+        
+        //Session Conext Must be Active
+        Object request = event.getServletRequest();
+        if(request instanceof HttpServletRequest)
+        {
+            HttpServletRequest httpRequest = (HttpServletRequest)request;
+            HttpSession currentSession = httpRequest.getSession(false);
+            if(currentSession == null)
+            {
+                //To activate session context
+                httpRequest.getSession();
+            }
+        }
     }
 
     public void requestEnded(ServletRequestEvent event)

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/discovery/AfterBeanDiscoveryImpl.java Sun Nov 15 01:50:33 2009
@@ -13,11 +13,17 @@
  */
 package org.apache.webbeans.portable.events.discovery;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.enterprise.context.spi.Context;
 import javax.enterprise.inject.spi.AfterBeanDiscovery;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.ObserverMethod;
 
+import org.apache.webbeans.container.BeanManagerImpl;
+import org.apache.webbeans.container.activity.ActivityManager;
+
 /**
  * Event that is fired by the container after it discovers beans.
  * 
@@ -26,15 +32,22 @@
  */
 public class AfterBeanDiscoveryImpl implements AfterBeanDiscovery
 {
-
+    private BeanManagerImpl beanManager = null;
+    
+    private List<Throwable> errors = new ArrayList<Throwable>();
+    
+    public AfterBeanDiscoveryImpl()
+    {
+        this.beanManager = ActivityManager.getInstance().getCurrentActivity();
+    }
+    
     /**
      * {@inheritDoc}
      */
     @Override
     public void addBean(Bean<?> bean)
     {
-        // TODO Auto-generated method stub
-        
+        this.beanManager.addBean(bean);
     }
 
     /**
@@ -43,7 +56,7 @@
     @Override
     public void addContext(Context context)
     {
-        // TODO Auto-generated method stub
+        this.beanManager.addContext(context);
         
     }
 
@@ -53,8 +66,7 @@
     @Override
     public void addDefinitionError(Throwable t)
     {
-        // TODO Auto-generated method stub
-        
+        this.errors.add(t);
     }
 
     /**
@@ -63,8 +75,8 @@
     @Override
     public void addObserverMethod(ObserverMethod<?> observerMethod)
     {
-        // TODO Auto-generated method stub
-        
+        //TODO 
+        System.out.println("Not implemented Yet!");
     }
 
 }
\ No newline at end of file

Added: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java?rev=836311&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java Sun Nov 15 01:50:33 2009
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You 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.apache.webbeans.portable.events.generics;
+
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.ObserverMethod;
+
+import org.apache.webbeans.portable.events.ProcessObserverMethodImpl;
+
+@SuppressWarnings("unchecked")
+public class GProcessObservableMethod extends ProcessObserverMethodImpl
+{
+
+    public GProcessObservableMethod(AnnotatedMethod<?> annotatedMethod, ObserverMethod<?> observerMethod)
+    {
+        super(annotatedMethod, observerMethod);
+    }
+
+    
+    
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/portable/events/generics/GProcessObservableMethod.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java Sun Nov 15 01:50:33 2009
@@ -61,6 +61,7 @@
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.InjectionPoint;
 import javax.enterprise.inject.spi.Interceptor;
+import javax.enterprise.inject.spi.ObserverMethod;
 import javax.enterprise.util.TypeLiteral;
 import javax.inject.Inject;
 import javax.inject.Named;
@@ -124,6 +125,7 @@
 import org.apache.webbeans.portable.creation.InjectionTargetProducer;
 import org.apache.webbeans.portable.events.generics.GProcessAnnotatedType;
 import org.apache.webbeans.portable.events.generics.GProcessInjectionTarget;
+import org.apache.webbeans.portable.events.generics.GProcessObservableMethod;
 import org.apache.webbeans.portable.events.generics.GProcessProducer;
 import org.apache.webbeans.portable.events.generics.GProcessProducerField;
 import org.apache.webbeans.portable.events.generics.GProcessProducerMethod;
@@ -706,6 +708,7 @@
         managerComponent.setImplScopeType(new DependentScopeLiteral());
         managerComponent.setType(new StandardLiteral());
         managerComponent.addQualifier(new DefaultLiteral());
+        managerComponent.addQualifier(new AnyLiteral());
         managerComponent.addApiType(BeanManager.class);
         managerComponent.addApiType(Object.class);
 
@@ -751,6 +754,7 @@
         conversationComp.setImplScopeType(new RequestedScopeLiteral());
         conversationComp.setType(new StandardLiteral());
         conversationComp.addQualifier(new DefaultLiteral());
+        conversationComp.addQualifier(new AnyLiteral());
         conversationComp.setName("javax.context.conversation");
 
         return conversationComp;
@@ -2033,6 +2037,20 @@
         }                
     }
     
+    public static void fireProcessObservableMethodBeanEvent(Map<ObserverMethod<?>,AnnotatedMethod<?>> annotatedMethods)
+    {
+        for(ObserverMethod<?> observableMethod : annotatedMethods.keySet())
+        {
+            AnnotatedMethod<?> annotatedMethod = annotatedMethods.get(observableMethod);                
+            
+            GProcessObservableMethod event = new GProcessObservableMethod(annotatedMethod, observableMethod);
+
+            //Fires ProcessProducer
+            BeanManagerImpl.getManager().fireEvent(event, new Annotation[0]);
+        }                
+    }
+    
+    
     public static void fireProcessProducerFieldBeanEvent(Map<ProducerFieldBean<?>,AnnotatedField<?>> annotatedFields)
     {
         for(ProducerFieldBean<?> bean : annotatedFields.keySet())

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/log4j.properties?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/log4j.properties (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/resources/log4j.properties Sun Nov 15 01:50:33 2009
@@ -32,8 +32,8 @@
 #log4j.appender.file.layout.ConversionPattern=<%d> %-5p [%c] : %m%n
 
 
-log4j.rootLogger=debug,stdout
+log4j.rootLogger=info,stdout
 
 
 ### Main project logger to info
-log4j.logger.org.apache.webbeans=debug
\ No newline at end of file
+log4j.logger.org.apache.webbeans=info
\ No newline at end of file

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/literals/InstanceTypeLiteralBean.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/literals/InstanceTypeLiteralBean.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/literals/InstanceTypeLiteralBean.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/literals/InstanceTypeLiteralBean.java Sun Nov 15 01:50:33 2009
@@ -27,9 +27,9 @@
     
     public static class StringOrder implements IOrder<String>{};
     
-    public static class IntegerOrder extends StringOrder{};
+    public static class IntegerOrder implements IOrder<Integer>{};
 
-    private @Inject Instance<IOrder<String>> instance;
+    private @Inject Instance<IOrder<?>> instance;
     
     public Instance<?> produce(int type)
     {

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/specializes/logger/LoggerSpecializationTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/specializes/logger/LoggerSpecializationTest.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/specializes/logger/LoggerSpecializationTest.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/specializes/logger/LoggerSpecializationTest.java Sun Nov 15 01:50:33 2009
@@ -56,7 +56,7 @@
         defineManagedBean(MockNotSpecializedLogger.class);        
         
         Bean<SpecializedInjector> bean = defineManagedBean(SpecializedInjector.class);
-        Object instance = getManager().getReference(bean, SpecializedInjector.class, null);
+        Object instance = getManager().getReference(bean, SpecializedInjector.class, getManager().createCreationalContext(bean));
         
         Assert.assertTrue(instance instanceof SpecializedInjector);
         SpecializedInjector injector = (SpecializedInjector)instance;
@@ -94,7 +94,7 @@
         WebBeansUtil.configureSpecializations(MockSpecializedLogger.class);
         
         Bean<SpecializedInjector> bean = defineManagedBean(SpecializedInjector.class);
-        Object instance = getManager().getReference(bean, SpecializedInjector.class, null);
+        Object instance = getManager().getReference(bean, SpecializedInjector.class, getManager().createCreationalContext(bean));
         
         Assert.assertTrue(instance instanceof SpecializedInjector);
         SpecializedInjector injector = (SpecializedInjector)instance;

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypeLiteralTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypeLiteralTest.java?rev=836311&r1=836310&r2=836311&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypeLiteralTest.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypeLiteralTest.java Sun Nov 15 01:50:33 2009
@@ -25,13 +25,13 @@
 import org.apache.webbeans.common.TestContext;
 import org.apache.webbeans.container.BeanManagerImpl;
 import org.apache.webbeans.test.component.literals.InstanceTypeLiteralBean;
-import org.apache.webbeans.test.component.literals.InstanceTypeLiteralBean.IOrder;
 import org.apache.webbeans.test.component.literals.InstanceTypeLiteralBean.IntegerOrder;
 import org.apache.webbeans.test.component.literals.InstanceTypeLiteralBean.StringOrder;
 import org.apache.webbeans.util.WebBeansUtil;
 import org.junit.Before;
 import org.junit.Test;
 
+@SuppressWarnings("unchecked")
 public class TypeLiteralTest extends TestContext
 {
     public TypeLiteralTest()
@@ -72,7 +72,7 @@
         defineManagedBean(IntegerOrder.class);
         Bean<InstanceTypeLiteralBean> bean =  defineManagedBean(InstanceTypeLiteralBean.class);
         
-        Object object = getManager().getReference(bean, InstanceTypeLiteralBean.class,null );        
+        Object object = getManager().getReference(bean, InstanceTypeLiteralBean.class,getManager().createCreationalContext(bean) );        
         Assert.assertTrue(object instanceof InstanceTypeLiteralBean);
         InstanceTypeLiteralBean beaninstance = (InstanceTypeLiteralBean)object;
         Object produce = beaninstance.produce(0);
@@ -85,6 +85,6 @@
         Assert.assertTrue(produce instanceof Instance);
 
         Instance<StringOrder> order2 = (Instance<StringOrder>)produce;
-        Assert.assertTrue(order.get() instanceof StringOrder);
+        Assert.assertTrue(order2.get() instanceof StringOrder);
     }
 }



Mime
View raw message