|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface InterceptorBindingType
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.
<?xml version="1.0" encoding="UTF-8"?><interceptor-binding xmlns="http://www.w3.org/2001/XMLSchema" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><ejb-name>*</ejb-name><interceptor-class>INTERCEPTOR</interceptor-class></interceptor-binding>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.
<?xml version="1.0" encoding="UTF-8"?><interceptor-binding xmlns="http://www.w3.org/2001/XMLSchema" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><ejb-name>EJBNAME</ejb-name><interceptor-class>INTERCEPTOR</interceptor-class></interceptor-binding>This style is used to refer to interceptors associated with the specified enterprise bean(class-level interceptors). 3.
<?xml version="1.0" encoding="UTF-8"?><interceptor-binding xmlns="http://www.w3.org/2001/XMLSchema" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><ejb-name>EJBNAME</ejb-name><interceptor-class>INTERCEPTOR</interceptor-class><method><method-name>METHOD</method-name></method></interceptor-binding>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.
<?xml version="1.0" encoding="UTF-8"?><interceptor-binding xmlns="http://www.w3.org/2001/XMLSchema" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><ejb-name>EJBNAME</ejb-name><interceptor-class>INTERCEPTOR</interceptor-class><method><method-name>METHOD</method-name><method-params><method-param>PARAM-1</method-param><method-param>PARAM-2</method-param>
...<method-param>PARAM-N</method-param></method-params></method></interceptor-binding>
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[][]).
Java class for interceptor-bindingType complex type.
The following schema fragment specifies the expected content contained within this class.
<complexType name="interceptor-bindingType">
<complexContent>
<restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
<sequence>
<element name="description" type="{http://java.sun.com/xml/ns/javaee}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
<element name="ejb-name" type="{http://java.sun.com/xml/ns/javaee}string"/>
<choice>
<element name="interceptor-class" type="{http://java.sun.com/xml/ns/javaee}fully-qualified-classType" maxOccurs="unbounded" minOccurs="0"/>
<element name="interceptor-order" type="{http://java.sun.com/xml/ns/javaee}interceptor-orderType"/>
</choice>
<element name="exclude-default-interceptors" type="{http://java.sun.com/xml/ns/javaee}true-falseType" minOccurs="0"/>
<element name="exclude-class-interceptors" type="{http://java.sun.com/xml/ns/javaee}true-falseType" minOccurs="0"/>
<element name="method" type="{http://java.sun.com/xml/ns/javaee}named-methodType" minOccurs="0"/>
</sequence>
<attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
</restriction>
</complexContent>
</complexType>
| Method Summary | |
|---|---|
DescriptionType[] |
getDescription()
|
DescriptionType |
getDescription(int idx)
|
int |
getDescriptionLength()
|
String |
getEjbName()
Gets the value of the ejbName property. |
TrueFalseType |
getExcludeClassInterceptors()
Gets the value of the excludeClassInterceptors property. |
TrueFalseType |
getExcludeDefaultInterceptors()
Gets the value of the excludeDefaultInterceptors property. |
String |
getId()
Gets the value of the id property. |
FullyQualifiedClassType[] |
getInterceptorClass()
|
FullyQualifiedClassType |
getInterceptorClass(int idx)
|
int |
getInterceptorClassLength()
|
InterceptorOrderType |
getInterceptorOrder()
Gets the value of the interceptorOrder property. |
NamedMethodType |
getMethod()
Gets the value of the method property. |
void |
setDescription(DescriptionType[] values)
|
DescriptionType |
setDescription(int idx,
DescriptionType value)
|
void |
setEjbName(String value)
Sets the value of the ejbName property. |
void |
setExcludeClassInterceptors(TrueFalseType value)
Sets the value of the excludeClassInterceptors property. |
void |
setExcludeDefaultInterceptors(TrueFalseType value)
Sets the value of the excludeDefaultInterceptors property. |
void |
setId(String value)
Sets the value of the id property. |
void |
setInterceptorClass(FullyQualifiedClassType[] values)
|
FullyQualifiedClassType |
setInterceptorClass(int idx,
FullyQualifiedClassType value)
|
void |
setInterceptorOrder(InterceptorOrderType value)
Sets the value of the interceptorOrder property. |
void |
setMethod(NamedMethodType value)
Sets the value of the method property. |
| Method Detail |
|---|
DescriptionType[] getDescription()
DescriptionTypeDescriptionType getDescription(int idx)
DescriptionTypeint getDescriptionLength()
void setDescription(DescriptionType[] values)
values - allowed objects are
DescriptionType
DescriptionType setDescription(int idx,
DescriptionType value)
value - allowed object is
DescriptionTypeString getEjbName()
Stringvoid setEjbName(String value)
value - allowed object is
StringFullyQualifiedClassType[] getInterceptorClass()
FullyQualifiedClassTypeFullyQualifiedClassType getInterceptorClass(int idx)
FullyQualifiedClassTypeint getInterceptorClassLength()
void setInterceptorClass(FullyQualifiedClassType[] values)
values - allowed objects are
FullyQualifiedClassType
FullyQualifiedClassType setInterceptorClass(int idx,
FullyQualifiedClassType value)
value - allowed object is
FullyQualifiedClassTypeInterceptorOrderType getInterceptorOrder()
InterceptorOrderTypevoid setInterceptorOrder(InterceptorOrderType value)
value - allowed object is
InterceptorOrderTypeTrueFalseType getExcludeDefaultInterceptors()
TrueFalseTypevoid setExcludeDefaultInterceptors(TrueFalseType value)
value - allowed object is
TrueFalseTypeTrueFalseType getExcludeClassInterceptors()
TrueFalseTypevoid setExcludeClassInterceptors(TrueFalseType value)
value - allowed object is
TrueFalseTypeNamedMethodType getMethod()
NamedMethodTypevoid setMethod(NamedMethodType value)
value - allowed object is
NamedMethodTypeString getId()
Stringvoid setId(String value)
value - allowed object is
String
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||