构造器和说明 |
---|
MuxUpHandler()
Creates a multiplexing up handler, with no default handler.
|
MuxUpHandler(UpHandler defaultHandler)
Creates a multiplexing up handler using the specified default handler.
|
限定符和类型 | 方法和说明 |
---|---|
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
在接口中 Muxer<UpHandler>
id
- a mux idhandler
- a handler for the specified idMuxer.add(short, java.lang.Object)
public UpHandler get(short id)
get
在接口中 Muxer<UpHandler>
id
- a mux idnull
if no handler is registered under
id
Muxer.get(short)
public void remove(short id)
remove
在接口中 Muxer<UpHandler>
id
- a mux idMuxer.remove(short)
public UpHandler getDefaultHandler()
Muxer
getDefaultHandler
在接口中 Muxer<UpHandler>
null
if no default handler
has been setpublic void setDefaultHandler(UpHandler handler)
Muxer
setDefaultHandler
在接口中 Muxer<UpHandler>
handler
- a handler for messages that have no mux headerpublic java.lang.Object up(Event evt)
up
在接口中 UpHandler
UpHandler.up(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