Class AbstractInterceptorComposite<I extends Interceptor<?,?>>

java.lang.Object
org.refcodes.controlflow.AbstractInterceptorComposite<I>
Type Parameters:
I - The type of Interceptor 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 Details

  • Constructor Details

    • AbstractInterceptorComposite

      public AbstractInterceptorComposite()
  • Method Details

    • hasInterceptor

      public boolean hasInterceptor(I aInterceptor)
      Tests whether the given Interceptor instance has been added.
      Specified by:
      hasInterceptor in interface Interceptable<I extends Interceptor<?,?>>
      Parameters:
      aInterceptor - The Interceptor instance for which to test if it has been added.
      Returns:
      True if the given Interceptor instance has been added already.
    • addInterceptor

      public boolean addInterceptor(I aInterceptor)
      Adds the given Interceptor instance. The Interceptor instance itself acts as the handle which is used when removing the given Interceptor instance later.
      Specified by:
      addInterceptor in interface Interceptable<I extends Interceptor<?,?>>
      Parameters:
      aInterceptor - The Interceptor instance which is to be added.
      Returns:
      True if the Interceptor instance has been added successfully. If the Interceptor instance has already been added, false is returned.
    • removeInterceptor

      public boolean removeInterceptor(I aInterceptor)
      Removes the Interceptor instance. In case the Interceptor instance has not been added before, then false is returned.
      Specified by:
      removeInterceptor in interface Interceptable<I extends Interceptor<?,?>>
      Parameters:
      aInterceptor - The Interceptor instance which is to be removed.
      Returns:
      True if the Interceptor instance has been removed successfully. If there was none such Interceptor instance or if the Interceptor instance has already been removed, then false is returned.