public class File extends cMsgDomainAdapter
connected, debug, description, domain, host, name, receiving, shutdownHandler, UDL, UDLremainder
Constructor and Description |
---|
File()
Constructor for File domain.
|
Modifier and Type | Method and Description |
---|---|
void |
connect()
Opens a file.
|
void |
disconnect()
Closes file.
|
void |
flush(int timeout)
Flushes output.
|
void |
send(cMsgMessage msg)
Writes to file.
|
int |
syncSend(cMsgMessage message,
int timeout)
Calls send to write to file.
|
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, subscribe, subscribeAndGet, unsubscribe
public File()
UDL: cMsg:file//fileName?textOnly=value.
Default is to print entire message to file. If textOnly=true then only print timestamp and message text to file.
public void connect() throws cMsgException
connect
in interface cMsgDomainInterface
connect
in class cMsgDomainAdapter
cMsgException
- if cannot open file or domain specific part of UDL is nullpublic void disconnect()
disconnect
in interface cMsgDomainInterface
disconnect
in class cMsgDomainAdapter
public void send(cMsgMessage msg) throws cMsgException
send
in interface cMsgDomainInterface
send
in class cMsgDomainAdapter
msg
- message to write to filecMsgException
- if file is closed (connect was not called, or disconnect was called)public int syncSend(cMsgMessage message, int timeout) throws cMsgException
syncSend
in interface cMsgDomainInterface
syncSend
in class cMsgDomainAdapter
message
- message to write to filetimeout
- time in milliseconds to wait for a responsecMsgException
- if file is closed (connect was not called, or disconnect was called)public void flush(int timeout) throws cMsgException
flush
in interface cMsgDomainInterface
flush
in class cMsgDomainAdapter
timeout
- ignoredcMsgException
- if file is closed (connect was not called, or disconnect was called)