public abstract class AbstractSendTask extends java.lang.Object implements ISendTask
Modifier and Type | Field and Description |
---|---|
protected boolean |
acquired
True, if the token is acquired.
|
protected byte[] |
codecids
The codecids.
|
protected jadex.bridge.service.types.message.ICodec[] |
codecs
The codecs.
|
protected byte[] |
data
The encoded message envelope.
|
protected jadex.bridge.service.types.message.IEncodingContext |
encodingcontext
The encoding context
|
protected jadex.commons.future.Future<java.lang.Void> |
future
The future for the sending result.
|
protected int |
interest
Is some transport interested in the task?
|
protected java.util.Map<java.lang.String,java.lang.Object> |
nonfunc
The non-functional properties.
|
protected byte[] |
prolog
The message prolog.
|
protected jadex.bridge.ITransportComponentIdentifier[] |
receivers
The managed receivers.
|
protected java.util.List<ITransport> |
transports
The transports to be tried.
|
protected java.util.List<jadex.commons.IResultCommand<jadex.commons.future.IFuture<java.lang.Void>,java.lang.Void>> |
waiting
The list of waiting transports.
|
Constructor and Description |
---|
AbstractSendTask(AbstractSendTask task)
Shallow copy a task.
|
AbstractSendTask(jadex.bridge.ITransportComponentIdentifier[] receivers,
ITransport[] transports,
jadex.bridge.service.types.message.ICodec[] codecs,
java.util.Map<java.lang.String,java.lang.Object> nonfunc)
Create a new task.
|
Modifier and Type | Method and Description |
---|---|
protected void |
done(java.lang.Exception e)
The message sending is done.
|
void |
doSendMessage()
Use transports to send the message.
|
protected byte[] |
encode(java.lang.Object obj,
jadex.bridge.service.types.message.IEncodingContext context)
Encode the object with the codecs.
|
protected abstract byte[] |
fetchData()
Provide the data as a byte array.
|
protected abstract byte[] |
fetchProlog()
Provide the prolog as a byte array.
|
byte[] |
getData()
Get the encoded message.
|
jadex.commons.future.Future<java.lang.Void> |
getFuture()
Get the future.
|
abstract java.lang.Object |
getMessage()
Get the message.
|
abstract jadex.bridge.service.types.message.MessageType |
getMessageType()
Get the messagetype.
|
java.util.Map<java.lang.String,java.lang.Object> |
getNonFunctionalProperties()
Get the non-functional requirements.
|
byte[] |
getProlog()
Get the prolog bytes.
|
jadex.bridge.IComponentIdentifier[] |
getReceivers()
Get the receivers.
|
java.util.List<ITransport> |
getTransports()
Get the transports.
|
void |
ready(jadex.commons.IResultCommand<jadex.commons.future.IFuture<java.lang.Void>,java.lang.Void> send)
Called by the transport when is is ready to send the message,
i.e.
|
protected volatile byte[] data
protected volatile byte[] prolog
protected byte[] codecids
protected jadex.bridge.service.types.message.ICodec[] codecs
protected jadex.bridge.service.types.message.IEncodingContext encodingcontext
protected jadex.bridge.ITransportComponentIdentifier[] receivers
protected java.util.List<ITransport> transports
protected java.util.Map<java.lang.String,java.lang.Object> nonfunc
protected jadex.commons.future.Future<java.lang.Void> future
protected int interest
protected boolean acquired
protected java.util.List<jadex.commons.IResultCommand<jadex.commons.future.IFuture<java.lang.Void>,java.lang.Void>> waiting
public AbstractSendTask(jadex.bridge.ITransportComponentIdentifier[] receivers, ITransport[] transports, jadex.bridge.service.types.message.ICodec[] codecs, java.util.Map<java.lang.String,java.lang.Object> nonfunc)
public AbstractSendTask(AbstractSendTask task)
public abstract jadex.bridge.service.types.message.MessageType getMessageType()
public abstract java.lang.Object getMessage()
getMessage
in interface ISendTask
public jadex.bridge.IComponentIdentifier[] getReceivers()
getReceivers
in interface ISendTask
public java.util.List<ITransport> getTransports()
public jadex.commons.future.Future<java.lang.Void> getFuture()
public byte[] getData()
protected abstract byte[] fetchData()
public byte[] getProlog()
protected abstract byte[] fetchProlog()
public java.util.Map<java.lang.String,java.lang.Object> getNonFunctionalProperties()
getNonFunctionalProperties
in interface ISendTask
public void doSendMessage()
public void ready(jadex.commons.IResultCommand<jadex.commons.future.IFuture<java.lang.Void>,java.lang.Void> send)
protected void done(java.lang.Exception e)
e
- The exception (if any). Null denotes successful sending.protected byte[] encode(java.lang.Object obj, jadex.bridge.service.types.message.IEncodingContext context)