Package org.jgroups
Class DefaultMessageFactory
java.lang.Object
org.jgroups.DefaultMessageFactory
- All Implemented Interfaces:
MessageFactory
Default implementation of
MessageFactory. Uses an array for message IDs less then 32, and a hashmap for
types above 32- Since:
- 5.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
MIN_TYPE
protected static final byte MIN_TYPE- See Also:
-
creators
-
map
-
-
Constructor Details
-
DefaultMessageFactory
public DefaultMessageFactory()
-
-
Method Details
-
create
Description copied from interface:MessageFactoryCreates a message based on the given ID- Specified by:
createin interfaceMessageFactory- Type Parameters:
T- The type of the message- Parameters:
type- The ID- Returns:
- A message
-
register
Description copied from interface:MessageFactoryRegisters a new creator of messages- Specified by:
registerin interfaceMessageFactory- Parameters:
type- The type associated with the new payload. Needs to be the same in all nodes of the same cluster, and needs to be available (ie., not taken by JGroups or other applications).generator- The creator of the payload associated with the given type
-