|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.coherence.config.builder.NamedEventInterceptorBuilder
public class NamedEventInterceptorBuilder
An NamedEventInterceptorBuilder facilitates the construction of a NamedEventInterceptor
, which wraps an EventInterceptor
. The wrapped EventInterceptor will be constructed based on its instance / class-scheme XML declaration, honoring any init-params defined.
The construction of a NamedEventInterceptor allows metadata associated with the EventInterceptor to be held. This metadata is used to determine eligibility against EventDispatcher
s and for registration purposes.
In addition to XML being used as input in defining an EventInterceptor and its metadata the presence of an annotation (Interceptor
) can also contribute. This annotation can define the identifier for this interceptor, the event types to subscribe to and whether to be placed first in the chain of EventInterceptors (Interceptor.Order.HIGH
.
NamedEventInterceptor objects also use class level generic type definitions as input for configuration. The generic type definition allows EventInterceptor implementations to restrict on event types by narrowing the type definition within the reference to the EventInterceptor interface. For example, the following interceptor restricts to only accept transfer events:
class MyInterceptor
implements EventInterceptor<TransferEvent>
{
public void onEvent(TransferEvent event);
}
The precedence, in highest order first reading left to right, for configuration is as follows:
XML -> Annotation -> Generic Type Bounds
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.tangosol.coherence.config.builder.ParameterizedBuilder |
---|
ParameterizedBuilder.ReflectionSupport |
Constructor Summary | |
---|---|
NamedEventInterceptorBuilder() |
Method Summary | |
---|---|
ParameterizedBuilder |
getCustomBuilder() Obtains the custom ParameterizedBuilder . |
java.lang.String |
getName() Get the logical name / identifier for this EventInterceptor . |
Interceptor.Order |
getOrder() Return the Interceptor.Order of this interceptor. |
RegistrationBehavior |
getRegistrationBehavior() Returns the behavior upon duplicate registration. |
boolean |
isFirst() Whether this EventInterceptor should be head of the stack. |
com.tangosol.net.events.internal.NamedEventInterceptor |
realize(com.tangosol.config.expression.ParameterResolver resolver, java.lang.ClassLoader loader, ParameterList listParameters) Realizes (creates if necessary) an instance of a object of type T, using the provided ParameterResolver to resolve values any referenced Parameter s. |
void |
setCustomBuilder(ParameterizedBuilder bldr) Sets the ParameterizedBuilder to be used as the alternate builder. |
NamedEventInterceptorBuilder |
setName(java.lang.String sName) Set the logical name / identifier for this EventInterceptor . |
NamedEventInterceptorBuilder |
setOrder(Interceptor.Order order) Set the EventInterceptor 's order (HIGH || LOW), hence whether it should be at the start of the chain of interceptors. |
NamedEventInterceptorBuilder |
setRegistrationBehavior(RegistrationBehavior behavior) Specifies the behavior upon duplicate registration. |
java.lang.String |
toString() |
Constructor Detail |
---|
public NamedEventInterceptorBuilder()
Method Detail |
---|
public com.tangosol.net.events.internal.NamedEventInterceptor realize(com.tangosol.config.expression.ParameterResolver resolver, java.lang.ClassLoader loader, ParameterList listParameters)
ParameterResolver
to resolve values any referenced Parameter
s.realize
in interface ParameterizedBuilder
resolver
- the ParameterResolver
for resolving named Parameter
sloader
- the ClassLoader
for loading any necessary classes and if null
the ClassLoader
used to load the builder will be used insteadlistParameters
- an optional ParameterList
(may be null
) to be used for realizing the instance, eg: used as constructor parameterspublic ParameterizedBuilder getCustomBuilder()
ParameterizedBuilder
.getCustomBuilder
in interface BuilderCustomization
ParameterizedBuilder
public void setCustomBuilder(ParameterizedBuilder bldr)
ParameterizedBuilder
to be used as the alternate builder.setCustomBuilder
in interface BuilderCustomization
bldr
- the ParameterizedBuilderpublic java.lang.String getName()
EventInterceptor
.EventInterceptor
@Injectable
public NamedEventInterceptorBuilder setName(java.lang.String sName)
EventInterceptor
.sName
- logical name / identifier for this EventInterceptor
.this
builderpublic boolean isFirst()
EventInterceptor
should be head of the stack.EventInterceptor
should be head of the stackpublic Interceptor.Order getOrder()
Interceptor.Order
of this interceptor.Interceptor.Order
of this interceptor
@Injectable
public NamedEventInterceptorBuilder setOrder(Interceptor.Order order)
EventInterceptor
's order (HIGH || LOW), hence whether it should be at the start of the chain of interceptors.order
- whether this EventInterceptor
should be head of the stack based on the values Interceptor.Order.HIGH
or Interceptor.Order.LOW
this
builderpublic RegistrationBehavior getRegistrationBehavior()
@Injectable
public NamedEventInterceptorBuilder setRegistrationBehavior(RegistrationBehavior behavior)
behavior
- the behavior upon duplicate registrationthis
builderpublic java.lang.String toString()
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |