Package org.jboss.weld.contexts
Class ForwardingContextual<T>
- java.lang.Object
-
- org.jboss.weld.contexts.ForwardingContextual<T>
-
- All Implemented Interfaces:
Contextual<T>
public abstract class ForwardingContextual<T> extends Object implements Contextual<T>
-
-
Constructor Summary
Constructors Constructor Description ForwardingContextual()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tcreate(CreationalContext<T> creationalContext)Create a new instance of the contextual type.protected abstract Contextual<T>delegate()voiddestroy(T instance, CreationalContext<T> creationalContext)Destroy an instance of the contextual type.booleanequals(Object obj)inthashCode()StringtoString()
-
-
-
Method Detail
-
delegate
protected abstract Contextual<T> delegate()
-
create
public T create(CreationalContext<T> creationalContext)
Description copied from interface:ContextualCreate a new instance of the contextual type. Instances should use the givenCreationalContextwhen obtaining contextual references to inject, in order to ensure that any dependent objects are associated with the contextual instance that is being created. An implementation may callCreationalContext.push(Object)between instantiation and injection to help the container minimize the use of client proxy objects.- Specified by:
createin interfaceContextual<T>- Parameters:
creationalContext- the context in which this instance is being created- Returns:
- the contextual instance
-
destroy
public void destroy(T instance, CreationalContext<T> creationalContext)
Description copied from interface:ContextualDestroy an instance of the contextual type. Implementations should callCreationalContext.release()to allow the container to destroy dependent objects of the contextual instance.- Specified by:
destroyin interfaceContextual<T>- Parameters:
instance- the contextual instance to destroycreationalContext- the context in which this instance was created
-
-