|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.norther.tammi.core.base.Adaptee
org.norther.tammi.core.thread.AbstractExecutor
public abstract class AbstractExecutor
An abstract implementation of Executor.
| Field Summary |
|---|
| Fields inherited from class org.norther.tammi.core.base.Adaptee |
|---|
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS |
| Constructor Summary | |
|---|---|
AbstractExecutor()
Constructs a new executor. |
|
| Method Summary | ||
|---|---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit)
|
|
void |
execute(Runnable task)
|
|
int |
getActiveCount()
Gets the number of currently running tasks. |
|
long |
getCompletedTaskCount()
Gets the total number of completed tasks. |
|
protected ExecutorService |
getExecutor()
Gets the implementation of the executor. |
|
long |
getTaskCount()
Gets the total number of completed, active or scheduled tasks. |
|
|
invokeAll(Collection<? extends Callable<T>> tasks)
|
|
|
invokeAll(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)
|
|
|
invokeAny(Collection<? extends Callable<T>> tasks)
|
|
|
invokeAny(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)
|
|
boolean |
isShutdown()
|
|
boolean |
isStarted()
Checks whether the startable has been started. |
|
boolean |
isTerminated()
|
|
protected abstract ExecutorService |
newExecutor()
Creates the implementation of the executor. |
|
void |
postmanaged()
This method is called when the implementing adaptee has been managed either during post-registration of the corresponding adapter MBean or just after it is explicitly added to the adapter MBean during run-time. |
|
void |
shutdown()
|
|
List<Runnable> |
shutdownNow()
|
|
void |
start()
Starts the MBean. |
|
void |
stop()
Stops the MBean. |
|
|
submit(Callable<T> task)
|
|
Future<?> |
submit(Runnable task)
|
|
|
submit(Runnable task,
T result)
|
|
void |
unmanaged()
This method is called when the implementing adaptee is unmanaged either during pre-deregistration of the corresponding adapter MBean or just before it is explicitly removed from the adapter MBean during run-time. |
|
| Methods inherited from class org.norther.tammi.core.base.Adaptee |
|---|
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractExecutor()
| Method Detail |
|---|
public void postmanaged()
Manageable
postmanaged in interface Manageablepostmanaged in class Adaptee
public void unmanaged()
throws Exception
Manageable
unmanaged in interface Manageableunmanaged in class AdapteeException - if the adaptee refused to be unmanaged.public boolean isStarted()
Startable
isStarted in interface Startable
public void start()
throws Exception
Startable
start in interface StartableException - if start fails.public void stop()
Startable
stop in interface Startable
public boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface ExecutorServiceInterruptedExceptionpublic boolean isShutdown()
isShutdown in interface ExecutorServicepublic boolean isTerminated()
isTerminated in interface ExecutorServicepublic void shutdown()
shutdown in interface ExecutorServicepublic List<Runnable> shutdownNow()
shutdownNow in interface ExecutorService
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)
throws InterruptedException
invokeAll in interface ExecutorServiceInterruptedException
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks)
throws InterruptedException
invokeAll in interface ExecutorServiceInterruptedException
public <T> T invokeAny(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit)
throws InterruptedException,
ExecutionException,
TimeoutException
invokeAny in interface ExecutorServiceInterruptedException
ExecutionException
TimeoutException
public <T> T invokeAny(Collection<? extends Callable<T>> tasks)
throws InterruptedException,
ExecutionException
invokeAny in interface ExecutorServiceInterruptedException
ExecutionExceptionpublic <T> Future<T> submit(Callable<T> task)
submit in interface ExecutorService
public <T> Future<T> submit(Runnable task,
T result)
submit in interface ExecutorServicepublic Future<?> submit(Runnable task)
submit in interface ExecutorServicepublic void execute(Runnable task)
execute in interface Executorpublic long getCompletedTaskCount()
Executor
public int getActiveCount()
Executor
public long getTaskCount()
Executor
protected ExecutorService getExecutor()
protected abstract ExecutorService newExecutor()
NullPointerException - for missing resources.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||