|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlab.coda.cMsg.cMsgSubdomainAdapter
public class cMsgSubdomainAdapter
This class provides a very basic (non-functional/dummy) implementation of the cMsgSubdomainInterface interface. This class is used by a domain server to respond to client demands. It contains some methods that hide the details of communication with the client. A fully implementated subclass of this class must handle all communication with a particular subdomain (such as SmartSockets or JADE agents).
Understand that each client using cMsg will have its own handler object from either an implemenation of the cMsgSubdomainInterface interface or a subclass of this class. One client may concurrently use the same cMsgHandleRequest object; thus, implementations must be thread-safe. Furthermore, when the name server shuts dowm, the method handleServerShutdown may be executed more than once for the same reason.
Constructor Summary | |
---|---|
cMsgSubdomainAdapter()
|
Method Summary | |
---|---|
void |
handleClientShutdown()
Method to handle a client or domain server down. |
void |
handleKeepAlive()
Method to handle keepalive sent by domain client checking to see if the domain server socket is still up. |
void |
handleSendAndGetRequest(cMsgMessageFull message)
Method to synchronously get a single message from a receiver by sending out a message to be responded to. |
void |
handleSendRequest(cMsgMessageFull message)
Method to handle message sent by domain client. |
void |
handleShutdownClientsRequest(java.lang.String client,
boolean includeMe)
Method to handle request to shutdown clients sent by domain client. |
void |
handleSubscribeAndGetRequest(java.lang.String subject,
java.lang.String type,
int id)
Method to synchronously get a single message from the server for a one-time subscription of a subject and type. |
void |
handleSubscribeRequest(java.lang.String subject,
java.lang.String type,
int id)
Method to handle subscribe request sent by domain client. |
int |
handleSyncSendRequest(cMsgMessageFull message)
Method to handle message sent by domain client in synchronous mode. |
void |
handleUnSendAndGetRequest(int id)
Method to handle remove sendAndGet request sent by domain client (hidden from user). |
void |
handleUnsubscribeAndGetRequest(java.lang.String subject,
java.lang.String type,
int id)
Method to handle remove subscribeAndGet request sent by domain client (hidden from user). |
void |
handleUnsubscribeRequest(java.lang.String subject,
java.lang.String type,
int id)
Method to handle unsubscribe request sent by domain client. |
boolean |
hasSend()
Method to tell if the "send" cMsg API function is implemented by this interface implementation in the handleSendRequest(org.jlab.coda.cMsg.cMsgMessageFull)
method. |
boolean |
hasSendAndGet()
Method to tell if the "sendAndGet" cMsg API function is implemented by this interface implementation in the handleSendAndGetRequest(org.jlab.coda.cMsg.cMsgMessageFull)
method. |
boolean |
hasShutdown()
Method to tell if the "shutdown" cMsg API function is implemented by this interface implementation in the handleShutdownClientsRequest(java.lang.String, boolean)
method. |
boolean |
hasSubscribe()
Method to tell if the "subscribe" cMsg API function is implemented by this interface implementation in the handleSubscribeRequest(java.lang.String, java.lang.String, int)
method. |
boolean |
hasSubscribeAndGet()
Method to tell if the "subscribeAndGet" cMsg API function is implemented by this interface implementation in the handleSubscribeAndGetRequest(java.lang.String, java.lang.String, int)
method. |
boolean |
hasSyncSend()
Method to tell if the "syncSend" cMsg API function is implemented by this interface implementation in the handleSyncSendRequest(org.jlab.coda.cMsg.cMsgMessageFull)
method. |
boolean |
hasUnsubscribe()
Method to tell if the "unsubscribe" cMsg API function is implemented by this interface implementation in the handleUnsubscribeRequest(java.lang.String, java.lang.String, int)
method. |
void |
registerClient(cMsgClientInfo info)
Method to register domain client. |
void |
setMessageDeliverer(cMsgDeliverMessageInterface deliverer)
Method to give the subdomain handler on object able to deliver messages to the client. |
void |
setUDLRemainder(java.lang.String UDLRemainder)
Method to give the subdomain handler the appropriate part of the UDL the client used to talk to the domain server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public cMsgSubdomainAdapter()
Method Detail |
---|
public void setUDLRemainder(java.lang.String UDLRemainder) throws cMsgException
setUDLRemainder
in interface cMsgSubdomainInterface
UDLRemainder
- last part of the UDL appropriate to the subdomain handler
cMsgException
public void setMessageDeliverer(cMsgDeliverMessageInterface deliverer) throws cMsgException
setMessageDeliverer
in interface cMsgSubdomainInterface
deliverer
- object able to deliver messages to the client
cMsgException
public void registerClient(cMsgClientInfo info) throws cMsgException
registerClient
in interface cMsgSubdomainInterface
info
- information about client
cMsgException
public void handleSendRequest(cMsgMessageFull message) throws cMsgException
handleSendRequest
in interface cMsgSubdomainInterface
message
- message from sender
cMsgException
public int handleSyncSendRequest(cMsgMessageFull message) throws cMsgException
handleSyncSendRequest
in interface cMsgSubdomainInterface
message
- message from sender
cMsgException
public void handleSubscribeAndGetRequest(java.lang.String subject, java.lang.String type, int id) throws cMsgException
handleSubscribeAndGetRequest
in interface cMsgSubdomainInterface
subject
- message subject subscribed totype
- message type subscribed toid
- message id refering to these specific subject and type values
cMsgException
public void handleSendAndGetRequest(cMsgMessageFull message) throws cMsgException
handleSendAndGetRequest
in interface cMsgSubdomainInterface
message
- message requesting what sort of message to get
cMsgException
public void handleUnSendAndGetRequest(int id) throws cMsgException
handleUnSendAndGetRequest
in interface cMsgSubdomainInterface
id
- message id refering to these specific subject and type values
cMsgException
public void handleUnsubscribeAndGetRequest(java.lang.String subject, java.lang.String type, int id) throws cMsgException
handleUnsubscribeAndGetRequest
in interface cMsgSubdomainInterface
subject
- message subject subscribed totype
- message type subscribed toid
- message id refering to these specific subject and type values
cMsgException
public void handleSubscribeRequest(java.lang.String subject, java.lang.String type, int id) throws cMsgException
handleSubscribeRequest
in interface cMsgSubdomainInterface
subject
- message subject to subscribe totype
- message type to subscribe toid
- message id refering to these specific subject and type values
cMsgException
public void handleUnsubscribeRequest(java.lang.String subject, java.lang.String type, int id) throws cMsgException
handleUnsubscribeRequest
in interface cMsgSubdomainInterface
subject
- message subject to subscribe totype
- message type to subscribe toid
- message id refering to these specific subject and type values
cMsgException
public void handleShutdownClientsRequest(java.lang.String client, boolean includeMe) throws cMsgException
handleShutdownClientsRequest
in interface cMsgSubdomainInterface
client
- client(s) to be shutdownincludeMe
- if true, this client may be shutdown too
cMsgException
public void handleKeepAlive() throws cMsgException
handleKeepAlive
in interface cMsgSubdomainInterface
cMsgException
public void handleClientShutdown() throws cMsgException
handleClientShutdown
in interface cMsgSubdomainInterface
cMsgException
public boolean hasSend()
handleSendRequest(org.jlab.coda.cMsg.cMsgMessageFull)
method.
hasSend
in interface cMsgSubdomainInterface
handleSendRequest(org.jlab.coda.cMsg.cMsgMessageFull)
public boolean hasSyncSend()
handleSyncSendRequest(org.jlab.coda.cMsg.cMsgMessageFull)
method.
hasSyncSend
in interface cMsgSubdomainInterface
handleSyncSendRequest(org.jlab.coda.cMsg.cMsgMessageFull)
public boolean hasSubscribeAndGet()
handleSubscribeAndGetRequest(java.lang.String, java.lang.String, int)
method.
hasSubscribeAndGet
in interface cMsgSubdomainInterface
handleSubscribeAndGetRequest(java.lang.String, java.lang.String, int)
public boolean hasSendAndGet()
handleSendAndGetRequest(org.jlab.coda.cMsg.cMsgMessageFull)
method.
hasSendAndGet
in interface cMsgSubdomainInterface
handleSendAndGetRequest(org.jlab.coda.cMsg.cMsgMessageFull)
public boolean hasSubscribe()
handleSubscribeRequest(java.lang.String, java.lang.String, int)
method.
hasSubscribe
in interface cMsgSubdomainInterface
handleSubscribeRequest(java.lang.String, java.lang.String, int)
public boolean hasUnsubscribe()
handleUnsubscribeRequest(java.lang.String, java.lang.String, int)
method.
hasUnsubscribe
in interface cMsgSubdomainInterface
handleUnsubscribeRequest(java.lang.String, java.lang.String, int)
public boolean hasShutdown()
handleShutdownClientsRequest(java.lang.String, boolean)
method.
hasShutdown
in interface cMsgSubdomainInterface
handleShutdownClientsRequest(java.lang.String, boolean)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |