Class ServiceInputConnectionProxy
- java.lang.Object
-
- jadex.bridge.service.types.remote.ServiceInputConnectionProxy
-
- All Implemented Interfaces:
IConnection
,IInputConnection
public class ServiceInputConnectionProxy extends java.lang.Object implements IInputConnection
-
-
Field Summary
Fields Modifier and Type Field Description protected ServiceOutputConnection
con
The original connection (not transferred).protected int
conid
The connection id.protected IComponentIdentifier
initiator
The initiator id.protected java.util.Map<java.lang.String,java.lang.Object>
nonfunc
The non-functional properties.protected IComponentIdentifier
participant
The participant id.
-
Constructor Summary
Constructors Constructor Description ServiceInputConnectionProxy()
ServiceInputConnectionProxy(ServiceOutputConnection con)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ISubscriptionIntermediateFuture<byte[]>
aread()
Asynchronous read.int
available()
Get the number of available bytes.void
close()
Close the connection.int
getConnectionId()
Get the connectionid.IComponentIdentifier
getInitiator()
Get the initiator id.java.util.Map<java.lang.String,java.lang.Object>
getNonFunctionalProperties()
Get the non-functional properties of the connection.IComponentIdentifier
getParticipant()
Get the participant id.int
read()
Non-blocking read.int
read(byte[] buffer)
Non-blocking read.void
setConnectionId(int conid)
Set the connectionid.void
setInitiator(IComponentIdentifier initiator)
Set the initiator.void
setNonFunctionalProperties(java.util.Map<java.lang.String,java.lang.Object> nonfunc)
Set the non-functional properties of the connection.void
setOutputConnection(IOutputConnection ocon)
void
setParticipant(IComponentIdentifier participant)
Set the participant.ISubscriptionIntermediateFuture<java.lang.Long>
writeToOutputStream(java.io.OutputStream os, IExternalAccess component)
Read all data from output stream to the connection.
-
-
-
Field Detail
-
con
protected ServiceOutputConnection con
The original connection (not transferred).
-
conid
protected int conid
The connection id.
-
initiator
protected IComponentIdentifier initiator
The initiator id.
-
participant
protected IComponentIdentifier participant
The participant id.
-
nonfunc
protected java.util.Map<java.lang.String,java.lang.Object> nonfunc
The non-functional properties.
-
-
Constructor Detail
-
ServiceInputConnectionProxy
public ServiceInputConnectionProxy()
-
ServiceInputConnectionProxy
public ServiceInputConnectionProxy(ServiceOutputConnection con)
-
-
Method Detail
-
setOutputConnection
public void setOutputConnection(IOutputConnection ocon)
-
getConnectionId
public int getConnectionId()
Get the connectionid.- Specified by:
getConnectionId
in interfaceIConnection
- Returns:
- The connectionid.
-
setConnectionId
public void setConnectionId(int conid)
Set the connectionid.- Parameters:
connectionid
- The connectionid to set.
-
getInitiator
public IComponentIdentifier getInitiator()
Get the initiator id.- Specified by:
getInitiator
in interfaceIConnection
- Returns:
- The initiator id.
-
setInitiator
public void setInitiator(IComponentIdentifier initiator)
Set the initiator.- Parameters:
initiator
- The initiator to set.
-
getParticipant
public IComponentIdentifier getParticipant()
Get the participant id.- Specified by:
getParticipant
in interfaceIConnection
- Returns:
- The participant id.
-
setParticipant
public void setParticipant(IComponentIdentifier participant)
Set the participant.- Parameters:
participant
- The participant to set.
-
getNonFunctionalProperties
public java.util.Map<java.lang.String,java.lang.Object> getNonFunctionalProperties()
Get the non-functional properties of the connection.- Specified by:
getNonFunctionalProperties
in interfaceIConnection
- Returns:
- The properties.
-
setNonFunctionalProperties
public void setNonFunctionalProperties(java.util.Map<java.lang.String,java.lang.Object> nonfunc)
Set the non-functional properties of the connection.- Parameters:
nonfunc
- The properties.
-
read
public int read(byte[] buffer)
Description copied from interface:IInputConnection
Non-blocking read. Tries to fill the buffer from the stream.- Specified by:
read
in interfaceIInputConnection
- Parameters:
buffer
- The buffer to read in.- Returns:
- The number of bytes that could be read into the buffer.
-
read
public int read()
Description copied from interface:IInputConnection
Non-blocking read. Tries to read the next byte.- Specified by:
read
in interfaceIInputConnection
- Returns:
- The next byte or -1 if the end of the stream has been reached.
-
available
public int available()
Get the number of available bytes.- Specified by:
available
in interfaceIInputConnection
- Returns:
- The number of available bytes.
-
close
public void close()
Description copied from interface:IConnection
Close the connection.- Specified by:
close
in interfaceIConnection
-
aread
public ISubscriptionIntermediateFuture<byte[]> aread()
Description copied from interface:IInputConnection
Asynchronous read.- Specified by:
aread
in interfaceIInputConnection
- Returns:
- Bytes one by one till end of stream or closed.
-
writeToOutputStream
public ISubscriptionIntermediateFuture<java.lang.Long> writeToOutputStream(java.io.OutputStream os, IExternalAccess component)
Read all data from output stream to the connection. The result is an intermediate future that reports back the size that was read. It can also be used to terminate reading.- Specified by:
writeToOutputStream
in interfaceIInputConnection
- Parameters:
is
- The input stream.component
- The component.
-
-