Package com.smeup.jardis.endpoint
Class JardisMemory<R,E>
- java.lang.Object
-
- com.smeup.jardis.endpoint.JardisEndPoint
-
- com.smeup.jardis.endpoint.JardisMemory<R,E>
-
- Type Parameters:
E- event typeR- response type
- Direct Known Subclasses:
JardisMemoryDap,JardisMemoryLsp
public abstract class JardisMemory<R,E> extends JardisEndPoint
This class creates an instance of jardis in memory. You can use it for test purposes.- Author:
- lana
-
-
Field Summary
-
Fields inherited from class com.smeup.jardis.endpoint.JardisEndPoint
configuration
-
-
Constructor Summary
Constructors Constructor Description JardisMemory()JardisMemory(com.smeup.jardis.core.JardisConfiguration jardisConfiguration)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract com.smeup.jardis.core.commons.JardisResponse<R>convertJardisResponse(R r)voiddispatchBroadcastMessage(com.smeup.jardis.core.Message message)Send a broadcast message to all instances ofHandlerbooleandispatchConsumableMessage(com.smeup.jardis.core.Message message)Sends a consumable message to all instances ofHandlerDispathing is blocked if message is consumed by anHandlerabstract booleanisEvent(Object payload)abstract voidnotifyLocker(StringBuilder locker)voidonChannelEvent(Consumer<E> event)<T> TsendObject(Object object, Class<T> responseType)voidshutdown()voidstart()-
Methods inherited from class com.smeup.jardis.endpoint.JardisEndPoint
getConfiguration
-
-
-
-
Method Detail
-
convertJardisResponse
public abstract com.smeup.jardis.core.commons.JardisResponse<R> convertJardisResponse(R r)
-
isEvent
public abstract boolean isEvent(Object payload)
-
notifyLocker
public abstract void notifyLocker(StringBuilder locker)
-
start
public void start()
- Specified by:
startin classJardisEndPoint
-
shutdown
public void shutdown()
- Specified by:
shutdownin classJardisEndPoint
-
dispatchConsumableMessage
public boolean dispatchConsumableMessage(com.smeup.jardis.core.Message message)
Description copied from class:JardisEndPointSends a consumable message to all instances ofHandlerDispathing is blocked if message is consumed by anHandler- Specified by:
dispatchConsumableMessagein classJardisEndPoint- Parameters:
message- The message- Returns:
- true if one Handler consumed the message, false elsewhere
-
dispatchBroadcastMessage
public void dispatchBroadcastMessage(com.smeup.jardis.core.Message message)
Description copied from class:JardisEndPointSend a broadcast message to all instances ofHandler- Specified by:
dispatchBroadcastMessagein classJardisEndPoint- Parameters:
message- The message
-
sendObject
public <T> T sendObject(Object object, Class<T> responseType) throws IOException, InterruptedException
- Throws:
IOExceptionInterruptedException
-
-