|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.schmant.tpm.TaskPackageManager
public final class TaskPackageManager
The TaskPackageManager handles the enabled task packages.
When a task package is enabled, the TaskPackageManager searches
through all directories in the task package path (the -t
command line argument) for directories with the same name as the task package
to enable (task package directories). The task package path
directories are searched in the order that they are given in the task package
path.
For every task package directory found, when it is found, the entries
in the task package directory's lib directory are added to the
classpath.
Mostly, a task package does only have one task package directory. A reason for having more than one would be if the task package is patched. In that case the patch task package path directory is added before the regular task package path directory to the task package path, making patch jars take precedence over regular jars.
The Launcher class creates a new
TaskPackageManager object and stores it as an inheritable thread
local on this class (s_taskPackageManager). After it has run,
Launcher restores the previous instance (which often will be null).
Build scripts should never have to bother with the task package manager.
| Field Summary | |
|---|---|
static String |
TASK_PACKAGE_INFO_FILE_NAME
|
| Constructor Summary | |
|---|---|
TaskPackageManager()
Create an empty task package manager. |
|
TaskPackageManager(Report r,
String tpp)
|
|
| Method Summary | |
|---|---|
void |
close()
Shut down the task package manager. |
TaskPackage |
createTaskPackage(Directory d)
Create a new task package from the contents in the directory and register it with this task package manager. |
protected void |
finalize()
|
static TaskPackageManager |
get()
Get the current task package manager. |
TaskPackage |
getTaskPackage(String name)
Get the named task package. |
static TaskPackageManager |
init(TaskPackageManager tpm)
This is called by Launcher to initialize this class. |
static void |
registerTaskPackageEnableCallback(TaskPackageEnableCallback c)
A ScriptExecutor can use this
method to register a callback object that will be notified before and
after a TaskPackage is enabled. |
static void |
tearDown(TaskPackageManager prevManager)
This is called by Launcher to tear down this class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String TASK_PACKAGE_INFO_FILE_NAME
| Constructor Detail |
|---|
public TaskPackageManager(Report r,
String tpp)
tpp - The task package path, separated by File.separatorCharpublic TaskPackageManager()
| Method Detail |
|---|
public static TaskPackageManager init(TaskPackageManager tpm)
Launcher to initialize this class.
tpm - The new task package manager.
Launcher calls
tearDown(TaskPackageManager).tearDown(TaskPackageManager)public static void tearDown(TaskPackageManager prevManager)
Launcher to tear down this class.
prevManager - The object returned by init(TaskPackageManager).init(TaskPackageManager)public static TaskPackageManager get()
public static void registerTaskPackageEnableCallback(TaskPackageEnableCallback c)
ScriptExecutor can use this
method to register a callback object that will be notified before and
after a TaskPackage is enabled.
c - The callback object.
public TaskPackage createTaskPackage(Directory d)
throws TaskPackageNotFoundException
There is normally no reason for anyone other than the task package manager itself to call this method.
d - The root directory of the task package.
TaskPackage object or null if one could not
be created.
TaskPackageNotFoundException - If the supplied directory is not
the root directory of a task package.
public TaskPackage getTaskPackage(String name)
throws TaskPackageNotFoundException
name - The name of the task package. The name is not case-sensitive.
TaskPackageNotFoundException - If there is no task package with the
given name.public void close()
Launcher class.
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||