public class AsyncOperation
extends java.lang.Object
AsyncSession
Modifier and Type | Class and Description |
---|---|
static class |
AsyncOperation.OperationType |
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_MERGE_TX |
static int |
FLAG_STOP_QUEUE_ON_EXCEPTION
TODO unused, just an idea
|
static int |
FLAG_TRACK_CREATOR_STACKTRACE |
Modifier and Type | Method and Description |
---|---|
java.lang.Exception |
getCreatorStacktrace()
The stacktrace is captured using an exception if
FLAG_TRACK_CREATOR_STACKTRACE was used (null
otherwise). |
long |
getDuration() |
int |
getMergedOperationsCount()
If this operation was successfully merged with other operation into a single TX, this will give the count of
merged operations.
|
java.lang.Object |
getParameter() |
java.lang.Object |
getResult()
The operation's result after it has completed.
|
int |
getSequenceNumber()
Each operation get a unique sequence number when the operation is enqueued.
|
java.lang.Throwable |
getThrowable() |
long |
getTimeCompleted() |
long |
getTimeStarted() |
AsyncOperation.OperationType |
getType() |
boolean |
isCompleted() |
boolean |
isCompletedSucessfully() |
boolean |
isFailed() |
boolean |
isMergeTx() |
void |
setThrowable(java.lang.Throwable throwable) |
java.lang.Object |
waitForCompletion()
Waits until the operation is complete.
|
boolean |
waitForCompletion(int maxMillis)
Waits until the operation is complete, but at most the given amount of milliseconds.If the thread gets
interrupted, any
InterruptedException will be rethrown as a DaoException . |
public static final int FLAG_MERGE_TX
public static final int FLAG_STOP_QUEUE_ON_EXCEPTION
public static final int FLAG_TRACK_CREATOR_STACKTRACE
public java.lang.Throwable getThrowable()
public void setThrowable(java.lang.Throwable throwable)
public AsyncOperation.OperationType getType()
public java.lang.Object getParameter()
public java.lang.Object getResult()
{@link
- AsyncDaoException} if the operation produced an exceptionwaitForCompletion()
public boolean isMergeTx()
public long getTimeStarted()
public long getTimeCompleted()
public long getDuration()
public boolean isFailed()
public boolean isCompleted()
public java.lang.Object waitForCompletion()
InterruptedException
will be
rethrown as a DaoException
.getResult()
public boolean waitForCompletion(int maxMillis)
InterruptedException
will be rethrown as a DaoException
.public boolean isCompletedSucessfully()
public int getMergedOperationsCount()
public int getSequenceNumber()
public java.lang.Exception getCreatorStacktrace()
FLAG_TRACK_CREATOR_STACKTRACE
was used (null
otherwise).Available under the Apache License, Version 2.0 - Copyright © 2011-2015 greenrobot.de. All Rights Reserved.