Package org.jmock.lib.concurrent
Class SynchronisingInvocationDispatcherWrapper
- java.lang.Object
-
- org.jmock.lib.concurrent.SynchronisingInvocationDispatcherWrapper
-
- All Implemented Interfaces:
org.hamcrest.SelfDescribing,ExpectationCollector,InvocationDispatcher
public class SynchronisingInvocationDispatcherWrapper extends java.lang.Object implements InvocationDispatcher
I synchronise my delegate. This serialises access to the internal Expectation and StateMachine collections.
-
-
Field Summary
Fields Modifier and Type Field Description private InvocationDispatcherdelegate
-
Constructor Summary
Constructors Constructor Description SynchronisingInvocationDispatcherWrapper(InvocationDispatcher dispatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Expectation expectation)voiddescribeMismatch(Invocation invocation, org.hamcrest.Description description)voiddescribeTo(org.hamcrest.Description description)java.lang.Objectdispatch(Invocation invocation)booleanisSatisfied()StateMachinenewStateMachine(java.lang.String name)
-
-
-
Field Detail
-
delegate
private final InvocationDispatcher delegate
-
-
Constructor Detail
-
SynchronisingInvocationDispatcherWrapper
public SynchronisingInvocationDispatcherWrapper(InvocationDispatcher dispatcher)
-
-
Method Detail
-
newStateMachine
public StateMachine newStateMachine(java.lang.String name)
- Specified by:
newStateMachinein interfaceInvocationDispatcher
-
add
public void add(Expectation expectation)
- Specified by:
addin interfaceExpectationCollector- Specified by:
addin interfaceInvocationDispatcher
-
describeTo
public void describeTo(org.hamcrest.Description description)
- Specified by:
describeToin interfaceInvocationDispatcher- Specified by:
describeToin interfaceorg.hamcrest.SelfDescribing
-
describeMismatch
public void describeMismatch(Invocation invocation, org.hamcrest.Description description)
- Specified by:
describeMismatchin interfaceInvocationDispatcher
-
isSatisfied
public boolean isSatisfied()
- Specified by:
isSatisfiedin interfaceInvocationDispatcher
-
dispatch
public java.lang.Object dispatch(Invocation invocation) throws java.lang.Throwable
- Specified by:
dispatchin interfaceInvocationDispatcher- Throws:
java.lang.Throwable
-
-