public abstract class AbstractAsyncHandlerProvider extends Object implements IAsyncHandlerProvider
Modifier and Type | Class and Description |
---|---|
static class |
AbstractAsyncHandlerProvider.ClosedProviderAsyncHandler |
IAsyncHandlerProvider.CycleResult
Modifier and Type | Field and Description |
---|---|
protected Object |
_stateLock |
Constructor and Description |
---|
AbstractAsyncHandlerProvider() |
Modifier and Type | Method and Description |
---|---|
boolean |
addStateListener(IAsyncHandlerProviderStateListener listener)
Adds a state listener to be notified on this provider state changes events
|
void |
close()
Close the async handler provider
|
boolean |
isClosed()
Specifies is this async handler provider is already closed
|
protected abstract void |
onClose() |
void |
removeStateListener(IAsyncHandlerProviderStateListener listener)
Removes the specified state listener
|
IAsyncHandler |
start(AsyncCallable callable,
long idleDelayMilis,
String name,
boolean waitIdleDelayBeforeStart)
Start executing a runnable in a repetitive manner.
|
protected abstract IAsyncHandler |
startImpl(AsyncCallable callable,
long idleDelayMilis,
String name,
boolean waitIdleDelayBeforeStart) |
IAsyncHandler |
startMayBlock(AsyncCallable callable,
long idleDelayMilis,
String name,
boolean waitIdleDelayBeforeStart)
Start executing a runnable in a repetitive manner, the task may block during its process so
the provider must be able to support this.
|
protected abstract IAsyncHandler |
startMayBlockImpl(AsyncCallable callable,
long idleDelayMilis,
String name,
boolean waitIdleDelayBeforeStart) |
protected final Object _stateLock
public IAsyncHandler start(AsyncCallable callable, long idleDelayMilis, String name, boolean waitIdleDelayBeforeStart)
IAsyncHandlerProvider
start
in interface IAsyncHandlerProvider
callable
- the runnable to execute at each iterationidleDelayMilis
- the delay between each iteration when the runnable returned a
IAsyncHandlerProvider.CycleResult.IDLE_CONTINUE
name
- hint name for the async handler if supportedwaitIdleDelayBeforeStart
- should the task run for the first time only after
idleDelayMillisIAsyncHandler.isTerminated()
.protected abstract IAsyncHandler startImpl(AsyncCallable callable, long idleDelayMilis, String name, boolean waitIdleDelayBeforeStart)
public IAsyncHandler startMayBlock(AsyncCallable callable, long idleDelayMilis, String name, boolean waitIdleDelayBeforeStart)
IAsyncHandlerProvider
startMayBlock
in interface IAsyncHandlerProvider
callable
- the runnable to execute at each iterationidleDelayMilis
- the delay between each iteration when the runnable returned a
IAsyncHandlerProvider.CycleResult.IDLE_CONTINUE
name
- hint name for the async handler if supportedwaitIdleDelayBeforeStart
- should the task run for the first time only after
idleDelayMillisIAsyncHandler.isTerminated()
.protected abstract IAsyncHandler startMayBlockImpl(AsyncCallable callable, long idleDelayMilis, String name, boolean waitIdleDelayBeforeStart)
public void close()
IAsyncHandlerProvider
close
in interface IAsyncHandlerProvider
protected abstract void onClose()
public boolean isClosed()
IAsyncHandlerProvider
isClosed
in interface IAsyncHandlerProvider
public boolean addStateListener(IAsyncHandlerProviderStateListener listener)
IAsyncHandlerProvider
addStateListener
in interface IAsyncHandlerProvider
public void removeStateListener(IAsyncHandlerProviderStateListener listener)
IAsyncHandlerProvider
removeStateListener
in interface IAsyncHandlerProvider
Copyright © GigaSpaces.