org.eclipse.net4j.util.lifecycle
Class Worker

java.lang.Object
  extended by org.eclipse.net4j.util.event.Notifier
      extended by org.eclipse.net4j.util.lifecycle.Lifecycle
          extended by org.eclipse.net4j.util.lifecycle.Worker
All Implemented Interfaces:
INotifier, INotifier.Introspection, ILifecycle, ILifecycle.Introspection
Direct Known Subclasses:
Cache, CacheMonitor, QueueWorker

public abstract class Worker
extends Lifecycle


Nested Class Summary
 class Worker.WorkContext
           
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.Introspection
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
INotifier.Introspection
 
Field Summary
static int DEFAULT_TIMEOUT
           
 
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABEL
 
Constructor Summary
Worker()
           
 
Method Summary
protected  void doActivate()
           
protected  void doDeactivate()
           
 long getActivationTimeout()
           
 long getDeactivationTimeout()
           
protected  java.lang.String getThreadName()
           
 boolean isDaemon()
           
 void setActivationTimeout(long activationTimeout)
           
 void setDaemon(boolean daemon)
           
 void setDeactivationTimeout(long deactivationTimeout)
           
protected abstract  void work(Worker.WorkContext context)
           
 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, checkActive, checkArg, checkArg, checkInactive, checkNull, checkState, checkState, deactivate, deferredActivate, deferredDeactivate, doBeforeActivate, doBeforeDeactivate, dump, getLifecycleState, isActive, isDeferredActivation, isDeferredDeactivation, toString
 
Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, fireEvent, getListeners, hasListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

Worker

public Worker()
Method Detail

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)

doActivate

protected void doActivate()
                   throws java.lang.Exception
Overrides:
doActivate in class Lifecycle
Throws:
java.lang.Exception

doDeactivate

protected void doDeactivate()
                     throws java.lang.Exception
Overrides:
doDeactivate in class Lifecycle
Throws:
java.lang.Exception

getThreadName

protected java.lang.String getThreadName()

work

protected abstract void work(Worker.WorkContext context)
                      throws java.lang.Exception
Throws:
java.lang.Exception

Copyright (c) 2004 - 2008 Eike Stepper, Germany.
All Rights Reserved.