Class Worker
- java.lang.Object
- 
- org.eclipse.net4j.util.event.Notifier
- 
- org.eclipse.net4j.util.lifecycle.Lifecycle
- 
- org.eclipse.net4j.util.concurrent.Worker
 
 
 
- 
- All Implemented Interfaces:
- INotifier,- INotifier.INotifier2,- IDeactivateable,- ILifecycle,- ILifecycle.DeferrableActivation
 - Direct Known Subclasses:
- Cache,- CacheMonitor,- QueueWorker,- ReferenceQueueWorker,- RollingLog
 
 public abstract class Worker extends Lifecycle - Since:
- 2.0
- Author:
- Eike Stepper
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classWorker.WorkContext- 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycleILifecycle.DeferrableActivation
 - 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifierINotifier.INotifier2
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static IErrorHandlerDEFAULT_ERROR_HANDLERstatic intDEFAULT_TIMEOUT
 - 
Constructor SummaryConstructors Constructor Description Worker()
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoActivate()protected voiddoDeactivate()longgetActivationTimeout()longgetDeactivationTimeout()static IErrorHandlergetGlobalErrorHandler()protected java.lang.StringgetThreadName()org.eclipse.net4j.util.concurrent.Worker.WorkerThreadgetWorkerThread()protected voidhandleError(java.lang.Exception ex)booleanisDaemon()voidsetActivationTimeout(long activationTimeout)voidsetDaemon(boolean daemon)voidsetDeactivationTimeout(long deactivationTimeout)static IErrorHandlersetGlobalErrorHandler(IErrorHandler globalErrorHandler)protected abstract voidwork(Worker.WorkContext context)- 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycleactivate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, doAfterActivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, toString
 - 
Methods inherited from class org.eclipse.net4j.util.event.NotifieraddListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListener
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.eclipse.net4j.util.event.INotifieraddListener, getListeners, hasListeners, removeListener
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_TIMEOUTpublic static final int DEFAULT_TIMEOUT - See Also:
- Constant Field Values
 
 - 
DEFAULT_ERROR_HANDLERpublic static final IErrorHandler DEFAULT_ERROR_HANDLER - Since:
- 3.0
 
 
- 
 - 
Method Detail- 
isDaemonpublic boolean isDaemon() 
 - 
setDaemonpublic void setDaemon(boolean daemon) 
 - 
getActivationTimeoutpublic long getActivationTimeout() 
 - 
setActivationTimeoutpublic void setActivationTimeout(long activationTimeout) 
 - 
getDeactivationTimeoutpublic long getDeactivationTimeout() 
 - 
setDeactivationTimeoutpublic void setDeactivationTimeout(long deactivationTimeout) 
 - 
getWorkerThreadpublic org.eclipse.net4j.util.concurrent.Worker.WorkerThread getWorkerThread() - Since:
- 3.6
 
 - 
doActivateprotected void doActivate() throws java.lang.Exception- Overrides:
- doActivatein class- Lifecycle
- Throws:
- java.lang.Exception
 
 - 
doDeactivateprotected void doDeactivate() throws java.lang.Exception- Overrides:
- doDeactivatein class- Lifecycle
- Throws:
- java.lang.Exception
 
 - 
getThreadNameprotected java.lang.String getThreadName() 
 - 
handleErrorprotected void handleError(java.lang.Exception ex) - Since:
- 3.1
 
 - 
workprotected abstract void work(Worker.WorkContext context) throws java.lang.Exception - Throws:
- java.lang.Exception
 
 - 
getGlobalErrorHandlerpublic static IErrorHandler getGlobalErrorHandler() - Since:
- 3.0
 
 - 
setGlobalErrorHandlerpublic static IErrorHandler setGlobalErrorHandler(IErrorHandler globalErrorHandler) - Since:
- 3.0
 
 
- 
 
-