|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jlab.coda.cMsg.cMsgDomainAdapter
org.jlab.coda.cMsg.CADomain.CA
public class CA
This class implements a client in the cMsg Channel Access (CA) domain. UDL: cMsg:CA://channelName?addr_list=list. where addr_list specifies the UDP broadcast address list.
Field Summary |
---|
Fields inherited from class org.jlab.coda.cMsg.cMsgDomainAdapter |
---|
connected, description, domain, host, name, receiving, shutdownHandler, UDL, UDLremainder |
Constructor Summary | |
---|---|
CA()
Constructor for CADomain. |
Method Summary | |
---|---|
void |
connect()
Connects to channel after parsing UDL. |
void |
disconnect()
Method to close the connection to the domain server. |
void |
flush(int timeout)
Method to force cMsg client to send pending communications with domain server. |
void |
send(cMsgMessage msg)
Method to send a message to the domain server for further distribution. |
java.lang.Object |
subscribe(java.lang.String subject,
java.lang.String type,
cMsgCallbackInterface cb,
java.lang.Object userObj)
Method to subscribe to receive messages of a subject and type from the domain server. |
cMsgMessage |
subscribeAndGet(java.lang.String subject,
java.lang.String type,
int timeout)
This method does two separate things depending on the specifics of message in the argument. |
void |
unsubscribe(java.lang.Object obj)
Method to unsubscribe a previous subscription to receive messages of a subject and type from the domain server. |
Methods inherited from class org.jlab.coda.cMsg.cMsgDomainAdapter |
---|
getDescription, getDomain, getHost, getName, getShutdownHandler, getString, getUDL, getUDLRemainder, isConnected, isReceiving, monitor, sendAndGet, setDescription, setName, setShutdownHandler, setUDL, setUDLRemainder, shutdownClients, shutdownServers, start, stop, syncSend |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CA() throws cMsgException
cMsgException
- if domain in not implemented or there are problemsMethod Detail |
---|
public void connect() throws cMsgException
connect
in interface cMsgDomainInterface
connect
in class cMsgDomainAdapter
cMsgException
- if there are communication problemspublic void disconnect() throws cMsgException
disconnect
in interface cMsgDomainInterface
disconnect
in class cMsgDomainAdapter
cMsgException
- always throws an exception since this is a dummy implementationpublic void send(cMsgMessage msg) throws cMsgException
send
in interface cMsgDomainInterface
send
in class cMsgDomainAdapter
msg
- message
cMsgException
- always throws an exception since this is a dummy implementationpublic void flush(int timeout) throws cMsgException
flush
in interface cMsgDomainInterface
flush
in class cMsgDomainAdapter
timeout
- time in milliseconds to wait for completion
cMsgException
- always throws an exception since this is a dummy implementationpublic cMsgMessage subscribeAndGet(java.lang.String subject, java.lang.String type, int timeout) throws cMsgException
cMsgMessage.isGetRequest()
, then the message is sent as it would be in the
send(org.jlab.coda.cMsg.cMsgMessage)
method. The server notes the fact that a response to it is expected,
and sends it to all subscribed to its subject and type. When a marked response is
received from a client, it sends that first response back to the original sender
regardless of its subject or type.
In a second usage, if the message did NOT set its "getRequest" field to be true,
then the server grabs the first incoming message of the requested subject and type
and sends that to the original sender in response to the get.
subscribeAndGet
in interface cMsgDomainInterface
subscribeAndGet
in class cMsgDomainAdapter
subject
- subject of message desired from servertype
- type of message desired from servertimeout
- time in milliseconds to wait for a reponse message
cMsgException
- always throws an exception since this is a dummy implementationpublic java.lang.Object subscribe(java.lang.String subject, java.lang.String type, cMsgCallbackInterface cb, java.lang.Object userObj) throws cMsgException
subscribe
in interface cMsgDomainInterface
subscribe
in class cMsgDomainAdapter
subject
- message subjecttype
- message typecb
- callback object whose single method is called upon receiving a message
of subject and typeuserObj
- any user-supplied object to be given to the callback method as an argument
cMsgException
- always throws an exception since this is a dummy implementationpublic void unsubscribe(java.lang.Object obj) throws cMsgException
unsubscribe
in interface cMsgDomainInterface
unsubscribe
in class cMsgDomainAdapter
obj
- the object "handle" returned from a subscribe call
cMsgException
- always throws an exception since this is a dummy implementation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |