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, syncSend
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
- if destroying channel failedpublic void send(cMsgMessage msg) throws cMsgException
send
in interface cMsgDomainInterface
send
in class cMsgDomainAdapter
msg
- 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 cMsgDomainInterface
flush
in class cMsgDomainAdapter
timeout
- 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 cMsgDomainInterface
subscribeAndGet
in class cMsgDomainAdapter
subject
- 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 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 argumentcMsgException
- if channel not connected or "monitor on" failedpublic void unsubscribe(cMsgSubscriptionHandle obj) throws cMsgException
unsubscribe
in interface cMsgDomainInterface
unsubscribe
in class cMsgDomainAdapter
obj
- the object returned from a subscribe callcMsgException
- if channel not connected or "monitor off" failed