org.apache.webbeans.intercept
Class InterceptorDataImpl

java.lang.Object
  extended by org.apache.webbeans.intercept.InterceptorDataImpl
All Implemented Interfaces:
InterceptorData

public class InterceptorDataImpl
extends Object
implements InterceptorData

Abstract implementation of the InterceptorData api contract.

Version:
$Rev: 1182847 $ $Date: 2011-10-13 15:31:37 +0200 (Do, 13 Okt 2011) $

Constructor Summary
InterceptorDataImpl(boolean isDefinedWithWebBeansInterceptor, WebBeansContext webBeansContext)
           
InterceptorDataImpl(boolean isDefinedWithWebBeansInterceptor, WebBeansDecoratorInterceptor decoratorInterceptor, WebBeansContext webBeansContext)
           
 
Method Summary
 Object createNewInstance(Object ownerInstance, CreationalContextImpl<?> ownerCreationalContext)
          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 setAroundInvoke(Method m)
           
 void setAroundTimeout(Method m)
           
 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 m, Class<? extends Annotation> annotation)
          Sets the interceptor method.
protected  void setPostActivate(Method m)
           
protected  void setPostConstruct(Method m)
           
protected  void setPreDestroy(Method m)
           
protected  void setPrePassivate(Method m)
           
 void setWebBeansInterceptor(javax.enterprise.inject.spi.Interceptor<?> webBeansInterceptor)
          Sets JSR 299 style interceptor.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InterceptorDataImpl

public InterceptorDataImpl(boolean isDefinedWithWebBeansInterceptor,
                           WebBeansContext webBeansContext)

InterceptorDataImpl

public InterceptorDataImpl(boolean isDefinedWithWebBeansInterceptor,
                           WebBeansDecoratorInterceptor decoratorInterceptor,
                           WebBeansContext webBeansContext)
Method Detail

getInterceptorClass

public Class<?> getInterceptorClass()
Description copied from interface: InterceptorData
if this interceptor data is defined by interceptor, null otherwise.

Specified by:
getInterceptorClass in interface InterceptorData
Returns:
interceptor class

setInterceptorClass

public void setInterceptorClass(Class<?> clazz)
Description copied from interface: InterceptorData
sets interceptor class.

Specified by:
setInterceptorClass in interface InterceptorData
Parameters:
clazz - interceptor class

setInterceptorMethod

public void setInterceptorMethod(Method m,
                                 Class<? extends Annotation> annotation)
Description copied from interface: InterceptorData
Sets the interceptor method.

Annotation is in

Specified by:
setInterceptorMethod in interface InterceptorData
Parameters:
m - interceptor method
annotation - interceptor annotation class

setAroundInvoke

public void setAroundInvoke(Method m)

setAroundTimeout

public void setAroundTimeout(Method m)

setPostConstruct

protected void setPostConstruct(Method m)

setPostActivate

protected void setPostActivate(Method m)

setPreDestroy

protected void setPreDestroy(Method m)

setPrePassivate

protected void setPrePassivate(Method m)

getPostConstruct

public Method getPostConstruct()
Description copied from interface: InterceptorData
Gets PostConstruct annotated method if exist return null otherwise.

Specified by:
getPostConstruct in interface InterceptorData
Returns:
post-construct method

getPostActivate

public Method getPostActivate()
Description copied from interface: InterceptorData
Gets javax.ejb.PostActivate annotated method if exist return null otherwise.

Specified by:
getPostActivate in interface InterceptorData
Returns:
post-activate method

getPreDestroy

public Method getPreDestroy()
Description copied from interface: InterceptorData
Gets the PreDestroy annotated method if exist, returns null otherwise.

Specified by:
getPreDestroy in interface InterceptorData
Returns:
pre-destroy method

getPrePassivate

public Method getPrePassivate()
Description copied from interface: InterceptorData
Gets javax.ejb.PrePassivate annotated method if exist return null otherwise.

Specified by:
getPrePassivate in interface InterceptorData
Returns:
pre-passivate method

getAroundInvoke

