|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.scripting.ScriptKeeper
public class ScriptKeeper
Organizer for a filesystem hierarchy containing scripts.
The Partner system depends heavily on scripts to customize and extend an
installation. While in some cases a single script is run for a specific task,
more often we run an entire directory of scripts. This can serve as a sort of
event-listener model, where when something happens in the software, one or
more scripts in one or more modules can be run. For example,
ModuleManager handles such events for active
modules, but passes the actual running of scripts off to this class.
Copyright 2007 Partner Software, Inc.
| Constructor Summary | |
|---|---|
ScriptKeeper()
Creates a new, empty ScriptKeeper. |
|
ScriptKeeper(VfsDirectory directory)
Creates a new ScriptKeeper and registers scripts based on the filesystem hierarchy under the given directory. |
|
| Method Summary | |
|---|---|
boolean |
isWatchingForNewFiles()
|
java.util.List<Script> |
listScriptsIn(Path path)
Returns the scripts in the given directory path. |
Naming<Script> |
nameScriptsIn(Path path)
Returns a naming of the scripts in the given directory path. |
void |
registerScriptHierarchy(VfsDirectory directory)
Register script directories with paths based on the filesystem hierarchy. |
void |
registerScripts(Path path,
VfsDirectory directory)
Register a script path with a directory of script files. |
void |
registerScripts(java.lang.String pathString,
VfsDirectory directory)
|
java.lang.Object |
runScript(Path path,
Naming<java.lang.Object> variables)
Run a specific script (defined by its path) and return the result. |
java.lang.Object |
runScript(Path path,
java.lang.Object... variables)
Run a specific script (defined by its path) and return the result. |
void |
runScripts(Path path,
Naming<java.lang.Object> variables)
Handle a pathed event by running all the scripts in the registered directory. |
void |
runScripts(Path path,
java.lang.Object... variables)
Handle a pathed event by running all the scripts in the registered directory. |
Script |
scriptFor(Path path)
Returns the script with the given path, or null if none is found. |
Script |
scriptFor(java.lang.String pathString)
Returns the script at the given path, or null if none is found. |
void |
setLibraries(ScriptKeeper libraries)
Sets a separate ScriptKeeper object to manage libraries. |
void |
setWatchingForNewFiles(boolean watchingForNewFiles)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ScriptKeeper()
public ScriptKeeper(VfsDirectory directory)
| Method Detail |
|---|
public void setLibraries(ScriptKeeper libraries)
public void registerScripts(java.lang.String pathString,
VfsDirectory directory)
public void registerScripts(Path path,
VfsDirectory directory)
public void runScripts(Path path,
java.lang.Object... variables)
public void runScripts(Path path,
Naming<java.lang.Object> variables)
public void registerScriptHierarchy(VfsDirectory directory)
public Script scriptFor(java.lang.String pathString)
public Script scriptFor(Path path)
public java.util.List<Script> listScriptsIn(Path path)
public Naming<Script> nameScriptsIn(Path path)
public java.lang.Object runScript(Path path,
Naming<java.lang.Object> variables)
public java.lang.Object runScript(Path path,
java.lang.Object... variables)
public boolean isWatchingForNewFiles()
public void setWatchingForNewFiles(boolean watchingForNewFiles)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||