
public abstract class Worker extends Lifecycle
| Modifier and Type | Class and Description |
|---|---|
class |
Worker.WorkContext |
ILifecycle.DeferrableActivation| Modifier and Type | Field and Description |
|---|---|
static IErrorHandler |
DEFAULT_ERROR_HANDLER |
static int |
DEFAULT_TIMEOUT |
| Constructor and Description |
|---|
Worker() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doActivate() |
protected void |
doDeactivate() |
long |
getActivationTimeout() |
long |
getDeactivationTimeout() |
static IErrorHandler |
getGlobalErrorHandler() |
protected String |
getThreadName() |
protected void |
handleError(Exception ex) |
boolean |
isDaemon() |
void |
setActivationTimeout(long activationTimeout) |
void |
setDaemon(boolean daemon) |
void |
setDeactivationTimeout(long deactivationTimeout) |
static IErrorHandler |
setGlobalErrorHandler(IErrorHandler globalErrorHandler) |
protected abstract void |
work(Worker.WorkContext context) |
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toStringaddListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddListener, getListeners, hasListeners, removeListenerpublic static final int DEFAULT_TIMEOUT
public static final IErrorHandler DEFAULT_ERROR_HANDLER
public boolean isDaemon()
public void setDaemon(boolean daemon)
public long getActivationTimeout()
public void setActivationTimeout(long activationTimeout)
public long getDeactivationTimeout()
public void setDeactivationTimeout(long deactivationTimeout)
protected void doActivate()
throws Exception
doActivate in class LifecycleExceptionprotected void doDeactivate()
throws Exception
doDeactivate in class LifecycleExceptionprotected String getThreadName()
protected void handleError(Exception ex)
protected abstract void work(Worker.WorkContext context) throws Exception
Exceptionpublic static IErrorHandler getGlobalErrorHandler()
public static IErrorHandler setGlobalErrorHandler(IErrorHandler globalErrorHandler)
Copyright (c) 2011-2014 Eike Stepper (Berlin, Germany) and others.