Package org.jgroups.blocks.mux
Class MuxUpHandler
java.lang.Object
org.jgroups.blocks.mux.MuxUpHandler
Allows up handler multiplexing.
- Author:
- Bela Ban, Paul Ferraro
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a multiplexing up handler, with no default handler.MuxUpHandler(UpHandler defaultHandler) Creates a multiplexing up handler using the specified default handler. -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters the specified handler to handle messages containing a mux header with the specified mux identifier.get(short id) Gets the handler registered under the specified idGets the handler for messages that have no mux header.protected ImmutableReference<Object> Extension point for subclasses called by up() when an event related to state transfer is received, allowing the subclass to override the default behavior of passing the event to the default up handler.voidremove(short id) Unregisters the handler associated with the specifed mux identifiervoidsetDefaultHandler(UpHandler handler) Sets the handler for messages that have no mux header.Invoked for all channel events except connection management and state transfer.
-
Field Details
-
log
-
-
Constructor Details
-
MuxUpHandler
public MuxUpHandler()Creates a multiplexing up handler, with no default handler. -
MuxUpHandler
Creates a multiplexing up handler using the specified default handler.- Parameters:
defaultHandler- a default up handler to handle messages with noMuxHeader
-
-
Method Details
-
add
Registers the specified handler to handle messages containing a mux header with the specified mux identifier. -
get
Gets the handler registered under the specified id -
remove
public void remove(short id) Unregisters the handler associated with the specifed mux identifier -
getDefaultHandler
Description copied from interface:MuxerGets the handler for messages that have no mux header.- Specified by:
getDefaultHandlerin interfaceMuxer<UpHandler>- Returns:
- the default handler, or
nullif no default handler has been set
-
setDefaultHandler
Description copied from interface:MuxerSets the handler for messages that have no mux header.- Specified by:
setDefaultHandlerin interfaceMuxer<UpHandler>- Parameters:
handler- a handler for messages that have no mux header
-
up
Invoked for all channel events except connection management and state transfer. -
handleStateTransferEvent
Extension point for subclasses called by up() when an event related to state transfer is received, allowing the subclass to override the default behavior of passing the event to the default up handler.- Returns:
- an AtomicReference containing the return value for the event
if the event was handled and no further processing
should be done in up(), or
nullif up() needs to handle the event. If the event was handled but the return value isnull, an AtomicReference initialized tonullshould be returned. This default implementation always returnsnull
-