public class RecurringRunnableExecutor
extends java.lang.Object
implements java.util.concurrent.Executor
Executor
of
RecurringRunnable
s i.e. asynchronous tasks which determine by
themselves the intervals (the lengths of which may vary) at which they are to
be invoked.
webrtc/modules/utility/interface/process_thread.h
webrtc/modules/utility/source/process_thread_impl.cc
webrtc/modules/utility/source/process_thread_impl.hConstructor and Description |
---|
RecurringRunnableExecutor()
Initializes a new
RecurringRunnableExecutor instance. |
RecurringRunnableExecutor(java.lang.String name)
Initializes a new
RecurringRunnableExecutor instance. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this
RecurringRunnableExecutor , signalling its thread to
stop and de-registering all registered runnables. |
boolean |
deRegisterRecurringRunnable(RecurringRunnable recurringRunnable)
De-registers a
RecurringRunnable from this Executor so
that its Runnable.run() is no longer invoked (by
this instance). |
void |
execute(java.lang.Runnable command)
Accepts for execution
RecurringRunnable s only. |
boolean |
registerRecurringRunnable(RecurringRunnable recurringRunnable)
Registers a
RecurringRunnable with this Executor so
that its Runnable.run() is invoked (by this
instance). |
void |
startOrNotifyThread()
Starts or notifies
thread depending on and in accord with the
state of this instance. |
public RecurringRunnableExecutor()
RecurringRunnableExecutor
instance.public RecurringRunnableExecutor(java.lang.String name)
RecurringRunnableExecutor
instance.name
- a string to be added to the name of the thread which this
instance will start.public boolean deRegisterRecurringRunnable(RecurringRunnable recurringRunnable)
RecurringRunnable
from this Executor
so
that its Runnable.run()
is no longer invoked (by
this instance).recurringRunnable
- the RecurringRunnable
to
de-register from this instancetrue
if the list of RecurringRunnable
s of this
instance changed because of the method call; otherwise, false
public void execute(java.lang.Runnable command)
RecurringRunnable
s only.execute
in interface java.util.concurrent.Executor
public boolean registerRecurringRunnable(RecurringRunnable recurringRunnable)
RecurringRunnable
with this Executor
so
that its Runnable.run()
is invoked (by this
instance).recurringRunnable
- the RecurringRunnable
to register
with this instancetrue
if the list of RecurringRunnable
s of this
instance changed because of the method call; otherwise, false
public void startOrNotifyThread()
thread
depending on and in accord with the
state of this instance.public void close()
RecurringRunnableExecutor
, signalling its thread to
stop and de-registering all registered runnables.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.