org.jboss.weld.context
Class AbstractContext

java.lang.Object
  extended by org.jboss.weld.context.AbstractContext
All Implemented Interfaces:
javax.enterprise.context.spi.Context
Direct Known Subclasses:
AbstractManagedContext, AbstractSharedContext

public abstract class AbstractContext
extends Object
implements javax.enterprise.context.spi.Context

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

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

Constructor Summary
AbstractContext(boolean multithreaded)
          Constructor
 
Method Summary
 void cleanup()
           
protected  void destroy()
          Destroys the context
<T> T
get(javax.enterprise.context.spi.Contextual<T> contextual)
           
<T> T
get(javax.enterprise.context.spi.Contextual<T> contextual, javax.enterprise.context.spi.CreationalContext<T> creationalContext)
          Get the bean if it exists in the contexts.
protected abstract  BeanStore getBeanStore()
          A method that returns the actual bean store implementation
protected static
<T> javax.enterprise.context.spi.Contextual<T>
getContextual(String id)
           
protected  String getId(javax.enterprise.context.spi.Contextual<?> contextual)
           
protected  org.jboss.weld.bootstrap.api.ServiceRegistry getServiceRegistry()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.enterprise.context.spi.Context
getScope, isActive
 

Constructor Detail

AbstractContext

public AbstractContext(boolean multithreaded)
Constructor

Method Detail

get

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

Specified by:
get in interface javax.enterprise.context.spi.Context
Returns:
An instance of the bean
Throws:
ContextNotActiveException - if the context is not active
See Also:
javax.enterprise.context.spi.Context#get(BaseBean, boolean)

get

public <T> T get(javax.enterprise.context.spi.Contextual<T> contextual)
Specified by:
get in interface javax.enterprise.context.spi.Context

destroy

protected void destroy()
Destroys the context


getBeanStore

protected abstract BeanStore getBeanStore()
A method that returns the actual bean store implementation

Returns:
The bean store

cleanup

public void cleanup()

getContextual

protected static <T> javax.enterprise.context.spi.Contextual<T> getContextual(String id)

getId

protected String getId(javax.enterprise.context.spi.Contextual<?> contextual)

getServiceRegistry

protected org.jboss.weld.bootstrap.api.ServiceRegistry getServiceRegistry()


Copyright © 2013 Seam Framework. All Rights Reserved.