Class MessageAssembler
- java.lang.Object
-
- org.opendaylight.controller.cluster.messaging.MessageAssembler
-
- All Implemented Interfaces:
AutoCloseable
public final class MessageAssembler extends Object implements AutoCloseable
This class re-assembles messages sliced into smaller chunks byMessageSlicer.- Author:
- Thomas Pantelis
- See Also:
MessageSlicer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMessageAssembler.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MessageAssembler.Builderbuilder()Returns a new Builder for creating MessageAssembler instances.voidcheckExpiredAssembledMessageState()Checks for and removes assembled message state that has expired due to inactivity from the slicing component on the other end.voidclose()booleanhandleMessage(Object message, @NonNull ActorRef sendTo)Invoked to handle message slices and other messages pertaining to this class.static booleanisHandledMessage(Object message)Checks if the given message is handled by this class.
-
-
-
Method Detail
-
builder
public static MessageAssembler.Builder builder()
Returns a new Builder for creating MessageAssembler instances.- Returns:
- a Builder instance
-
isHandledMessage
public static boolean isHandledMessage(Object message)
Checks if the given message is handled by this class. If so, it should be forwarded to thehandleMessage(Object, ActorRef)method- Parameters:
message- the message to check- Returns:
- true if handled, false otherwise
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
checkExpiredAssembledMessageState
public void checkExpiredAssembledMessageState()
Checks for and removes assembled message state that has expired due to inactivity from the slicing component on the other end.
-
handleMessage
public boolean handleMessage(Object message, @NonNull ActorRef sendTo)
Invoked to handle message slices and other messages pertaining to this class.- Parameters:
message- the messagesendTo- the reference of the actor to which subsequent message slices should be sent- Returns:
- true if the message was handled, false otherwise
-
-