com.levigo.util.concurrent.tasks
Interface TaskService

All Known Implementing Classes:
ThreadPoolTaskService

public interface TaskService

A TaskService provides functionality to execute and manage background tasks. All background tasks belong to a scope which defines the task's context and allows tasks belonging to a common scope to be managed together.


Method Summary
 void addTaskListener(TaskListener l)
          Add a listener to receive notifications about the activities of this task service.
 TaskExecutor<? extends Object> getExecutor()
          Create a TaskExecutor with a default scope.
<R> TaskExecutor<R>
getExecutor(TaskScope<R> scope)
          Create a TaskExecutor for the given TaskScope.
<R> TaskExecutor<R>
getExecutor(TaskScope<R> scope, int priority)
          Create a TaskExecutor for the given TaskScope.
 void removeTaskListener(TaskListener l)
          Remove a listener previously installed to receive notifications about the activities of this task service.
 

Method Detail

getExecutor

TaskExecutor<? extends Object> getExecutor()
Create a TaskExecutor with a default scope.

Returns:
an executor with an unconstrained result type.

getExecutor

<R> TaskExecutor<R> getExecutor(TaskScope<R> scope)
Create a TaskExecutor for the given TaskScope. Tasks will be executed with the default priority.

Parameters:
scope -
Returns:
an executor with the given result type.

getExecutor

<R> TaskExecutor<R> getExecutor(TaskScope<R> scope,
                                int priority)
Create a TaskExecutor for the given TaskScope. Tasks will be executed with the given priority.

Parameters:
scope -
Returns:
an executor with the given result type.

removeTaskListener

void removeTaskListener(TaskListener l)
Remove a listener previously installed to receive notifications about the activities of this task service.

Parameters:
l - the listener

addTaskListener

void addTaskListener(TaskListener l)
Add a listener to receive notifications about the activities of this task service.

Parameters:
l - the listener


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.