public class CA extends cMsgDomainAdapter
UDL: cMsg:CA://channelName?addr_list=list.
where addr_list specifies the UDP broadcast address list.
connected, debug, description, domain, host, name, receiving, shutdownHandler, UDL, UDLremainder| Constructor and Description |
|---|
CA()
Constructor for CA domain.
|
| Modifier and Type | Method and Description |
|---|---|
void |
connect()
Connects to CA channel after parsing UDL.
|
void |
disconnect()
Disconnects from CA channel.
|
void |
flush(int timeout)
Complete what the "send" method started -- write the double value to channel
for real.
|
void |
send(cMsgMessage msg)
Set double value of channel from message's text field.
|
cMsgSubscriptionHandle |
subscribe(java.lang.String subject,
java.lang.String type,
cMsgCallbackInterface cb,
java.lang.Object userObj)
Does a CA "monitor on" for this channel.
|
cMsgMessage |
subscribeAndGet(java.lang.String subject,
java.lang.String type,
int timeout)
Get the channel's value and place it in the return message's text field.
|
void |
unsubscribe(cMsgSubscriptionHandle obj)
Does a CA "monitor off" for this channel.
|
getCurrentUDL, getDebug, getDescription, getDomain, getHost, getInfo, getName, getServerHost, getServerPort, getShutdownHandler, getUDL, getUDLRemainder, isConnected, isReceiving, monitor, sendAndGet, setDebug, setDescription, setName, setShutdownHandler, setUDL, setUDLRemainder, shutdownClients, shutdownServers, start, stop, syncSendpublic void connect()
throws cMsgException
connect in interface cMsgDomainInterfaceconnect in class cMsgDomainAdaptercMsgException - if there are communication problemspublic void disconnect()
throws cMsgException
disconnect in interface cMsgDomainInterfacedisconnect in class cMsgDomainAdaptercMsgException - if destroying channel failedpublic void send(cMsgMessage msg) throws cMsgException
send in interface cMsgDomainInterfacesend in class cMsgDomainAdaptermsg - message containing the text form of a double valuecMsgException - if not connected to or cannot write to channelpublic void flush(int timeout)
throws cMsgException
flush in interface cMsgDomainInterfaceflush in class cMsgDomainAdaptertimeout - time in milliseconds to wait for completioncMsgException - if error in CA flushIO or not connected to channelpublic cMsgMessage subscribeAndGet(java.lang.String subject, java.lang.String type, int timeout) throws cMsgException
subscribeAndGet in interface cMsgDomainInterfacesubscribeAndGet in class cMsgDomainAdaptersubject - subject of return msgtype - type of return msgtimeout - time in milliseconds to wait for a messagecMsgException - if not connected to channel or cannot get channel valuepublic cMsgSubscriptionHandle subscribe(java.lang.String subject, java.lang.String type, cMsgCallbackInterface cb, java.lang.Object userObj) throws cMsgException
subscribe in interface cMsgDomainInterfacesubscribe in class cMsgDomainAdaptersubject - 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 argumentcMsgException - if channel not connected or "monitor on" failedpublic void unsubscribe(cMsgSubscriptionHandle obj) throws cMsgException
unsubscribe in interface cMsgDomainInterfaceunsubscribe in class cMsgDomainAdapterobj - the object returned from a subscribe callcMsgException - if channel not connected or "monitor off" failed