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

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[] instantiate(Class<?>[] classes)
          Creates a new instance of FSMContext.
protected static Class<?>[] load(String contextPath, ClassLoader classLoader)
          Loads task classes.
protected static Class<?>[] load(String contextPath, ClassLoader classLoader, TaskContext.ResourceLoader resourceLoader)
          Loads task classes.
 
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

load

protected static Class<?>[] load(String contextPath,
                                 ClassLoader classLoader)
                          throws FSMException
Loads task classes.

Parameters:
contextPath - context path
classLoader - class loader
Returns:
an array of loaded task classes
Throws:
FSMException - if an error occurs.

load

protected static Class<?>[] load(String contextPath,
                                 ClassLoader classLoader,
                                 TaskContext.ResourceLoader resourceLoader)
                          throws FSMException
Loads task classes.

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

instantiate

protected static Task[] instantiate(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.