public Method getAroundInvoke()
Description copied from interface: InterceptorData
Gets AroundInvoke annotated method if exist, returns null otherwise.

Specified by:
getAroundInvoke in interface InterceptorData
Returns:
around invoke method

getAroundTimeout

public Method getAroundTimeout()
Description copied from interface: InterceptorData
Gets AroundTimeout annotated method if exist, returns null otherwise.

Specified by:
getAroundTimeout in interface InterceptorData
Returns:
around timeout method

isDefinedInInterceptorClass

public boolean isDefinedInInterceptorClass()
Description copied from interface: InterceptorData
Checks whether the interceptor is defined at the interceptor class.

Specified by:
isDefinedInInterceptorClass in interface InterceptorData
Returns:
true if inteceptor is defined at the interceptor class

setDefinedInInterceptorClass

public void setDefinedInInterceptorClass(boolean definedInInterceptorClass)
Description copied from interface: InterceptorData
Sets the source of the interceptor.

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

Specified by:
setDefinedInInterceptorClass in interface InterceptorData
Parameters:
definedInInterceptorClass - defined in interceptor class

isDefinedInMethod

public boolean isDefinedInMethod()
Description copied from interface: InterceptorData
Checks the interceptor is defined at the method level.

Specified by:
isDefinedInMethod in interface InterceptorData
Returns:
inteceptor defined in method

setDefinedInMethod

public void setDefinedInMethod(boolean definedInMethod)
Description copied from interface: InterceptorData
Sets true if interceptor is defined at the method, false ow.

Specified by:
setDefinedInMethod in interface InterceptorData
Parameters:
definedInMethod - defined in method flag

getInterceptorBindingMethod

public Method getInterceptorBindingMethod()
Description copied from interface: InterceptorData
Gets the interceptor annotated method.

Specified by:
getInterceptorBindingMethod in interface InterceptorData
Returns:
the method

setInterceptorBindingMethod

public void setInterceptorBindingMethod(Method annotatedMethod)
Description copied from interface: InterceptorData
Sets the interceptor annotated method.

Specified by:
setInterceptorBindingMethod in interface InterceptorData
Parameters:
annotatedMethod - interceptor annotated method.

isDefinedWithWebBeansInterceptor

public boolean isDefinedWithWebBeansInterceptor()
Description copied from interface: InterceptorData
Checks whether interceptor is configured with webbeans interceptor definition or not.

Specified by:
isDefinedWithWebBeansInterceptor in interface InterceptorData
Returns:
true if interceptor is configured with webbeans interceptor definition

getWebBeansInterceptor

public javax.enterprise.inject.spi.Interceptor<?> getWebBeansInterceptor()
Description copied from interface: InterceptorData
Gets JSR 299 style interceptor bean that is responsible for producing interceptor instance that defines interceptor method.

Specified by:
getWebBeansInterceptor in interface InterceptorData
Returns:
the webBeansInterceptor

setWebBeansInterceptor

public void setWebBeansInterceptor(javax.enterprise.inject.spi.Interceptor<?> webBeansInterceptor)
Description copied from interface: InterceptorData
Sets JSR 299 style interceptor.

Specified by:
setWebBeansInterceptor in interface InterceptorData
Parameters:
webBeansInterceptor - the webBeansInterceptor to set

getInterceptorMethod

public Method getInterceptorMethod()
Description copied from interface: InterceptorData
Gets interceptor method that this interceptor data contains. It is one of the post construct, pre-destroy or around-invoke.

Specified by:
getInterceptorMethod in interface InterceptorData
Returns:
interceptor method.

isLifecycleInterceptor

public boolean isLifecycleInterceptor()
Description copied from interface: InterceptorData
Returns true if lifecycle interceptor method false otherwise.

Specified by:
isLifecycleInterceptor in interface InterceptorData
Returns:
true if lifecycle interceptor method

createNewInstance

public Object createNewInstance(Object ownerInstance,
                                CreationalContextImpl<?> ownerCreationalContext)
Description copied from interface: InterceptorData
Creates and returns a new interceptor instance.

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

toString

public String toString()
Overrides:
toString in class Object


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