guarana.framework.process
Interface ITaskContainer

All Superinterfaces:
guarana.util.observer.smart.ISmartObserver
All Known Implementing Classes:
EntryPort, ExitPort, OneWayPort, Port, Process, ResponderPort, SolicitorPort, TwoWayPort

public interface ITaskContainer
extends guarana.util.observer.smart.ISmartObserver

Defines the basic interface for a task container.

Since:
Guaranį SDK 1.0.0
Author:
Rafael Z. Frantz
See Also:
Process

Method Summary
 Task addTask(Task task)
          Adds a given task to this task container.
 boolean containsTask(String name)
          Searches for a given task name inside this task container.
 int countTask()
          Counts the tasks inside this task container.
 Collection<Task> getAllTasks()
          Returns all tasks inside this task container.
 Task getTask(String name)
          Searches for a task with a given name inside this task container.
 Task removeTask(String name)
          Removes a given task from this task container.
 
Methods inherited from interface guarana.util.observer.smart.ISmartObserver
getName, setName, update
 

Method Detail

addTask

Task addTask(Task task)
             throws InvalidParameterException
Adds a given task to this task container.

Parameters:
task - The task to be added.
Returns:
the previous task already in the container if the new one has the same name or null if there is no previous task.
Throws:
InvalidParameterException - if the task parameter is null.

removeTask

Task removeTask(String name)
Removes a given task from this task container.

Parameters:
name - The name of the task to remove.
Returns:
the removed task or null if there is no task associated with this name.

getTask

Task getTask(String name)
Searches for a task with a given name inside this task container.

Parameters:
name - The task name.
Returns:
the task associated with the given name or null if none.

getAllTasks

Collection<Task> getAllTasks()
Returns all tasks inside this task container.

Returns:
a collection with all tasks.

containsTask

boolean containsTask(String name)
Searches for a given task name inside this task container.

Parameters:
name - The task name to be searched.
Returns:
True if there is a corresponding task to the given name; otherwise, False.

countTask

int countTask()
Counts the tasks inside this task container.

Returns:
the number of tasks.


Guaranį DSL Home