org.jboss.webbeans.context
Class DependentContext

java.lang.Object
  extended by org.jboss.webbeans.context.AbstractContext
      extended by org.jboss.webbeans.context.DependentContext
All Implemented Interfaces:
Context, Service

public class DependentContext
extends AbstractContext
implements Service

The dependent context

Author:
Nicklas Karlsson

Constructor Summary
DependentContext()
          Constructor
 
Method Summary
<T> T
get(Contextual<T> contextual)
          Return an existing instance of a contextual type or create a new instance of a contextual type
<T> T
get(Contextual<T> contextual, CreationalContext<T> creationalContext)
          Overridden method always creating a new instance
static DependentContext instance()
           
 void setActive(boolean active)
          Set the context active, internal API for WBRI
 void startCollectingDependents(DependentStorageRequest dependentStorageRequest)
          Starts collecting dependent instances created by placing in the dependent instances store specified in the request.
 void stopCollectingDependents(DependentStorageRequest dependentStorageRequest)
          Stops collecting dependent instances created.
 java.lang.String toString()
           
 
Methods inherited from class org.jboss.webbeans.context.AbstractContext
getActive, getScopeType, isActive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DependentContext

public DependentContext()
Constructor

Method Detail

instance

public static DependentContext instance()

get

public <T> T get(Contextual<T> contextual,
                 CreationalContext<T> creationalContext)
Overridden method always creating a new instance

Specified by:
get in interface Context
Type Parameters:
T - the type of contextual type
Parameters:
contextual - The bean to create
create - Should a new one be created
Returns:
the contextual instance, or null if no creational context is given and an instance does not exist in the context

get

public <T> T get(Contextual<T> contextual)
Description copied from interface: Context
Return an existing instance of a contextual type or create a new instance of a contextual type

Specified by:
get in interface Context
Type Parameters:
T - the type of the contextual type
Parameters:
contextual - the contextual type
Returns:
the contextual instance, or null if an instance does not exist in the context

toString

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

setActive

public void setActive(boolean active)
Description copied from class: AbstractContext
Set the context active, internal API for WBRI

Overrides:
setActive in class AbstractContext
Parameters:
active - The new state

startCollectingDependents

public void startCollectingDependents(DependentStorageRequest dependentStorageRequest)
Starts collecting dependent instances created by placing in the dependent instances store specified in the request. The request is only honored if there are no current request present.

Parameters:
dependentStorageRequest - The storage request

stopCollectingDependents

public void stopCollectingDependents(DependentStorageRequest dependentStorageRequest)
Stops collecting dependent instances created. The request is only honored if the request passed is the same that was used for starting the collection

Parameters:
dependentStorageRequest - The storage request


Copyright © 2011. All Rights Reserved.