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() |
org.eclipse.net4j.util.concurrent.Worker.WorkerThread |
getWorkerThread() |
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, toString
addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addListener, getListeners, hasListeners, removeListener
public 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)
public org.eclipse.net4j.util.concurrent.Worker.WorkerThread getWorkerThread()
protected void doActivate() throws Exception
doActivate
in class Lifecycle
Exception
protected void doDeactivate() throws Exception
doDeactivate
in class Lifecycle
Exception
protected String getThreadName()
protected void handleError(Exception ex)
protected abstract void work(Worker.WorkContext context) throws Exception
Exception
public static IErrorHandler getGlobalErrorHandler()
public static IErrorHandler setGlobalErrorHandler(IErrorHandler globalErrorHandler)
Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html