Module org.refcodes.controlflow
Package org.refcodes.controlflow
Class AbstractInterceptorComposite<I extends Interceptor<?,?>>
java.lang.Object
org.refcodes.controlflow.AbstractInterceptorComposite<I>
- Type Parameters:
I
- The type ofInterceptor
to be managed.
- All Implemented Interfaces:
Interceptable<I>
,InterceptorComposite<I>
- Direct Known Subclasses:
AssemblyInterceptorComposite
,DelegationInterceptorComposite
public abstract class AbstractInterceptorComposite<I extends Interceptor<?,?>>
extends Object
implements InterceptorComposite<I>
The
AbstractInterceptorComposite
provides base functionality for
working with Interceptor
instances.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addInterceptor
(I aInterceptor) Adds the givenInterceptor
instance.boolean
hasInterceptor
(I aInterceptor) Tests whether the givenInterceptor
instance has been added.boolean
removeInterceptor
(I aInterceptor) Removes theInterceptor
instance.
-
Field Details
-
_interceptors
-
-
Constructor Details
-
AbstractInterceptorComposite
public AbstractInterceptorComposite()
-
-
Method Details
-
hasInterceptor
Tests whether the givenInterceptor
instance has been added.- Specified by:
hasInterceptor
in interfaceInterceptable<I extends Interceptor<?,
?>> - Parameters:
aInterceptor
- TheInterceptor
instance for which to test if it has been added.- Returns:
- True if the given
Interceptor
instance has been added already.
-
addInterceptor
Adds the givenInterceptor
instance. TheInterceptor
instance itself acts as the handle which is used when removing the givenInterceptor
instance later.- Specified by:
addInterceptor
in interfaceInterceptable<I extends Interceptor<?,
?>> - Parameters:
aInterceptor
- TheInterceptor
instance which is to be added.- Returns:
- True if the
Interceptor
instance has been added successfully. If theInterceptor
instance has already been added, false is returned.
-
removeInterceptor
Removes theInterceptor
instance. In case theInterceptor
instance has not been added before, then false is returned.- Specified by:
removeInterceptor
in interfaceInterceptable<I extends Interceptor<?,
?>> - Parameters:
aInterceptor
- TheInterceptor
instance which is to be removed.- Returns:
- True if the
Interceptor
instance has been removed successfully. If there was none suchInterceptor
instance or if theInterceptor
instance has already been removed, then false is returned.
-