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 InvocationDispatcher
delegate
-
Constructor Summary
Constructors Constructor Description SynchronisingInvocationDispatcherWrapper(InvocationDispatcher dispatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(Expectation expectation)
void
describeMismatch(Invocation invocation, org.hamcrest.Description description)
void
describeTo(org.hamcrest.Description description)
java.lang.Object
dispatch(Invocation invocation)
boolean
isSatisfied()
StateMachine
newStateMachine(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:
newStateMachine
in interfaceInvocationDispatcher
-
add
public void add(Expectation expectation)
- Specified by:
add
in interfaceExpectationCollector
- Specified by:
add
in interfaceInvocationDispatcher
-
describeTo
public void describeTo(org.hamcrest.Description description)
- Specified by:
describeTo
in interfaceInvocationDispatcher
- Specified by:
describeTo
in interfaceorg.hamcrest.SelfDescribing
-
describeMismatch
public void describeMismatch(Invocation invocation, org.hamcrest.Description description)
- Specified by:
describeMismatch
in interfaceInvocationDispatcher
-
isSatisfied
public boolean isSatisfied()
- Specified by:
isSatisfied
in interfaceInvocationDispatcher
-
dispatch
public java.lang.Object dispatch(Invocation invocation) throws java.lang.Throwable
- Specified by:
dispatch
in interfaceInvocationDispatcher
- Throws:
java.lang.Throwable
-
-