de.willuhn.boot.Bootable
public class ScriptingService
extends java.lang.Object
implements de.willuhn.boot.Bootable
Modifier and Type | Class | Description |
---|---|---|
class |
ScriptingService.Events |
Hilfsklasse zum Mappen der Events auf die JS-Funktionen.
|
Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
QUEUE_ADDED |
Die Queue, die nach dem Hinzufuegen eines Scripts benachrichtigt wird.
|
static java.lang.String |
QUEUE_REMOVED |
Die Queue, die nach dem Entfernen eines Scripts benachrichtigt wird.
|
Constructor | Description |
---|---|
ScriptingService() |
Modifier and Type | Method | Description |
---|---|---|
void |
addScript(java.io.File file) |
Fuegt ein neues Script hinzu.
|
boolean |
contains(java.io.File file) |
Prueft, ob das angegebene Script bereits hinzugefuegt wurde.
|
java.lang.Class<de.willuhn.boot.Bootable>[] |
depends() |
|
javax.script.ScriptEngine |
getEngine() |
Liefert die Script-Engine.
|
java.util.List<java.lang.String> |
getFunction(java.lang.String event) |
Liefert die Namen der auszufuehrenden Javascript-Funktionen fuer das Event.
|
java.util.List<java.io.File> |
getScripts() |
Liefert die Liste der vom User registrierten Scripts.
|
void |
init(de.willuhn.boot.BootLoader loader,
de.willuhn.boot.Bootable caller) |
|
void |
reload() |
Startet den Scripting-Service neu, damit die Scripts neu geladen werden.
|
void |
removeScript(java.io.File file) |
Entfernt das Script.
|
void |
shutdown() |
public static final java.lang.String QUEUE_ADDED
public static final java.lang.String QUEUE_REMOVED
public java.lang.Class<de.willuhn.boot.Bootable>[] depends()
depends
in interface de.willuhn.boot.Bootable
Bootable.depends()
public void init(de.willuhn.boot.BootLoader loader, de.willuhn.boot.Bootable caller) throws de.willuhn.boot.SkipServiceException
init
in interface de.willuhn.boot.Bootable
de.willuhn.boot.SkipServiceException
Bootable.init(de.willuhn.boot.BootLoader, de.willuhn.boot.Bootable)
public void shutdown()
shutdown
in interface de.willuhn.boot.Bootable
Bootable.shutdown()
public void reload()
public javax.script.ScriptEngine getEngine()
public java.util.List<java.lang.String> getFunction(java.lang.String event)
event
- das Event.public java.util.List<java.io.File> getScripts()
public boolean contains(java.io.File file) throws java.io.IOException
file
- das zu pruefende Script.java.io.IOException
public void addScript(java.io.File file) throws de.willuhn.util.ApplicationException
file
- das hinzuzufuegende Script.de.willuhn.util.ApplicationException
- wenn die Script-Datei bereits vorhanden ist.public void removeScript(java.io.File file)
file
- das zu entfernende Script.