org.objectweb.dream.control.activity.task
Class ThreadPerTaskTaskManagerControllerMixin

java.lang.Object
  extended byorg.objectweb.dream.control.activity.task.ThreadPerTaskTaskManagerControllerMixin
All Implemented Interfaces:
TaskManagerController, TaskStoppedListener

public abstract class ThreadPerTaskTaskManagerControllerMixin
extends Object
implements TaskManagerController, TaskStoppedListener

Provides a basic implementation of the TaskManagerController interface. Each registered task has its own scheduler and thread task. Two type of thread tasks are available :

See Also:
BasicThreadTask, BasicThreadPoolTask, ThreadPoolAttributeController.setCapacity(int)

Field Summary
 ContentController _this_weaveableCC
          The ContentControllerinterface of the component to which this controller object belongs.
 Logger _this_weaveableTMCLogger
          The weaveableTMCLogger field required by this mixin.
protected  Map interruptedTasks
          The map of the interrupted tasks.
protected  Map tasks
          The map of registered tasks and the thread they are bound to.
 
Method Summary
abstract  void _super_initFcController(InitializationContext ic)
          The Controller.initFcController(org.objectweb.fractal.julia.InitializationContext)method overriden by this mixin.
 Task[] getTasks()
          Returns the tasks that have been registered.
 void initFcController(InitializationContext ic)
           
 void interruptTask(Task task, TaskStoppedListener listener)
          Interrupt the specified task. an interrupted task, is no more executed.
 Object registerTask(Task task, Map hints)
          Registers a new task.
 void removeTask(Task task, Component componentTask, Component forwarderScheduler, Component thread)
          Removes a task from this composite component.
 void taskStopped(Task thread)
          Called when the specified task is inactinaved.
 void unregisterTask(Task task)
          Unregisters the specified task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tasks

protected Map tasks
The map of registered tasks and the thread they are bound to.


interruptedTasks

protected Map interruptedTasks
The map of the interrupted tasks.


_this_weaveableTMCLogger

public Logger _this_weaveableTMCLogger
The weaveableTMCLogger field required by this mixin. This field is supposed to reference the Loggerof this controller.


_this_weaveableCC

public ContentController _this_weaveableCC
The ContentControllerinterface of the component to which this controller object belongs.

Method Detail

initFcController

public void initFcController(InitializationContext ic)
                      throws InstantiationException
Throws:
InstantiationException
See Also:
Controller.initFcController(InitializationContext)

registerTask

public Object registerTask(Task task,
                           Map hints)
                    throws IllegalTaskException
Description copied from interface: TaskManagerController
Registers a new task.

Specified by:
registerTask in interface TaskManagerController
Parameters:
task - the task to be registered.
hints - additionnal parameters.
Returns:
an interface that can used to control the registered task (may be null if no control is available on the task).
Throws:
IllegalTaskException - if an error occurs.
See Also:
TaskManagerController.registerTask(Task, Map)

unregisterTask

public void unregisterTask(Task task)
                    throws IllegalTaskException
Description copied from interface: TaskManagerController
Unregisters the specified task.

Specified by:
unregisterTask in interface TaskManagerController
Parameters:
task - the task to be removed.
Throws:
IllegalTaskException - if an error occurs.
See Also:
TaskManagerController.unregisterTask(Task)

interruptTask

public void interruptTask(Task task,
                          TaskStoppedListener listener)
                   throws IllegalTaskException
Description copied from interface: TaskManagerController
Interrupt the specified task. an interrupted task, is no more executed. The givent listener is notified when the task is inactivated. The inactivated task should then be unregistered from the activity manager.

Specified by:
interruptTask in interface TaskManagerController
Parameters:
task - the task to interrupt.
listener - a listener to notify. Can be null.
Throws:
IllegalTaskException - if the given task is unknown.
See Also:
TaskManagerController.interruptTask(Task, TaskStoppedListener)

getTasks

public Task[] getTasks()
Description copied from interface: TaskManagerController
Returns the tasks that have been registered.

Specified by:
getTasks in interface TaskManagerController
Returns:
the tasks that have been registered.
See Also:
TaskManagerController.getTasks()

taskStopped

public void taskStopped(Task thread)
Description copied from interface: TaskStoppedListener
Called when the specified task is inactinaved.

Specified by:
taskStopped in interface TaskStoppedListener
Parameters:
thread - an inactivated task.
See Also:
TaskStoppedListener.taskStopped(Task)

removeTask

public void removeTask(Task task,
                       Component componentTask,
                       Component forwarderScheduler,
                       Component thread)
                throws IllegalTaskException
Removes a task from this composite component.

Parameters:
task - the registered task.
componentTask - the task component.
forwarderScheduler - the scheduler of the task.
thread - the thread executing the task.
Throws:
IllegalTaskException - if an error occurs.

_super_initFcController

public abstract void _super_initFcController(InitializationContext ic)
                                      throws InstantiationException
The Controller.initFcController(org.objectweb.fractal.julia.InitializationContext)method overriden by this mixin.

Throws:
InstantiationException
See Also:
Controller.initFcController(InitializationContext)


Copyright © 2003, 2004 - INRIA Rhone-Alpes - All Rights Reserved.