Class 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
  • Field Details

    • DEFAULT_TIMEOUT

      public static final int DEFAULT_TIMEOUT
      See Also:
    • DEFAULT_ERROR_HANDLER

      public static final IErrorHandler DEFAULT_ERROR_HANDLER
      Since:
      3.0
  • Constructor Details

    • Worker

      public Worker()
  • Method Details

    • isDaemon

      public boolean isDaemon()
    • setDaemon

      public void setDaemon(boolean daemon)
    • getActivationTimeout

      public long getActivationTimeout()
    • setActivationTimeout

      public void setActivationTimeout(long activationTimeout)
    • getDeactivationTimeout

      public long getDeactivationTimeout()
    • setDeactivationTimeout

      public void setDeactivationTimeout(long deactivationTimeout)
    • getWorkerThread

      public org.eclipse.net4j.util.concurrent.Worker.WorkerThread getWorkerThread()
      Since:
      3.6
    • doActivate

      protected void doActivate() throws Exception
      Overrides:
      doActivate in class Lifecycle
      Throws:
      Exception
    • doDeactivate

      protected void doDeactivate() throws Exception
      Overrides:
      doDeactivate in class Lifecycle
      Throws:
      Exception
    • getThreadName

      protected String getThreadName()
    • handleError

      protected void handleError(Exception ex)
      Since:
      3.1
    • work

      protected abstract void work(Worker.WorkContext context) throws Exception
      Throws:
      Exception
    • getGlobalErrorHandler

      public static IErrorHandler getGlobalErrorHandler()
      Since:
      3.0
    • setGlobalErrorHandler

      public static IErrorHandler setGlobalErrorHandler(IErrorHandler globalErrorHandler)
      Since:
      3.0