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);Subclasses which depend on the proper ordering of either initialization or calls to
onFinished(Response, Status, Current)
should make
use of the initializationDone()
and waitOnInitialization()
,
or the onFinishedDone()
and waitOnFinishedDone()
methods.initializationDone()
,
onFinishedDone()
,
直列化された形式修飾子とタイプ | フィールドと説明 |
---|---|
protected omero.cmd.HandlePrx |
handle
Proxy passed to this instance on creation.
|
コンストラクタと説明 |
---|
CmdCallbackI(client client,
omero.cmd.HandlePrx handle) |
CmdCallbackI(Ice.ObjectAdapter adapter,
java.lang.String category,
omero.cmd.HandlePrx handle) |
修飾子とタイプ | メソッドと説明 |
---|---|
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() |
protected void |
initializationDone()
Subclasses which must perform their own initialization before
onFinished(Response, Status, Current) is called should
call initializationDone() once that setup is complete. |
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.
|
protected void |
onFinishedDone() |
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.
|
protected void |
waitOnFinishedDone() |
protected void |
waitOnInitialization()
Subclasses which must perform their own initialization before
onFinished(Response, Status, Current) is called should
call {@link #waitOnInitialization() before accessing any initialized
state. |
___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, java.lang.String category, omero.cmd.HandlePrx handle) throws omero.ServerError
omero.ServerError
protected void initializationDone()
onFinished(Response, Status, Current)
is called should
call initializationDone()
once that setup is complete.protected void waitOnInitialization()
onFinished(Response, Status, Current)
is called should
call {@link #waitOnInitialization() before accessing any initialized
state.protected void onFinishedDone()
protected void waitOnFinishedDone()
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 java.lang.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.java.lang.InterruptedException
public boolean block(long ms) throws java.lang.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.java.lang.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)