com.caucho.config.scope
Class AbstractScopeContext

java.lang.Object
  extended by com.caucho.config.scope.AbstractScopeContext
All Implemented Interfaces:
Context
Direct Known Subclasses:
ApplicationContext, ConversationContext, RequestContext, SessionScopeImpl, SingletonScope, TransactionScope

@Module
public abstract class AbstractScopeContext
extends java.lang.Object
implements Context

Context for a named EL bean scope


Field Summary
static L10N L
           
 
Constructor Summary
AbstractScopeContext()
           
 
Method Summary
 void closeContext()
           
protected
<T> T
create(Contextual<T> bean, CreationalContext<T> env)
           
protected abstract  ContextContainer createContextContainer()
           
<T> T
get(Contextual<T> bean)
          Returns the current instance, if it exists.
<T> T
get(Contextual<T> bean, CreationalContext<T> creationalContext)
          Internal SPI method to create a new instance of a bean, when given a creational context.
protected abstract  ContextContainer getContextContainer()
           
abstract  java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
          Returns the scope annotation type.
abstract  boolean isActive()
          Returns true if the scope is currently active.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

L

public static final L10N L
Constructor Detail

AbstractScopeContext

public AbstractScopeContext()
Method Detail

isActive

public abstract boolean isActive()
Returns true if the scope is currently active.

Specified by:
isActive in interface Context

getScope

public abstract java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
Returns the scope annotation type.

Specified by:
getScope in interface Context

get

public <T> T get(Contextual<T> bean)
Returns the current instance, if it exists.

Specified by:
get in interface Context
Parameters:
bean - the Bean type to be created
Returns:
an injected and initialized instance

get

public <T> T get(Contextual<T> bean,
                 CreationalContext<T> creationalContext)
Description copied from interface: Context
Internal SPI method to create a new instance of a bean, when given a creational context. This method is needed to handle circular initialization of bean instances. If the bean already exists in the creationalContext, return the existing bean.

Specified by:
get in interface Context
Parameters:
bean - the Bean type to be created
creationalContext - - temporary context used for managing circular references
Returns:
the bean instance

create

protected <T> T create(Contextual<T> bean,
                       CreationalContext<T> env)

getContextContainer

protected abstract ContextContainer getContextContainer()

createContextContainer

protected abstract ContextContainer createContextContainer()

closeContext

public void closeContext()