public interface RemoteInvocationQueue extends AttributeReadId<String>, AttributeWriteDefaultFailureCallback
RemoteInvocationService
s. It acts like a transaction that can be
committed
or cancelled
. While the queue is
open
, the user can add invocations for a
RemoteInvocationService
to the queue. This can be repeated and will
collect the service invocations. In order to send these invocations to the server use the commit()
method. This approach typically gains performance (especially reduces overall latency) if multiple service
methods have to be called in a row.Modifier and Type | Method and Description |
---|---|
void |
cancel()
This method cancels this queue.
|
void |
commit()
This method completes this queue.
|
Consumer<Throwable> |
getDefaultFailureCallback()
This method gets the default callback to
handle failures that occurred on
service invocations. |
String |
getId()
This method gets the ID used to identify this object.
|
RemoteInvocationQueueState |
getState()
This method gets the
RemoteInvocationQueueState of this queue. |
setDefaultFailureCallback
Consumer<Throwable> getDefaultFailureCallback()
handle
failures that occurred on
service invocations.
It will be used as fallback if no failure callback is specified explicitly. Queues
will inherit the default failure callback from their parent. A toplevel queue inherits from the
invocation caller
.getDefaultFailureCallback
in interface AttributeReadDefaultFailureCallback
null
if no default is configured.String getId()
getId
in interface AttributeReadId<String>
RemoteInvocationCaller.newQueue(String)
RemoteInvocationQueueState getState()
RemoteInvocationQueueState
of this queue. The
RemoteInvocationQueueState
of a
new queue
is initially
RemoteInvocationQueueState.OPEN
. After commit()
is called the status turns to
RemoteInvocationQueueState.COMITTED
. After cancel()
is called it turns to
RemoteInvocationQueueState.CANCELLED
. As soon as the status is closed (NOT
RemoteInvocationQueueState.OPEN
), it can NOT be opened anymore and further adding of service
invocations to the queue will fail.RemoteInvocationQueueState
of this queue.void commit()
commit()
. Otherwise, if this is a sub-queue (a queue
created
while another queue was
already open
), the collected invocations will be
appended to the parent queue. closing
the queue.
Therefore it is totally legal to open a queue in your generic infrastructure by default then perform some
sort of initialization that may or may not cause service invocations on that queue and finally commit the
queue.void cancel()
Copyright © 2001–2016 mmm-Team. All rights reserved.