public abstract class ACallContractor extends Object implements ICallContractor
The purpose of this is to ease the burden of concrete implementations.
To extend this in a concrete implementation is optional.
Modifier | Constructor and Description |
---|---|
protected |
ACallContractor()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected Long |
getCurrentThreadId() |
protected Object |
getSynchronizationObject() |
protected HashMap<Long,ICallContract> |
getThreadId2CallContract() |
ICallContract |
popContractWithCaller(Object caller,
IFailer throwingFailer,
Class<? extends IFail> failSpecification)
Ends a contract between caller and call contractor.
|
void |
pushContractWithCaller(ICallContract callContract)
Starts a {link:ICallContract} between caller and call contractor.
|
protected void |
setSynchronizationObject(Object synchronizationObject) |
protected void |
setThreadId2CallContract(HashMap<Long,ICallContract> threadId2CallContract) |
public void pushContractWithCaller(ICallContract callContract)
ICallContractor
Argument checkSpecification is annotated with a matching fail specification that needs to be employed by the caller to end the contract.
pushContractWithCaller
in interface ICallContractor
callContract
- contract data created by asserting check-method.public ICallContract popContractWithCaller(Object caller, IFailer throwingFailer, Class<? extends IFail> failSpecification)
ICallContractor
Argument failSpecification is annotated with a matching check specification that was employed by the caller to start the contract.
popContractWithCaller
in interface ICallContractor
caller
- instance that called a checker and needs to call a failerthrowingFailer
- failer that was called to throw an exceptionfailSpecification
- fail specification type inhering by IFailprotected Object getSynchronizationObject()
protected void setSynchronizationObject(Object synchronizationObject)
protected HashMap<Long,ICallContract> getThreadId2CallContract()
protected void setThreadId2CallContract(HashMap<Long,ICallContract> threadId2CallContract)
protected Long getCurrentThreadId()
The MIT License (MIT) - Copyright © 2014-2015 Keld Oelykke. All Rights Reserved.