Package org.bonitasoft.engine.synchro
Class AbstractSynchroService
- java.lang.Object
-
- org.bonitasoft.engine.synchro.AbstractSynchroService
-
- All Implemented Interfaces:
SynchroService
- Direct Known Subclasses:
SynchroServiceImpl
public abstract class AbstractSynchroService extends java.lang.Object implements SynchroService
- Author:
- Emmanuel Duchastenier, Charles Souillard
-
-
Field Summary
Fields Modifier and Type Field Description protected CacheServicecacheServiceprotected static java.lang.StringSYNCHRO_SERVICE_CACHE
-
Constructor Summary
Constructors Constructor Description AbstractSynchroService(CacheService cacheService)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclearAllEvents()voidfireEvent(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 ofprotected java.io.SerializablegetFiredAndRemoveIt(java.util.Map<java.lang.String,java.io.Serializable> expectedEvent)protected abstract org.slf4j.LoggergetLogger()protected abstract java.util.concurrent.locks.LockgetServiceLock()protected java.lang.StringgetWaiterAndRemoveIt(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.booleanhasWaiters()protected booleanmatchedAtLeastAllExpectedEntries(java.util.Map<java.lang.String,java.io.Serializable> expectedEventEntries, java.util.Map<java.lang.String,java.io.Serializable> actualEventEntries)protected abstract voidreleaseWaiter(java.lang.String semaphoreKey)protected voidthrowTimeout(java.util.Map<java.lang.String,java.io.Serializable> event, long timeout)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bonitasoft.engine.synchro.SynchroService
waitForEvent
-
-
-
-
Field Detail
-
SYNCHRO_SERVICE_CACHE
protected static final java.lang.String SYNCHRO_SERVICE_CACHE
- See Also:
- Constant Field Values
-
cacheService
protected final CacheService cacheService
-
-
Constructor Detail
-
AbstractSynchroService
public AbstractSynchroService(CacheService cacheService)
-
-
Method Detail
-
getWaitersMap
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.
-
getLogger
protected abstract org.slf4j.Logger getLogger()
-
getEventKeyAndIdMap
protected abstract java.util.Map<java.lang.String,java.io.Serializable> getEventKeyAndIdMap()
Maitains a map of
-
releaseWaiter
protected abstract void releaseWaiter(java.lang.String semaphoreKey)
-
getServiceLock
protected abstract java.util.concurrent.locks.Lock getServiceLock()
-
fireEvent
public void fireEvent(java.util.Map<java.lang.String,java.io.Serializable> event, java.io.Serializable id)- Specified by:
fireEventin interfaceSynchroService
-
getWaiterAndRemoveIt
protected java.lang.String getWaiterAndRemoveIt(java.util.Map<java.lang.String,java.io.Serializable> event)
-
matchedAtLeastAllExpectedEntries
protected boolean matchedAtLeastAllExpectedEntries(java.util.Map<java.lang.String,java.io.Serializable> expectedEventEntries, java.util.Map<java.lang.String,java.io.Serializable> actualEventEntries)
-
getFiredAndRemoveIt
protected java.io.Serializable getFiredAndRemoveIt(java.util.Map<java.lang.String,java.io.Serializable> expectedEvent)
-
throwTimeout
protected void throwTimeout(java.util.Map<java.lang.String,java.io.Serializable> event, long timeout) throws java.util.concurrent.TimeoutException- Throws:
java.util.concurrent.TimeoutException
-
clearAllEvents
public void clearAllEvents()
- Specified by:
clearAllEventsin interfaceSynchroService
-
hasWaiters
public boolean hasWaiters()
- Specified by:
hasWaitersin interfaceSynchroService
-
-