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 the Context must be defined as Contextual. This interface defines the creating and destroying of the webbeans instances that are contained in the its Context instance.

Version:
$Rev: 815435 $ $Date: 2009-09-15 20:18:44 +0200 (Di, 15. Sep 2009) $
See Also:
Context

Method Summary
 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 instance
context - creational context


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.