org.apache.openejb.jee
Class InterceptorBinding

java.lang.Object
  extended by org.apache.openejb.jee.InterceptorBinding

public class InterceptorBinding
extends java.lang.Object

The interceptor-bindingType element describes the binding of interceptor classes to beans within the ejb-jar. It consists of :

- An optional description. - The name of an ejb within the ejb-jar or the wildcard value "*", which is used to define interceptors that are bound to all beans in the ejb-jar. - A list of interceptor classes that are bound to the contents of the ejb-name element or a specification of the total ordering over the interceptors defined for the given level and above. - An optional exclude-default-interceptors element. If set to true, specifies that default interceptors are not to be applied to a bean-class and/or business method. - An optional exclude-class-interceptors element. If set to true, specifies that class interceptors are not to be applied to a business method. - An optional set of method elements for describing the name/params of a method-level interceptor.

Interceptors bound to all classes using the wildcard syntax "*" are default interceptors for the components in the ejb-jar. In addition, interceptors may be bound at the level of the bean class (class-level interceptors) or business methods (method-level interceptors ).

The binding of interceptors to classes is additive. If interceptors are bound at the class-level and/or default-level as well as the method-level, both class-level and/or default-level as well as method-level will apply.

There are four possible styles of the interceptor element syntax :

1. * INTERCEPTOR

Specifying the ejb-name as the wildcard value "*" designates default interceptors (interceptors that apply to all session and message-driven beans contained in the ejb-jar).

2. EJBNAME INTERCEPTOR

This style is used to refer to interceptors associated with the specified enterprise bean(class-level interceptors).

3. EJBNAME INTERCEPTOR METHOD

This style is used to associate a method-level interceptor with the specified enterprise bean. If there are multiple methods with the same overloaded name, the element of this style refers to all the methods with the overloaded name. Method-level interceptors can only be associated with business methods of the bean class. Note that the wildcard value "*" cannot be used to specify method-level interceptors.

4. EJBNAME INTERCEPTOR METHOD PARAM-1 PARAM-2 ... PARAM-N

... This style is used to associate a method-level interceptor with the specified method of the specified enterprise bean. This style is used to refer to a single method within a set of methods with an overloaded name. The values PARAM-1 through PARAM-N are the fully-qualified Java types of the method's input parameters (if the method has no input arguments, the method-params element contains no method-param elements). Arrays are specified by the array element's type, followed by one or more pair of square brackets (e.g. int[][]).


Field Summary
protected  java.util.List<Text> description
           
protected  java.lang.String ejbName
           
protected  boolean excludeClassInterceptors
           
protected  boolean excludeDefaultInterceptors
           
protected  java.lang.String id
           
protected  java.util.List<java.lang.String> interceptorClass
           
protected  InterceptorOrder interceptorOrder
           
protected  NamedMethod method
           
 
Constructor Summary
InterceptorBinding()
           
InterceptorBinding(EnterpriseBean bean, Interceptor... interceptors)
           
InterceptorBinding(java.lang.String ejbName)
           
InterceptorBinding(java.lang.String ejbName, Interceptor... interceptors)
           
InterceptorBinding(java.lang.String ejbName, java.lang.String... interceptorClasses)
           
 
Method Summary
 java.util.List<Text> getDescription()
           
 java.lang.String getEjbName()
           
 boolean getExcludeClassInterceptors()
           
 boolean getExcludeDefaultInterceptors()
           
 java.lang.String getId()
           
 java.util.List<java.lang.String> getInterceptorClass()
           
 InterceptorOrder getInterceptorOrder()
           
 NamedMethod getMethod()
           
 void setEjbName(java.lang.String value)
           
 void setExcludeClassInterceptors(boolean value)
           
 void setExcludeDefaultInterceptors(boolean value)
           
 void setId(java.lang.String value)
           
 InterceptorOrder setInterceptorOrder(InterceptorOrder value)
           
 void setMethod(NamedMethod value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

protected java.util.List<Text> description

ejbName

protected java.lang.String ejbName

interceptorClass

protected java.util.List<java.lang.String> interceptorClass

interceptorOrder

protected InterceptorOrder interceptorOrder

excludeDefaultInterceptors

protected boolean excludeDefaultInterceptors

excludeClassInterceptors

protected boolean excludeClassInterceptors

method

protected NamedMethod method

id

protected java.lang.String id
Constructor Detail

InterceptorBinding

public InterceptorBinding()

InterceptorBinding

public InterceptorBinding(EnterpriseBean bean,
                          Interceptor... interceptors)

InterceptorBinding

public InterceptorBinding(java.lang.String ejbName,
                          Interceptor... interceptors)

InterceptorBinding

public InterceptorBinding(java.lang.String ejbName,
                          java.lang.String... interceptorClasses)

InterceptorBinding

public InterceptorBinding(java.lang.String ejbName)
Method Detail

getDescription

public java.util.List<Text> getDescription()

getEjbName

public java.lang.String getEjbName()

setEjbName

public void setEjbName(java.lang.String value)

getInterceptorClass

public java.util.List<java.lang.String> getInterceptorClass()

getInterceptorOrder

public InterceptorOrder getInterceptorOrder()

setInterceptorOrder

public InterceptorOrder setInterceptorOrder(InterceptorOrder value)

getExcludeDefaultInterceptors

public boolean getExcludeDefaultInterceptors()

setExcludeDefaultInterceptors

public void setExcludeDefaultInterceptors(boolean value)

getExcludeClassInterceptors

public boolean getExcludeClassInterceptors()

setExcludeClassInterceptors

public void setExcludeClassInterceptors(boolean value)

getMethod

public NamedMethod getMethod()

setMethod

public void setMethod(NamedMethod value)

getId

public java.lang.String getId()

setId

public void setId(java.lang.String value)


Copyright © 1999-2011 The Apache OpenEJB development community. All Rights Reserved.