com.caucho.server.webbeans
Class TransactionScope

java.lang.Object
  extended by com.caucho.config.scope.AbstractScopeContext
      extended by com.caucho.server.webbeans.TransactionScope
All Implemented Interfaces:
Context

@Module
public class TransactionScope
extends AbstractScopeContext

Scope based on the current transaction.


Constructor Summary
TransactionScope()
           
 
Method Summary
protected  ContextContainer createContextContainer()
           
<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  ContextContainer getContextContainer()
           
 java.lang.Class<? extends java.lang.annotation.Annotation> getScope()
          Returns the scope annotation type.
 boolean isActive()
          Returns true if the scope is currently active.
 
Methods inherited from class com.caucho.config.scope.AbstractScopeContext
closeContext, create, get
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionScope

public TransactionScope()
Method Detail

isActive

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

Specified by:
isActive in interface Context
Specified by:
isActive in class AbstractScopeContext

getScope

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

Specified by:
getScope in interface Context
Specified by:
getScope in class AbstractScopeContext

getContextContainer

protected ContextContainer getContextContainer()
Specified by:
getContextContainer in class AbstractScopeContext

createContextContainer

protected ContextContainer createContextContainer()
Specified by:
createContextContainer in class AbstractScopeContext

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
Overrides:
get in class AbstractScopeContext
Parameters:
bean - the Bean type to be created
creationalContext - - temporary context used for managing circular references
Returns:
the bean instance