|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.w3c.www.mux.SampleMuxHandler
public class SampleMuxHandler
| Field Summary | |
|---|---|
static int |
DISCARD
Well known protocols - The echo protocol identifier. |
static int |
ECHO
Well known protocols - The echo protocol identifier. |
protected java.util.Hashtable |
protocols
The hashtable of accepted protocols. |
protected static SampleMuxHandler |
sample
The sigle instance of that class. |
| Constructor Summary | |
|---|---|
SampleMuxHandler()
|
|
| Method Summary | |
|---|---|
boolean |
acceptSession(MuxStream stream,
int sessid,
int protid)
Are we willing to speak the given protocol on the given session. |
static MuxStreamHandler |
getStreamHandler()
Get an instance of that sample mux stream handler. |
protected void |
log(java.lang.String msg)
Log an error. |
void |
notifySession(MuxSession session)
Setup the appropriate protocol handler for that accepted session. |
void |
registerDefaultHandlers()
Register default protocol handlers for that stream handler. |
void |
registerHandler(int protid,
MuxProtocolHandler handler)
Register an instantiated protocol handler for the given protocol id. |
void |
registerHandler(int protid,
java.lang.String strhandler)
Register a protocol handler for the given protocol identifier. |
void |
unregisterHandler(int protid)
Unregister any handler for that protocol. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ECHO
public static final int DISCARD
protected static SampleMuxHandler sample
protected java.util.Hashtable protocols
| Constructor Detail |
|---|
public SampleMuxHandler()
| Method Detail |
|---|
protected void log(java.lang.String msg)
msg - The message to log.public static MuxStreamHandler getStreamHandler()
public boolean acceptSession(MuxStream stream,
int sessid,
int protid)
acceptSession in interface MuxStreamHandlerstream - The stream that received the new session.sessid - The proposed session identifier.protid - The protocol to be spoken on that session.
public void notifySession(MuxSession session)
notifySession in interface MuxStreamHandlersession - The newly accepted session.
public void registerHandler(int protid,
java.lang.String strhandler)
protid - The protocol identifier.handler - The name of the class to instantiate in order
to get a suitable handler for that protocol.MuxProtocolHandler
public void registerHandler(int protid,
MuxProtocolHandler handler)
The given handler will be invoked for all new sessions willing to speak the advertized protocol.
protid - The protocol identifier.handler - The instantiated protocol handler.public void unregisterHandler(int protid)
protid - The identifier of the protocol to unregister.public void registerDefaultHandlers()
Default protocols registered by this class are:
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||