com.caucho.config.scope
Class ErrorContext

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

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

Context to wrap errors.


Constructor Summary
ErrorContext(java.lang.RuntimeException exn, Context context)
           
 
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.
 Context getContext()
           
 java.lang.RuntimeException getException()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorContext

public ErrorContext(java.lang.RuntimeException exn,
                    Context context)
Method Detail

getException

public java.lang.RuntimeException getException()

getContext

public Context getContext()

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