com.googlecode.jinahya.util.fsm
Class TaskContext

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

public abstract class TaskContext
extends Object

Author:
Jin Kwon

Nested Class Summary
protected static interface TaskContext.ResourceLoader
          Platform specific resource loader.
 
Field Summary
protected static TaskContext.ResourceLoader DEFAULT_RESOURCE_LOADER
          Default implementation.
 
Constructor Summary
protected TaskContext(Class<?>[] classes)
          Creates a new instance.
 
Method Summary
 Collection<Task> getTasks()
          Returns an unmodifiable collection of task instances.
protected static Task[] instantiateTasks(Class<?>[] classes)
          Creates a new instance of FSMContext.
protected static Class<?>[] loadClasses(String contextPath, ClassLoader classLoader)
          Creates a new instance of FSMContext.
protected static Class<?>[] loadClasses(String contextPath, ClassLoader classLoader, TaskContext.ResourceLoader resourceLoader)
          Creates a new instance of FSMContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RESOURCE_LOADER

protected static final TaskContext.ResourceLoader DEFAULT_RESOURCE_LOADER
Default implementation.

Constructor Detail

TaskContext

protected TaskContext(Class<?>[] classes)
               throws FSMException
Creates a new instance.

Parameters:
classes - task classes
Throws:
FSMException
Method Detail

loadClasses

protected static Class<?>[] loadClasses(String contextPath,
                                        ClassLoader classLoader)
                                 throws FSMException
Creates a new instance of FSMContext.

Parameters:
contextPath - context path
classLoader - class loader
Returns:
a new instance of FSMContext
Throws:
FSMException - if an error occurs.

loadClasses

protected static Class<?>[] loadClasses(String contextPath,
                                        ClassLoader classLoader,
                                        TaskContext.ResourceLoader resourceLoader)
                                 throws FSMException
Creates a new instance of FSMContext.

Parameters:
contextPath - context path
classLoader - class loader
resourceLoader - platform specific resource loader
Returns:
an array of loaded tasks
Throws:
FSMException - if an error occurs.

instantiateTasks

protected static Task[] instantiateTasks(Class<?>[] classes)
                                  throws FSMException
Creates a new instance of FSMContext.

Parameters:
classes - pre-loaded task classes
Returns:
a new instance of FSMContext.
Throws:
FSMException - if an error occurs.

getTasks

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

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


Copyright © 2011. All Rights Reserved.