org.jboss.webbeans.context
Class AbstractBeanMapContext

java.lang.Object
  extended by org.jboss.webbeans.context.AbstractContext
      extended by org.jboss.webbeans.context.AbstractBeanMapContext
All Implemented Interfaces:
Context
Direct Known Subclasses:
ApplicationContext, BasicContext, SessionContext

public abstract class AbstractBeanMapContext
extends AbstractContext

Base for the Context implementations. Delegates calls to the abstract getBeanMap and getActive to allow for different implementations (storage types and ThreadLocal vs. shared)

Author:
Nicklas Karlsson, Pete Muir
See Also:
org.jboss.webbeans.contexts.SharedContext, BasicContext

Constructor Summary
AbstractBeanMapContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
          Constructor
 
Method Summary
 void destroy()
          Destroys the context
<T> T
get(Contextual<T> contextual)
           
<T> T
get(Contextual<T> contextual, CreationalContext<T> creationalContext)
          Get the bean if it exists in the contexts.
protected abstract  BeanMap getBeanMap()
          A method that should return the actual bean map implementation
 
Methods inherited from class org.jboss.webbeans.context.AbstractContext
getActive, getScopeType, isActive, setActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBeanMapContext

public AbstractBeanMapContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Constructor

Parameters:
scopeType - The scope type
Method Detail

get

public <T> T get(Contextual<T> contextual,
                 CreationalContext<T> creationalContext)
Get the bean if it exists in the contexts.

Parameters:
create - If true, a new instance of the bean will be created if none exists
Returns:
An instance of the bean
Throws:
ContextNotActiveException - if the context is not active
See Also:
javax.context.Context#get(Bean, boolean)

get

public <T> T get(Contextual<T> contextual)

destroy

public void destroy()
Destroys the context


getBeanMap

protected abstract BeanMap getBeanMap()
A method that should return the actual bean map implementation

Returns:
The actual bean map


Copyright © 2008-2009. All Rights Reserved.