You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by st...@apache.org on 2009/04/24 15:58:43 UTC
svn commit: r768313 -
/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ChildActivityManager.java
Author: struberg
Date: Fri Apr 24 13:58:43 2009
New Revision: 768313
URL: http://svn.apache.org/viewvc?rev=768313&view=rev
Log:
OWB-68 implement getContext
Modified:
incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ChildActivityManager.java
Modified: incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ChildActivityManager.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ChildActivityManager.java?rev=768313&r1=768312&r2=768313&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ChildActivityManager.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/ChildActivityManager.java Fri Apr 24 13:58:43 2009
@@ -20,6 +20,7 @@
import java.util.Set;
import javax.context.Context;
+import javax.context.ContextNotActiveException;
import javax.context.CreationalContext;
import javax.event.Observer;
import javax.inject.TypeLiteral;
@@ -116,8 +117,21 @@
/** {@inheritDoc} */
public Context getContext(Class<? extends Annotation> scopeType)
{
- // TODO Auto-generated method stub
- return null;
+ Context ctx = null;
+ //X TODO not 100% sure if this is ok. 'double-definition' case isn't defined by the spec yet!
+ try
+ {
+ ctx = self.getContext(scopeType);
+ }
+ catch (ContextNotActiveException cna)
+ {
+ //dumdidum nothing found, so let's try it in the parent context
+ }
+ if (ctx == null)
+ {
+ ctx = parent.getContext(scopeType);
+ }
+ return ctx;
}
/** {@inheritDoc} */