public class CmdCallbackI
extends omero.cmd._CmdCallbackDisp
cb = new CmdCallbackI(client, handle); response = null; while (response == null) { response = cb.block(500); } // or response = cb.loop(5, 500);
Modifier and Type | Field and Description |
---|---|
protected omero.cmd.HandlePrx |
handle
Proxy passed to this instance on creation.
|
Constructor and Description |
---|
CmdCallbackI(client client,
omero.cmd.HandlePrx handle) |
CmdCallbackI(Ice.ObjectAdapter adapter,
String category,
omero.cmd.HandlePrx handle) |
Modifier and Type | Method and Description |
---|---|
boolean |
block(long ms)
Blocks for the given number of milliseconds unless
finished(Response, Status, Current) has been called in which case
it returns immediately with true. |
void |
close(boolean closeHandle)
First removes self from the adapter so as to no longer receive
notifications, and the calls close on the remote handle if requested.
|
void |
finished(omero.cmd.Response rsp,
omero.cmd.Status status,
Ice.Current __current)
Called when the command has completed.
|
omero.cmd.Response |
getResponse()
Returns possibly null Response value.
|
omero.cmd.Status |
getStatus()
Returns possibly null Status value.
|
protected omero.cmd.Status |
getStatusOrThrow() |
boolean |
isCancelled()
Returns whether Status::CANCELLED is contained in
the flags variable of the Status instance.
|
boolean |
isFailure()
Returns whether Status::FAILURE is contained in
the flags variable of the Status instance.
|
omero.cmd.Response |
loop(int loops,
long ms)
Calls block(long) "loops" number of times with the "ms"
argument.
|
void |
onFinished(omero.cmd.Response rsp,
omero.cmd.Status status,
Ice.Current __current)
Method intended to be overridden by subclasses.
|
void |
poll()
Calls
HandlePrx.getResponse() in order to check for a non-null
value. |
void |
step(int complete,
int total,
Ice.Current __current)
Called periodically by the server to signal that processing is
moving forward.
|
___finished, ___step, __dispatch, __read, __read, __write, __write, finished, ice_copyStateFrom, ice_id, ice_id, ice_ids, ice_ids, ice_isA, ice_isA, ice_staticId, step
___ice_id, ___ice_ids, ___ice_isA, ___ice_ping, __checkMode, __collocDispatch, clone, ice_dispatch, ice_dispatch, ice_hash, ice_operationAttributes, ice_ping, ice_ping, ice_postUnmarshal, ice_preMarshal
protected final omero.cmd.HandlePrx handle
public CmdCallbackI(client client, omero.cmd.HandlePrx handle) throws omero.ServerError
omero.ServerError
public CmdCallbackI(Ice.ObjectAdapter adapter, String category, omero.cmd.HandlePrx handle) throws omero.ServerError
omero.ServerError
public omero.cmd.Response getResponse()
public omero.cmd.Status getStatus()
protected omero.cmd.Status getStatusOrThrow()
public boolean isCancelled()
public boolean isFailure()
public omero.cmd.Response loop(int loops, long ms) throws InterruptedException, omero.LockTimeout
loops
- Number of times to call block(long)ms
- Number of milliseconds to pass to block(longomero.LockTimeout
- if block(long) does not return
a non-null value after loops calls.InterruptedException
public boolean block(long ms) throws InterruptedException
finished(Response, Status, Current)
has been called in which case
it returns immediately with true. If false is returned, then the timeout
was reached.ms
- Milliseconds which this method should block for.InterruptedException
public void poll()
HandlePrx.getResponse()
in order to check for a non-null
value. If so, _HandleOperations.getStatus(Ice.Current)
is also called, and the two
non-null values are passed to
finished(Response, Status, Current)
. This should typically
not be used. Instead, favor the use of block and loop.public void step(int complete, int total, Ice.Current __current)
public final void finished(omero.cmd.Response rsp, omero.cmd.Status status, Ice.Current __current)
public void onFinished(omero.cmd.Response rsp, omero.cmd.Status status, Ice.Current __current)
public void close(boolean closeHandle)
Version: 4.4.12-ice34-b116
Copyright © 2014 The University of Dundee & Open Microscopy Environment. All Rights Reserved.