Package javax.enterprise.context.spi
Interface Contextual<T>
-
- Type Parameters:
T
- type of the webbeans component
- All Known Subinterfaces:
Bean<T>
,Decorator<T>
,Interceptor<T>
public interface Contextual<T>
Each webbeans instance that is contained in theContext
must be defined asContextual
. This interface defines the creating and destroying of the webbeans instances that are contained in the itsContext
instance.- Version:
- $Rev: 815435 $ $Date: 2009-09-15 20:18:44 +0200 (Tue, 15 Sep 2009) $
- See Also:
Context
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
create(CreationalContext<T> context)
Creates and returns a new instance of the webbeans component.void
destroy(T instance, CreationalContext<T> context)
Destroys the instance.
-
-
-
Method Detail
-
create
T create(CreationalContext<T> context)
Creates and returns a new instance of the webbeans component.- Parameters:
context
- new creational context instance- Returns:
- the new instance of the webbeans component
- Throws:
CreationException
- if any exception occurs
-
destroy
void destroy(T instance, CreationalContext<T> context)
Destroys the instance. Any destroy logic is encapsulated in this method.- Parameters:
instance
- already created webbeans instancecontext
- creational context
-
-