Package jadex.bridge.component.streams
Class OutputConnection
- java.lang.Object
- 
- jadex.bridge.component.streams.AbstractConnection
- 
- jadex.bridge.component.streams.OutputConnection
 
 
- 
- All Implemented Interfaces:
- IConnection,- IOutputConnection
 
 public class OutputConnection extends AbstractConnection implements IOutputConnection Output connection for writing data. Must synchronized its internal data because the connection handler and the connection user (i.e. a component) are using the connection concurrently. - the user calls interface methods like write and flush - the connection handler calls close to signal that the connection should close.
- 
- 
Field Summary- 
Fields inherited from class jadex.bridge.component.streams.AbstractConnectionch, closed, closing, id, ini, inited, initiator, input, participant
 
- 
 - 
Constructor SummaryConstructors Constructor Description OutputConnection(IComponentIdentifier sender, IComponentIdentifier receiver, int id, boolean initiator, IOutputConnectionHandler ch)Create a new connection.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the connection.voidflush()Flush the data.IFuture<java.lang.Integer>waitForReady()Wait until the connection is ready for the next write.IFuture<java.lang.Void>write(byte[] data)Write the content to the stream.ISubscriptionIntermediateFuture<java.lang.Long>writeFromInputStream(java.io.InputStream is, IExternalAccess component)Do write all data from the input stream.- 
Methods inherited from class jadex.bridge.component.streams.AbstractConnectiongetConnectionHandler, getConnectionId, getInitiator, getNonFunctionalProperties, getParticipant, isClosed, isClosing, isInited, isInitiatorSide, isInputConnection, setClosed, setClosing, setInited
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface jadex.bridge.IConnectiongetConnectionId, getInitiator, getNonFunctionalProperties, getParticipant
 
- 
 
- 
- 
- 
Constructor Detail- 
OutputConnectionpublic OutputConnection(IComponentIdentifier sender, IComponentIdentifier receiver, int id, boolean initiator, IOutputConnectionHandler ch) Create a new connection.
 
- 
 - 
Method Detail- 
writepublic IFuture<java.lang.Void> write(byte[] data) Write the content to the stream.- Specified by:
- writein interface- IOutputConnection
- Parameters:
- data- The data.
 
 - 
flushpublic void flush() Flush the data.- Specified by:
- flushin interface- IOutputConnection
 
 - 
waitForReadypublic IFuture<java.lang.Integer> waitForReady() Wait until the connection is ready for the next write.- Specified by:
- waitForReadyin interface- IOutputConnection
- Returns:
- Calls future when next data can be written. Provides a value of how much data should be given to the connection for best performance.
 
 - 
closepublic void close() Close the connection. Notifies the other side that the connection has been closed.- Specified by:
- closein interface- IConnection
- Overrides:
- closein class- AbstractConnection
 
 - 
writeFromInputStreampublic ISubscriptionIntermediateFuture<java.lang.Long> writeFromInputStream(java.io.InputStream is, IExternalAccess component) Do write all data from the input stream.- Specified by:
- writeFromInputStreamin interface- IOutputConnection
- Parameters:
- is- The input stream.
 
 
- 
 
-