[webbeans-commits] Webbeans SVN: r319 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts.
webbeans-commits at lists.jboss.org
webbeans-commits at lists.jboss.org
Mon Nov 17 23:15:09 EST 2008
Author: pete.muir at jboss.org
Date: 2008-11-17 23:15:08 -0500 (Mon, 17 Nov 2008)
New Revision: 319
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java
Log:
javadoc
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java 2008-11-18 03:54:10 UTC (rev 318)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/contexts/AbstractContext.java 2008-11-18 04:15:08 UTC (rev 319)
@@ -8,8 +8,16 @@
import javax.webbeans.manager.Context;
import javax.webbeans.manager.Manager;
+/**
+ * Base for the Context implementations
+ *
+ * @author Nicklas Karlsson
+ * @author Pete Muir
+ *
+ */
public abstract class AbstractContext implements Context
{
+
private Class<? extends Annotation> scopeType;
public AbstractContext(Class<? extends Annotation> scopeType)
@@ -17,6 +25,15 @@
this.scopeType = scopeType;
}
+ /**
+ * Get the bean if it exists in the contexts.
+ *
+ * @param create If true, a new instance of the bean will be created if none
+ * exists
+ *
+ * @throws ContextNotActiveException if the context is not active
+ *
+ */
public <T> T get(Bean<T> bean, boolean create)
{
if (!isActive())
@@ -39,25 +56,36 @@
return instance;
}
+ /**
+ * Get the scope the context is for
+ */
public Class<? extends Annotation> getScopeType()
{
return scopeType;
}
+ /**
+ * Return true if the context is active
+ */
public boolean isActive()
{
return getActive().get();
}
+ /**
+ * Set the context active, internal API for WBRI
+ */
public void setActive(boolean active) {
getActive().set(active);
}
+ // TODO Do we need this
private <T> void destroy(Manager manager, Bean<T> bean)
{
bean.destroy(getBeanMap().get(bean));
}
+ // TODO Do we need this
public void destroy(Manager manager)
{
for (Bean<? extends Object> bean : getBeanMap().keySet())
More information about the weld-commits
mailing list