org.jboss.weld.context
Class AbstractMapContext

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

public abstract class AbstractMapContext
extends AbstractContext

Base for the Context implementations. Delegates calls to the abstract getBeanStorage 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
AbstractMapContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
          Constructor
 
Method Summary
 void cleanup()
           
 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  org.jboss.weld.context.api.BeanStore getBeanStore()
          A method that returns the actual bean store implementation
protected static
<T> javax.enterprise.context.spi.Contextual<T>
getContextual(java.lang.String id)
           
protected static java.lang.String getId(javax.enterprise.context.spi.Contextual<?> contextual)
           
protected abstract  boolean isCreationLockRequired()
          If Context need to inhibit concurrent instance creation then true, else false.
 
Methods inherited from class org.jboss.weld.context.AbstractContext
getScope, isActive, setActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMapContext

public AbstractMapContext(java.lang.Class<? extends java.lang.annotation.Annotation> scopeType)
Constructor

Parameters:
scopeType - The scope type
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.

Parameters:
create - If true, a new instance of the bean will be created if none exists
Returns:
An instance of the bean
Throws:
javax.enterprise.context.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)

destroy

public void destroy()
Destroys the context


getBeanStore

protected abstract org.jboss.weld.context.api.BeanStore getBeanStore()
A method that returns the actual bean store implementation

Returns:
The bean store

isCreationLockRequired

protected abstract boolean isCreationLockRequired()
If Context need to inhibit concurrent instance creation then true, else false.

Returns:
need lock

cleanup

public void cleanup()
Overrides:
cleanup in class AbstractContext

getContextual

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

getId

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


Copyright © 2008-2009 Seam Framework. All Rights Reserved.