org.apache.hivemind.impl
Class InterceptorStackImpl

java.lang.Object
  extended by org.apache.hivemind.impl.InterceptorStackImpl
All Implemented Interfaces:
InterceptorStack

public final class InterceptorStackImpl
extends java.lang.Object
implements InterceptorStack

Implementation of the InterceptorStack interface; localizes error checking in one place.

Author:
Howard Lewis Ship

Constructor Summary
InterceptorStackImpl(org.apache.commons.logging.Log log, ServicePoint sep, java.lang.Object root)
           
 
Method Summary
 java.lang.String getServiceExtensionPointId()
          Return the full id of the service extension point for which interceptors are being fabricated.
 java.lang.Class getServiceInterface()
          Returns the interface for the service; the same as ServicePoint.getServiceInterface().
 org.apache.commons.logging.Log getServiceLog()
          Returns the Log instance that should be used to log any information about the service, or the construction of the service.
 Module getServiceModule()
          Returns the module which contains the service extension point.
 java.lang.Object peek()
          Returns the current top object on the stack.
 void process(InterceptorDefinition interceptorDefinition)
          Invoked to process the next interceptor contribution; these should be processed in ascending order.
 void push(java.lang.Object interceptor)
          Pushes a new instance onto the stack.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InterceptorStackImpl

public InterceptorStackImpl(org.apache.commons.logging.Log log,
                            ServicePoint sep,
                            java.lang.Object root)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getServiceExtensionPointId

public java.lang.String getServiceExtensionPointId()
Description copied from interface: InterceptorStack
Return the full id of the service extension point for which interceptors are being fabricated.

Specified by:
getServiceExtensionPointId in interface InterceptorStack

getServiceModule

public Module getServiceModule()
Description copied from interface: InterceptorStack
Returns the module which contains the service extension point.

Specified by:
getServiceModule in interface InterceptorStack

getServiceInterface

public java.lang.Class getServiceInterface()
Description copied from interface: InterceptorStack
Returns the interface for the service; the same as ServicePoint.getServiceInterface().

Specified by:
getServiceInterface in interface InterceptorStack

peek

public java.lang.Object peek()
Description copied from interface: InterceptorStack
Returns the current top object on the stack.

Specified by:
peek in interface InterceptorStack

push

public void push(java.lang.Object interceptor)
Description copied from interface: InterceptorStack
Pushes a new instance onto the stack. The new instance should be a wrapper around InterceptorStack.peek(), and should implement the service extension point's interface.

The stack checks that the interceptor is not null, and that the interceptor implements the service interface.

Specified by:
push in interface InterceptorStack

process

public void process(InterceptorDefinition interceptorDefinition)
Invoked to process the next interceptor contribution; these should be processed in ascending order.


getServiceLog

public org.apache.commons.logging.Log getServiceLog()
Description copied from interface: InterceptorStack
Returns the Log instance that should be used to log any information about the service, or the construction of the service.

Specified by:
getServiceLog in interface InterceptorStack


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.