|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.connecterra.ale.reader.DeviceChannel
com.connecterra.ale.reader.SocketDeviceChannel
com.connecterra.ale.reader.ByteStreamDeviceChannel
public class ByteStreamDeviceChannel
A DeviceChannel implemented by a TCP connection initiated by the device driver. It extends the SocketDeviceChannel to provide buffering on the input and output streams.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.connecterra.ale.reader.SocketDeviceChannel |
---|
com.connecterra.ale.reader.SocketDeviceChannel.BlockingSocketInputListener, com.connecterra.ale.reader.SocketDeviceChannel.SocketInputListener |
Nested classes/interfaces inherited from class com.connecterra.ale.reader.DeviceChannel |
---|
DeviceChannel.AbstractOpenChannel, DeviceChannel.MarkingInputStream |
Constructor Summary | |
---|---|
ByteStreamDeviceChannel(PluginConfig rc,
String portName)
Creates a new ByteStreamDeviceChannel instance
where the remote host is read from the hostname
parameter and the remote port is read from the parameter named
by the portName argument in the given PluginConfig . |
Method Summary | |
---|---|
BufferedInputStream |
getInputStream()
Returns a BufferedInputStream for reading from an open channel. |
BufferedOutputStream |
getOutputStream()
|
Methods inherited from class com.connecterra.ale.reader.SocketDeviceChannel |
---|
addDeviceAttributes, addToPluginMeta, addToPluginMeta, close, getHostname, getPort, getSocket, open, ready, setBlockingListener, setListener, toString |
Methods inherited from class com.connecterra.ale.reader.DeviceChannel |
---|
getLogger, getReactor, markUsed, reactivateChannels |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ByteStreamDeviceChannel(PluginConfig rc, String portName) throws com.connecterra.ale.resources.PluginLoadException
ByteStreamDeviceChannel
instance
where the remote host is read from the hostname
parameter and the remote port is read from the parameter named
by the portName
argument in the given PluginConfig
. The timeout for socket operations is read from
the socketTimeout
parameter in the PluginConfig.
portName
- the String
key name of the
remote port parameter
com.connecterra.ale.resources.PluginLoadException
- if a configuration error occursMethod Detail |
---|
public BufferedInputStream getInputStream() throws IOException
If this method is used by a driver which expects to receive data asynchronously, and this method is used to read a synchronous result from a command, then there is a pitfall to avoid: if the device sent asynchronous data before the synchronous command was received and processed, then the command "response" may actually be the asynchronous data. The reader should be aware of this, and be prepared to handle the asynchronous data, either immediately or by queueing it for later processing.
getInputStream
in class com.connecterra.ale.reader.SocketDeviceChannel
BufferedInputStream
for reading from an
open channel.
IOException
- if the channel is not openpublic BufferedOutputStream getOutputStream() throws IOException
getOutputStream
in class com.connecterra.ale.reader.SocketDeviceChannel
BufferedOutputStream
for writing to an
open channel.
IOException
- if the channel is not open
|
Documentation is available at ${DOCSWEBROOT} Copyright 2007 BEA Systems Inc. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |