org.opensync.engine.server
Class Task

java.lang.Object
  extended byorg.opensync.engine.server.Task
All Implemented Interfaces:
java.util.EventListener, java.lang.Runnable, java.io.Serializable, TaskListener

public class Task
extends java.lang.Object
implements java.io.Serializable, java.lang.Runnable, TaskListener

The task represents a synchronisation to do

See Also:
Serialized Form

Field Summary
protected  Agenda agenda
          The agenda of the task
protected  long delay
          The delay olf the task
protected  boolean finish
           
protected  java.lang.String name
          The name of the task
protected  Task parentTask
          The parent task
protected  java.lang.String status
           
protected  java.util.ArrayList subTasks
          All the subtasks
protected  Synchronization synchronization
          The synchronization to do
protected  java.util.ArrayList tasksListener
          All tasks listeners
protected  java.util.ArrayList waittingSubTasks
          The tasks not yet done
 
Constructor Summary
Task()
          Construct a task object
 
Method Summary
 void addSubTask(Task task)
          Add a sub task
 void addTaskListener(TaskListener taskListener)
          Regsiter a task listener
 void fail(java.lang.Exception exception)
          The task failed
 Agenda getAgenda()
          Get the agenda
 boolean getFinish()
           
 java.lang.String getName()
          Get the name of the task
 Task getParentTask()
          Get the parent task
 java.lang.String getStatus()
           
 java.util.Collection getSubTasks()
          Get the sub tasks
 Synchronization getSynchronization()
          Get the synchronization to do
 java.util.ArrayList getWaittingSubTasks()
          Get all the not yet done
 void initDepends()
          initialize the tak dependance
 void removeTaskListener(TaskListener taskListener)
          Remove a task listener
 void run()
          Run the task
 void setAgenda(Agenda agenda)
          Set the agenda
 void setFinish(boolean finish)
           
 void setName(java.lang.String name)
          Set the name of the task
 void setParentTask(Task parentTask)
          Set the parent taks
 void setStatus(java.lang.String status)
           
 void setSynchronization(Synchronization synchronization)
          Set the synchronization to do
protected  void start()
          Start the taks
protected  void stop()
          Stop the task
 void taskFail(TaskEvent event)
          Implements the TaskListenr interface
 void taskStart(TaskEvent event)
          Implements the TaskListenr interface
 void taskStop(TaskEvent event)
          Implements the TaskListenr interface
 java.lang.String toString()
          Use for debug only
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

finish

protected boolean finish

status

protected java.lang.String status

name

protected java.lang.String name
The name of the task


agenda

protected Agenda agenda
The agenda of the task


synchronization

protected Synchronization synchronization
The synchronization to do


parentTask

protected Task parentTask
The parent task


subTasks

protected java.util.ArrayList subTasks
All the subtasks


waittingSubTasks

protected java.util.ArrayList waittingSubTasks
The tasks not yet done


tasksListener

protected java.util.ArrayList tasksListener
All tasks listeners


delay

protected long delay
The delay olf the task

Constructor Detail

Task

public Task()
Construct a task object

Method Detail

getStatus

public java.lang.String getStatus()

setStatus

public void setStatus(java.lang.String status)

getFinish

public boolean getFinish()

setFinish

public void setFinish(boolean finish)

setSynchronization

public void setSynchronization(Synchronization synchronization)
Set the synchronization to do

Parameters:
synchronization - the synchronization to do

getSynchronization

public Synchronization getSynchronization()
Get the synchronization to do


getSubTasks

public java.util.Collection getSubTasks()
Get the sub tasks


addSubTask

public void addSubTask(Task task)
Add a sub task

Parameters:
task -

addTaskListener

public void addTaskListener(TaskListener taskListener)
Regsiter a task listener

Parameters:
taskListener - the task listener to register

removeTaskListener

public void removeTaskListener(TaskListener taskListener)
Remove a task listener

Parameters:
taskListener - the task listener to remov

setParentTask

public void setParentTask(Task parentTask)
Set the parent taks

Parameters:
parentTask -

getParentTask

public Task getParentTask()
Get the parent task


setName

public void setName(java.lang.String name)
Set the name of the task

Parameters:
name -

getName

public java.lang.String getName()
Get the name of the task


setAgenda

public void setAgenda(Agenda agenda)
Set the agenda

Parameters:
agenda -

getAgenda

public Agenda getAgenda()
Get the agenda


initDepends

public void initDepends()
initialize the tak dependance


run

public void run()
Run the task

Specified by:
run in interface java.lang.Runnable

start

protected void start()
Start the taks


stop

protected void stop()
Stop the task


fail

public void fail(java.lang.Exception exception)
The task failed

Parameters:
exception -

taskStart

public void taskStart(TaskEvent event)
Implements the TaskListenr interface

Specified by:
taskStart in interface TaskListener
Parameters:
event - the task event

taskStop

public void taskStop(TaskEvent event)
Implements the TaskListenr interface

Specified by:
taskStop in interface TaskListener
Parameters:
event - the task event

taskFail

public void taskFail(TaskEvent event)
Implements the TaskListenr interface

Specified by:
taskFail in interface TaskListener
Parameters:
event - the task event

toString

public java.lang.String toString()
Use for debug only


getWaittingSubTasks

public java.util.ArrayList getWaittingSubTasks()
Get all the not yet done



Copyright © 2004 sourceforge. All Rights Reserved.