com.caucho.config.scope
Class DependentContext

java.lang.Object
  extended by com.caucho.config.scope.DependentContext
All Implemented Interfaces:
Context

@Module
public class DependentContext
extends java.lang.Object
implements Context

The dependent context.


Constructor Summary
DependentContext()
           
 
Method Summary
<T> T
get(Contextual<T> bean)
          Returns a instance of a bean, creating if the bean is not already available in the context.
<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.
 java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
          Returns the @ScopeType corresponding to the current context.
 boolean isActive()
          Returns true if the scope is currently active.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DependentContext

public DependentContext()
Method Detail

get

public <T> T get(Contextual<T> bean)
Description copied from interface: Context
Returns a instance of a bean, creating if the bean is not already available in the context.

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

getScope

public java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
Description copied from interface: Context
Returns the @ScopeType corresponding to the current context.

Specified by:
getScope in interface Context

isActive

public boolean isActive()
Description copied from interface: Context
Returns true if the scope is currently active.

Specified by:
isActive in interface Context

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object