org.eclipse.net4j.util.ref
Class ReferenceQueueWorker<T>

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.concurrent.Worker
              extended by org.eclipse.net4j.util.ref.ReferenceQueueWorker<T>
All Implemented Interfaces:
INotifier, ILifecycle, ILifecycle.DeferrableActivation

public abstract class ReferenceQueueWorker<T>
extends Worker

Since:
2.0

Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.net4j.util.concurrent.Worker
Worker.WorkContext
 
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.DeferrableActivation
 
Field Summary
static int ALL_WORK_PER_POLL
           
static int DEFAULT_MAX_WORK_PER_POLL
           
static int DEFAULT_POLL_MILLIS
           
 
Fields inherited from class org.eclipse.net4j.util.concurrent.Worker
DEFAULT_ERROR_HANDLER, DEFAULT_TIMEOUT
 
Fields inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
USE_LABEL
 
Constructor Summary
ReferenceQueueWorker()
           
 
Method Summary
 int getMaxWorkPerPoll()
           
 long getPollMillis()
           
protected  ReferenceQueue<T> getQueue()
           
 void setMaxWorkPerPoll(int maxWorkPerPoll)
           
 void setPollMillis(long pollMillis)
           
protected abstract  void work(Reference<? extends T> reference)
           
protected  void work(Worker.WorkContext context)
           
 
Methods inherited from class org.eclipse.net4j.util.concurrent.Worker
doActivate, doDeactivate, getActivationTimeout, getDeactivationTimeout, getGlobalErrorHandler, getThreadName, handleError, isDaemon, setActivationTimeout, setDaemon, setDeactivationTimeout, setGlobalErrorHandler
 
Methods inherited from class org.eclipse.net4j.util.lifecycle.Lifecycle
activate, 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.Notifier
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
 

Field Detail

DEFAULT_POLL_MILLIS

public static final int DEFAULT_POLL_MILLIS
Since:
3.0
See Also:
Constant Field Values

ALL_WORK_PER_POLL

public static final int ALL_WORK_PER_POLL
Since:
3.0
See Also:
Constant Field Values

DEFAULT_MAX_WORK_PER_POLL

public static final int DEFAULT_MAX_WORK_PER_POLL
Since:
3.0
See Also:
Constant Field Values
Constructor Detail

ReferenceQueueWorker

public ReferenceQueueWorker()
Method Detail

getPollMillis

public long getPollMillis()

setPollMillis

public void setPollMillis(long pollMillis)

getMaxWorkPerPoll

public int getMaxWorkPerPoll()

setMaxWorkPerPoll

public void setMaxWorkPerPoll(int maxWorkPerPoll)

getQueue

protected ReferenceQueue<T> getQueue()

work

protected final void work(Worker.WorkContext context)
                   throws Exception
Specified by:
work in class Worker
Throws:
Exception

work

protected abstract void work(Reference<? extends T> reference)


Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.