org.apache.webbeans.intercept
Interface InterceptorData

All Known Implementing Classes:
InterceptorDataImpl

public interface InterceptorData

OWB general interceptor API contract. There are two types of interceptor definition in the OWB Container. These are;

If the bean is an EJB component, EJB container is responsible for calling the EJB related interceptors, otherwise OWB container takes the responsibility. In the both cases, OWB Container is responsible for calling web beans related inteceptors.

Version:
$Rev: 1001913 $ $Date: 2010-09-27 23:14:48 +0200 (Mo, 27 Sep 2010) $

Method Summary
 Object createNewInstance(Object ownerInstance, CreationalContextImpl<?> creationalContext)
          Creates and returns a new interceptor instance.
 Method getAroundInvoke()
          Gets AroundInvoke annotated method if exist, returns null otherwise.
 Method getAroundTimeout()
          Gets AroundTimeout annotated method if exist, returns null otherwise.
 Method getInterceptorBindingMethod()
          Gets the interceptor annotated method.
 Class<?> getInterceptorClass()
          if this interceptor data is defined by interceptor, null otherwise.
 Method getInterceptorMethod()
          Gets interceptor method that this interceptor data contains.
 Method getPostActivate()
          Gets javax.ejb.PostActivate annotated method if exist return null otherwise.
 Method getPostConstruct()
          Gets PostConstruct annotated method if exist return null otherwise.
 Method getPreDestroy()
          Gets the PreDestroy annotated method if exist, returns null otherwise.
 Method getPrePassivate()
          Gets javax.ejb.PrePassivate annotated method if exist return null otherwise.
 javax.enterprise.inject.spi.Interceptor<?> getWebBeansInterceptor()
          Gets JSR 299 style interceptor bean that is responsible for producing interceptor instance that defines interceptor method.
 boolean isDefinedInInterceptorClass()
          Checks whether the interceptor is defined at the interceptor class.
 boolean isDefinedInMethod()
          Checks the interceptor is defined at the method level.
 boolean isDefinedWithWebBeansInterceptor()
          Checks whether interceptor is configured with webbeans interceptor definition or not.
 boolean isLifecycleInterceptor()
          Returns true if lifecycle interceptor method false otherwise.
 void setDefinedInInterceptorClass(boolean definedInInterceptorClass)
          Sets the source of the interceptor.
 void setDefinedInMethod(boolean definedInMethod)
          Sets true if interceptor is defined at the method, false ow.
 void setInterceptorBindingMethod(Method annotatedMethod)
          Sets the interceptor annotated method.
 void setInterceptorClass(Class<?> clazz)
          sets interceptor class.
 void setInterceptorMethod(Method interceptorMethod, Class<? extends Annotation> interceptorType)
          Sets the interceptor method.
 void setWebBeansInterceptor(javax.enterprise.inject.spi.Interceptor<?> webBeansInterceptor)
          Sets JSR 299 style interceptor.
 

Method Detail

getPostConstruct

Method getPostConstruct()
Gets PostConstruct annotated method if exist return null otherwise.

Returns:
post-construct method

getPostActivate

Method getPostActivate()
Gets javax.ejb.PostActivate annotated method if exist return null otherwise.

Returns:
post-activate method

getPreDestroy

Method getPreDestroy()
Gets the PreDestroy annotated method if exist, returns null otherwise.

Returns:
pre-destroy method

getPrePassivate

Method getPrePassivate()
Gets javax.ejb.PrePassivate annotated method if exist return null otherwise.

Returns:
pre-passivate method

getAroundInvoke

Method getAroundInvoke()
Gets AroundInvoke annotated method if exist, returns null otherwise.

Returns:
around invoke method

getAroundTimeout

Method getAroundTimeout()
Gets AroundTimeout annotated method if exist, returns null otherwise.

Returns:
around timeout method

getInterceptorMethod

Method getInterceptorMethod()
Gets interceptor method that this interceptor data contains. It is one of the post construct, pre-destroy or around-invoke.

Returns:
interceptor method.

setInterceptorMethod

void setInterceptorMethod(Method interceptorMethod,
                          Class<? extends Annotation> interceptorType)
Sets the interceptor method.

Annotation is in

Parameters:
interceptorMethod - interceptor method
interceptorType - interceptor annotation class

setDefinedInInterceptorClass

void setDefinedInInterceptorClass(boolean definedInInterceptorClass)
Sets the source of the interceptor.

Interceptor is defined by the bean itself or defined by the interceptor class.

Parameters:
definedInInterceptorClass - defined in interceptor class

isDefinedInMethod

boolean isDefinedInMethod()
Checks the interceptor is defined at the method level.

Returns:
inteceptor defined in method

setDefinedInMethod

void setDefinedInMethod(boolean definedInMethod)
Sets true if interceptor is defined at the method, false ow.

Parameters:
definedInMethod - defined in method flag

getInterceptorBindingMethod

Method getInterceptorBindingMethod()
Gets the interceptor annotated method.

Returns:
the method

setInterceptorBindingMethod

void setInterceptorBindingMethod(Method annotatedMethod)
Sets the interceptor annotated method.

Parameters:
annotatedMethod - interceptor annotated method.

isDefinedInInterceptorClass

boolean isDefinedInInterceptorClass()
Checks whether the interceptor is defined at the interceptor class.

Returns:
true if inteceptor is defined at the interceptor class

isDefinedWithWebBeansInterceptor

boolean isDefinedWithWebBeansInterceptor()
Checks whether interceptor is configured with webbeans interceptor definition or not.

Returns:
true if interceptor is configured with webbeans interceptor definition

setWebBeansInterceptor

void setWebBeansInterceptor(javax.enterprise.inject.spi.Interceptor<?> webBeansInterceptor)
Sets JSR 299 style interceptor.

Parameters:
webBeansInterceptor - JSR 299 style interceptor

getWebBeansInterceptor

javax.enterprise.inject.spi.Interceptor<?> getWebBeansInterceptor()
Gets JSR 299 style interceptor bean that is responsible for producing interceptor instance that defines interceptor method.

Returns:
interceptor

isLifecycleInterceptor

boolean isLifecycleInterceptor()
Returns true if lifecycle interceptor method false otherwise.

Returns:
true if lifecycle interceptor method

createNewInstance

Object createNewInstance(Object ownerInstance,
                         CreationalContextImpl<?> creationalContext)
Creates and returns a new interceptor instance.

Parameters:
ownerInstance - The underlying instance the interceptor will be associated with, or any key to be used in its place
creationalContext - The context that will cache the created instance under the ownerInstance key
Returns:
creates a new interceptor instance

getInterceptorClass

Class<?> getInterceptorClass()
if this interceptor data is defined by interceptor, null otherwise.

Returns:
interceptor class

setInterceptorClass

void setInterceptorClass(Class<?> clazz)
sets interceptor class.

Parameters:
clazz - interceptor class


Copyright © 2008-2011 The Apache Software Foundation. All Rights Reserved.