|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jgroups.blocks.mux.MuxUpHandler
public class MuxUpHandler
Allows up handler multiplexing.
Field Summary | |
---|---|
protected Log |
log
|
Constructor Summary | |
---|---|
MuxUpHandler()
Creates a multiplexing up handler, with no default handler. |
|
MuxUpHandler(UpHandler defaultHandler)
Creates a multiplexing up handler using the specified default handler. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Log log
Constructor Detail |
---|
public MuxUpHandler()
public MuxUpHandler(UpHandler defaultHandler)
defaultHandler
- a default up handler to handle messages with no MuxHeader
Method Detail |
---|
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 id
null
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |