public abstract class AbstractSynchroService extends java.lang.Object implements SynchroService
| Modifier and Type | Field and Description |
|---|---|
protected CommonCacheService |
cacheService |
protected TechnicalLoggerService |
logger |
protected static java.lang.String |
SYNCHRO_SERVICE_CACHE |
| Constructor and Description |
|---|
AbstractSynchroService(TechnicalLoggerService logger,
CommonCacheService cacheService) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAllEvents() |
void |
fireEvent(java.util.Map<java.lang.String,java.io.Serializable> event,
java.io.Serializable id) |
protected abstract java.util.Map<java.lang.String,java.io.Serializable> |
getEventKeyAndIdMap()
Maitains a map of
|
protected java.io.Serializable |
getFiredAndRemoveIt(java.util.Map<java.lang.String,java.io.Serializable> expectedEvent) |
protected abstract java.util.concurrent.locks.Lock |
getServiceLock() |
protected java.lang.String |
getWaiterAndRemoveIt(java.util.Map<java.lang.String,java.io.Serializable> event) |
protected abstract java.util.Map<java.util.Map<java.lang.String,java.io.Serializable>,java.lang.String> |
getWaitersMap()
String value is an identifier of the sempaphore for the current event.
|
boolean |
hasWaiters() |
protected boolean |
matchedAtLeastAllExpectedEntries(java.util.Map<java.lang.String,java.io.Serializable> expectedEventEntries,
java.util.Map<java.lang.String,java.io.Serializable> actualEventEntries) |
protected abstract void |
releaseWaiter(java.lang.String semaphoreKey) |
protected void |
throwTimeout(java.util.Map<java.lang.String,java.io.Serializable> event,
long timeout) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwaitForEventprotected static final java.lang.String SYNCHRO_SERVICE_CACHE
protected final TechnicalLoggerService logger
protected final CommonCacheService cacheService
public AbstractSynchroService(TechnicalLoggerService logger, CommonCacheService cacheService)
protected abstract java.util.Map<java.util.Map<java.lang.String,java.io.Serializable>,java.lang.String> getWaitersMap()
protected abstract java.util.Map<java.lang.String,java.io.Serializable> getEventKeyAndIdMap()
protected abstract void releaseWaiter(java.lang.String semaphoreKey)
protected abstract java.util.concurrent.locks.Lock getServiceLock()
public void fireEvent(java.util.Map<java.lang.String,java.io.Serializable> event,
java.io.Serializable id)
fireEvent in interface SynchroServiceprotected java.lang.String getWaiterAndRemoveIt(java.util.Map<java.lang.String,java.io.Serializable> event)
protected boolean matchedAtLeastAllExpectedEntries(java.util.Map<java.lang.String,java.io.Serializable> expectedEventEntries,
java.util.Map<java.lang.String,java.io.Serializable> actualEventEntries)
protected java.io.Serializable getFiredAndRemoveIt(java.util.Map<java.lang.String,java.io.Serializable> expectedEvent)
protected void throwTimeout(java.util.Map<java.lang.String,java.io.Serializable> event,
long timeout)
throws java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutExceptionpublic void clearAllEvents()
clearAllEvents in interface SynchroServicepublic boolean hasWaiters()
hasWaiters in interface SynchroService