com.googlecode.jinahya.util.fsm
Class TaskContext

java.lang.Object
  extended by com.googlecode.jinahya.util.fsm.TaskContext

public class TaskContext
extends Object

Author:
Jin Kwon

Constructor Summary
TaskContext(Set<String> classNames)
          Creates a new instance.
 
Method Summary
static Set<String> getClassNames(String contextPath, ResourceLoader resourceLoader)
          Loads task classes.
 Map<String,Task> getTaskMap()
          Returns a map of task id and task instances.
 Collection<Task> getTasks()
          Returns a collection of task instances.
protected  Class<?> loadClass(String className)
          Load class named as given className.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskContext

public TaskContext(Set<String> classNames)
Creates a new instance.

Parameters:
classNames - task class names
Method Detail

getClassNames

public static Set<String> getClassNames(String contextPath,
                                        ResourceLoader resourceLoader)
                                 throws FSMException
Loads task classes.

Parameters:
contextPath - context path
resourceLoader - resource loader
Returns:
a set of indexed task class names.
Throws:
FSMException - if an error occurs.

getTaskMap

public final Map<String,Task> getTaskMap()
                                  throws FSMException
Returns a map of task id and task instances.

Returns:
a map of task id and task instances.
Throws:
FSMException - if an error occurs.

getTasks

public final Collection<Task> getTasks()
                                throws FSMException
Returns a collection of task instances.

Returns:
a collection of task instances.
Throws:
FSMException - if an error occurs.

loadClass

protected Class<?> loadClass(String className)
                      throws FSMException
Load class named as given className. Default implementation uses Class.forName(java.lang.String). Override this method if any customizations are requires.

Parameters:
className - class name
Returns:
loaded class
Throws:
FSMException - if an error occurs.


Copyright © 2011. All Rights Reserved.