org.jmock.core
Class AbstractInvocationDispatcher

java.lang.Object
  extended by org.jmock.core.AbstractInvocationDispatcher
All Implemented Interfaces:
InvocationDispatcher, SelfDescribing, Verifiable
Direct Known Subclasses:
FIFOInvocationDispatcher, LIFOInvocationDispatcher

public abstract class AbstractInvocationDispatcher
extends Object
implements InvocationDispatcher


Field Summary
protected  Stub defaultStub
           
protected  List invokables
           
static String NO_EXPECTATIONS_MESSAGE
           
 
Constructor Summary
AbstractInvocationDispatcher()
           
 
Method Summary
 void add(Invokable invokable)
           
 void clear()
           
 StringBuffer describeTo(StringBuffer buffer)
          Appends the description of this object to the buffer.
 Object dispatch(Invocation invocation)
           
protected abstract  Iterator dispatchOrder(List invokablesList)
           
 void setDefaultStub(Stub defaultStub)
           
 void verify()
          Throw an AssertionFailedException if any expectations have not been met.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_EXPECTATIONS_MESSAGE

public static final String NO_EXPECTATIONS_MESSAGE
See Also:
Constant Field Values

invokables

protected List invokables

defaultStub

protected Stub defaultStub
Constructor Detail

AbstractInvocationDispatcher

public AbstractInvocationDispatcher()
Method Detail

setDefaultStub

public void setDefaultStub(Stub defaultStub)
Specified by:
setDefaultStub in interface InvocationDispatcher

add

public void add(Invokable invokable)
Specified by:
add in interface InvocationDispatcher

verify

public void verify()
Description copied from interface: Verifiable
Throw an AssertionFailedException if any expectations have not been met.

Specified by:
verify in interface Verifiable

clear

public void clear()
Specified by:
clear in interface InvocationDispatcher

describeTo

public StringBuffer describeTo(StringBuffer buffer)
Description copied from interface: SelfDescribing
Appends the description of this object to the buffer.

Specified by:
describeTo in interface SelfDescribing
Parameters:
buffer - The buffer that the description is appended to.
Returns:
The buffer passed to the invokedMethod.

dispatch

public Object dispatch(Invocation invocation)
                throws Throwable
Specified by:
dispatch in interface InvocationDispatcher
Throws:
Throwable

dispatchOrder

protected abstract Iterator dispatchOrder(List invokablesList)