AsyncRunnable, java.io.Closeable, java.lang.AutoCloseableCoroutineBase, CoroutinesExecutorTask, DaemonBasepublic abstract class AsyncRunnableBase extends java.lang.Object implements AsyncRunnable
AsyncRunnable.State| Modifier and Type | Field | Description |
|---|---|---|
protected java.lang.Object |
state |
| Constructor | Description |
|---|---|
AsyncRunnableBase() |
| Modifier and Type | Method | Description |
|---|---|---|
AsyncRunnableBase |
await() |
Wait while the state is STARTED
|
boolean |
await(long timeout,
java.util.concurrent.TimeUnit timeUnit) |
|
void |
close() |
|
protected void |
doClose() |
|
protected void |
doShutdown() |
|
protected void |
doStart() |
|
protected void |
doStop() |
|
boolean |
isClosed() |
|
boolean |
isFinished() |
|
boolean |
isInitial() |
|
boolean |
isShutdown() |
|
boolean |
isStarted() |
|
boolean |
isStopped() |
|
AsyncRunnableBase |
shutdown() |
Notify to stop to enqueue incoming requests.
|
AsyncRunnableBase |
start() |
Start/resume the execution
|
AsyncRunnable.State |
state() |
|
AsyncRunnableBase |
stop() |
Stop (with further resumption capability)
|
public final AsyncRunnable.State state()
state in interface AsyncRunnablepublic boolean isInitial()
isInitial in interface AsyncRunnablepublic boolean isStarted()
isStarted in interface AsyncRunnablepublic boolean isShutdown()
isShutdown in interface AsyncRunnablepublic boolean isStopped()
isStopped in interface AsyncRunnablepublic boolean isFinished()
isFinished in interface AsyncRunnablepublic boolean isClosed()
isClosed in interface AsyncRunnablepublic final AsyncRunnableBase start() throws java.lang.IllegalStateException
AsyncRunnablestart in interface AsyncRunnablejava.lang.IllegalStateException - if the previous state is not INITIAL neither STOPPEDpublic final AsyncRunnableBase shutdown() throws java.lang.IllegalStateException
AsyncRunnableshutdown in interface AsyncRunnablejava.lang.IllegalStateExceptionpublic final AsyncRunnableBase stop() throws java.lang.IllegalStateException, java.rmi.RemoteException
AsyncRunnablestop in interface AsyncRunnablejava.lang.IllegalStateException - if the previous state is not STARTEDjava.rmi.RemoteExceptionpublic final AsyncRunnableBase await() throws java.lang.IllegalStateException, java.lang.InterruptedException
AsyncRunnableawait in interface AsyncRunnablejava.lang.InterruptedExceptionjava.lang.IllegalStateExceptionpublic boolean await(long timeout,
java.util.concurrent.TimeUnit timeUnit)
throws java.lang.IllegalStateException,
java.lang.InterruptedException
await in interface AsyncRunnablejava.lang.IllegalStateExceptionjava.lang.InterruptedExceptionpublic void close()
throws java.lang.IllegalStateException,
java.io.IOException
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablejava.lang.IllegalStateExceptionjava.io.IOExceptionprotected void doStart()
protected void doShutdown()
protected void doStop()
protected void doClose()
throws java.io.IOException
java.io.IOException