public class TaskStorage<USERID> extends Object implements net.idea.restnet.i.task.ITaskStorage<USERID>
Modifier and Type | Field and Description |
---|---|
protected ScheduledThreadPoolExecutor |
cleanupCompletedTasks |
protected ScheduledThreadPoolExecutor |
cleanupTimer |
protected ExecutorCompletionService<org.restlet.data.Reference> |
completionService_external |
protected ExecutorCompletionService<org.restlet.data.Reference> |
completionService_internal |
protected double |
cputime |
protected double |
cpuutilisation |
protected Logger |
logger |
protected String |
name |
protected ExecutorService |
pool_external |
protected ExecutorService |
pool_internal |
protected long |
taskCleanupRate |
protected TimeUnit |
taskCleanupUnit |
protected ConcurrentMap<UUID,net.idea.restnet.i.task.ITask<net.idea.restnet.i.task.ITaskResult,USERID>> |
tasks |
protected double |
waittime |
Constructor and Description |
---|
TaskStorage(String name,
Logger logger) |
Modifier and Type | Method and Description |
---|---|
net.idea.restnet.i.task.ITask<net.idea.restnet.i.task.ITaskResult,USERID> |
addTask(String taskName,
net.idea.restnet.i.task.ICallableTask callable,
org.restlet.data.Reference baseReference,
USERID user,
boolean internal) |
void |
cancelTasks() |
void |
cleanUpTasks() |
protected ExecutorService |
createExecutorService(String name,
int maxThreads) |
protected net.idea.restnet.i.task.ITask<net.idea.restnet.i.task.ITaskResult,USERID> |
createTask(USERID user,
net.idea.restnet.i.task.ICallableTask callable) |
Iterator<net.idea.restnet.i.task.ITask<org.restlet.data.Reference,USERID>> |
filterTasks() |
net.idea.restnet.i.task.ITask<net.idea.restnet.i.task.ITaskResult,USERID> |
findTask(String id) |
net.idea.restnet.i.task.ITask<net.idea.restnet.i.task.ITaskResult,USERID> |
findTask(UUID id) |
Iterator<UUID> |
getTasks() |
void |
removeTask(String id) |
void |
removeTasks() |
void |
shutdown(long timeout,
TimeUnit unit) |
protected transient Logger logger
protected String name
protected TimeUnit taskCleanupUnit
protected long taskCleanupRate
protected double cpuutilisation
protected double waittime
protected double cputime
protected ExecutorCompletionService<org.restlet.data.Reference> completionService_internal
protected ExecutorCompletionService<org.restlet.data.Reference> completionService_external
protected ExecutorService pool_internal
protected ExecutorService pool_external
protected ScheduledThreadPoolExecutor cleanupTimer
protected ScheduledThreadPoolExecutor cleanupCompletedTasks
protected ConcurrentMap<UUID,net.idea.restnet.i.task.ITask<net.idea.restnet.i.task.ITaskResult,USERID>> tasks
public void cleanUpTasks()
protected ExecutorService createExecutorService(String name, int maxThreads)
protected net.idea.restnet.i.task.ITask<net.idea.restnet.i.task.ITaskResult,USERID> createTask(USERID user, net.idea.restnet.i.task.ICallableTask callable)
public net.idea.restnet.i.task.ITask<net.idea.restnet.i.task.ITaskResult,USERID> addTask(String taskName, net.idea.restnet.i.task.ICallableTask callable, org.restlet.data.Reference baseReference, USERID user, boolean internal)
addTask
in interface net.idea.restnet.i.task.ITaskStorage<USERID>
public net.idea.restnet.i.task.ITask<net.idea.restnet.i.task.ITaskResult,USERID> findTask(String id)
findTask
in interface net.idea.restnet.i.task.ITaskStorage<USERID>
public net.idea.restnet.i.task.ITask<net.idea.restnet.i.task.ITaskResult,USERID> findTask(UUID id)
findTask
in interface net.idea.restnet.i.task.ITaskStorage<USERID>
public void removeTask(String id)
public Iterator<UUID> getTasks()
getTasks
in interface net.idea.restnet.i.task.ITaskStorage<USERID>
public void removeTasks()
removeTasks
in interface net.idea.restnet.i.task.ITaskStorage<USERID>
public void cancelTasks()
Copyright © 2004–2020 Ideaconsult Ltd.. All rights reserved.