anon.client
Class AbstractDataChain
java.lang.Object
anon.client.AbstractDataChain
- All Implemented Interfaces:
- AnonChannel, java.lang.Runnable, java.util.Observer
- Direct Known Subclasses:
- SequentialChannelDataChain, SingleChannelDataChain
public abstract class AbstractDataChain
- extends java.lang.Object
- implements AnonChannel, java.util.Observer, java.lang.Runnable
- Author:
- Stefan Lieske
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
m_inputStream
private AbstractDataChain.DataChainInputStreamImplementation m_inputStream
m_outputStream
private AbstractDataChain.DataChainOutputStreamImplementation m_outputStream
m_messageQueuesNotifications
private java.util.Vector m_messageQueuesNotifications
m_channelCreator
private IDataChannelCreator m_channelCreator
m_errorListener
private DataChainErrorListener m_errorListener
m_chainClosed
private boolean m_chainClosed
m_downstreamThread
private java.lang.Thread m_downstreamThread
AbstractDataChain
public AbstractDataChain(IDataChannelCreator a_channelCreator,
DataChainErrorListener a_errorListener)
getInputStream
public java.io.InputStream getInputStream()
- Description copied from interface:
AnonChannel
- The returned InputStream could be used to receive data.
- Specified by:
getInputStream
in interface AnonChannel
- Returns:
- InputStream, useful for receiving data
getOutputStream
public java.io.OutputStream getOutputStream()
- Description copied from interface:
AnonChannel
- The returned OutputStream could be used to send data.
- Specified by:
getOutputStream
in interface AnonChannel
- Returns:
- OutputStream, useful for sending data
isClosed
public boolean isClosed()
- Specified by:
isClosed
in interface AnonChannel
close
public void close()
- Description copied from interface:
AnonChannel
- Closes the channel and releases all resources used.
- Specified by:
close
in interface AnonChannel
update
public void update(java.util.Observable a_observedObject,
java.lang.Object a_message)
- Specified by:
update
in interface java.util.Observer
getMessageQueuesNotificationsList
protected java.util.Vector getMessageQueuesNotificationsList()
addInputStreamQueueEntry
protected void addInputStreamQueueEntry(DataChainInputStreamQueueEntry a_entry)
createDataChannel
protected AbstractDataChannel createDataChannel()
interruptDownstreamThread
protected void interruptDownstreamThread()
propagateConnectionError
protected void propagateConnectionError()
getOutputBlockSize
public abstract int getOutputBlockSize()
- Description copied from interface:
AnonChannel
- Returns a value that indicates the current optimum size of data to write.. Because often
anon services transport the data splited into packets for optimum performance
it may be good to send data according to the packet size to avoid unneccessary overheads.
- Specified by:
getOutputBlockSize
in interface AnonChannel
- Returns:
- the current optimum size for output data. If 1 is returned the size does not matter.
createPacketPayload
public abstract void createPacketPayload(DataChainSendOrderStructure a_order)
run
public abstract void run()
- Specified by:
run
in interface java.lang.Runnable
orderPacket
protected abstract void orderPacket(DataChainSendOrderStructure a_order)
outputStreamClosed
protected abstract void outputStreamClosed()
throws java.io.IOException
- Throws:
java.io.IOException
closeDataChain
protected abstract void closeDataChain()