public class HousekeepingExecService extends Object
Runnable services with properties
ExecutorConstants.TASK_DELAY and ExecutorConstants.TASK_PERIOD
and executes them periodically. The service uses a single-threaded executor; it is
intended for short-lived and seldom-running tasks only.| Constructor and Description |
|---|
HousekeepingExecService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(HousekeepingServiceConfig config) |
protected void |
addTask(org.osgi.service.component.ComponentServiceObjects<Runnable> taskService) |
protected void |
deactivate() |
long |
getExecTime(String timeUnit,
int identityHashCode) |
float |
getExecTimeFraction(int identityHashCode) |
long |
getIdleTime(String timeUnit) |
Map<Runnable,Integer> |
getTasks() |
Map<Runnable,Boolean> |
isTaskAlive(int identityHashCode) |
protected void |
removeTask(org.osgi.service.component.ComponentServiceObjects<Runnable> taskService) |
Collection<Runnable> |
restartTask(String timeUnit,
int identityHashCode,
long delay,
long period) |
Collection<Runnable> |
stopTask(int identityHashCode) |
protected void addTask(org.osgi.service.component.ComponentServiceObjects<Runnable> taskService)
protected void removeTask(org.osgi.service.component.ComponentServiceObjects<Runnable> taskService)
protected void activate(HousekeepingServiceConfig config)
protected void deactivate()
public Collection<Runnable> stopTask(int identityHashCode)
public Collection<Runnable> restartTask(String timeUnit, int identityHashCode, long delay, long period) throws InterruptedException, ExecutionException, TimeoutException
public long getExecTime(String timeUnit, int identityHashCode)
public float getExecTimeFraction(int identityHashCode)
public long getIdleTime(String timeUnit)
Copyright © 2019. All rights reserved.