Constructor and Description |
---|
MuxUpHandler()
Creates a multiplexing up handler, with no default handler.
|
MuxUpHandler(UpHandler defaultHandler)
Creates a multiplexing up handler using the specified default handler.
|
Modifier and Type | Method and Description |
---|---|
void |
add(short id,
UpHandler handler)
Registers the specified handler to handle messages containing a mux header with the specified mux identifier.
|
UpHandler |
get(short id)
Gets the handler registered under the specified id
|
UpHandler |
getDefaultHandler()
Gets the handler for messages that have no mux header.
|
protected ImmutableReference<java.lang.Object> |
handleStateTransferEvent(Event evt)
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.
|
void |
remove(short id)
Unregisters the handler associated with the specifed mux identifier
|
void |
setDefaultHandler(UpHandler handler)
Sets the handler for messages that have no mux header.
|
java.lang.Object |
up(Event evt)
Invoked for all channel events except connection management and state transfer.
|
protected final Log log
public MuxUpHandler()
public void add(short id, UpHandler handler)
add
in interface Muxer<UpHandler>
id
- a mux idhandler
- a handler for the specified idMuxer.add(short, java.lang.Object)
public UpHandler get(short id)
get
in interface Muxer<UpHandler>
id
- a mux idnull
if no handler is registered under
id
Muxer.get(short)
public void remove(short id)
remove
in interface Muxer<UpHandler>
id
- a mux idMuxer.remove(short)
public UpHandler getDefaultHandler()
Muxer
getDefaultHandler
in interface Muxer<UpHandler>
null
if no default handler
has been setpublic void setDefaultHandler(UpHandler handler)
Muxer
setDefaultHandler
in interface Muxer<UpHandler>
handler
- a handler for messages that have no mux headerpublic java.lang.Object up(Event evt)
up
in interface UpHandler
UpHandler.up(org.jgroups.Event)
protected ImmutableReference<java.lang.Object> handleStateTransferEvent(Event evt)
null
if up() needs to
handle the event. If the event was handled but the return value
is null
, an AtomicReference initialized to
null
should be returned. This default
implementation always returns null
Copyright © 1998-2020 Red Hat. All Rights Reserved.