public class ScriptingService
extends java.lang.Object
implements de.willuhn.boot.Bootable
| Modifier and Type | Class and Description |
|---|---|
class |
ScriptingService.Events
Hilfsklasse zum Mappen der Events auf die JS-Funktionen.
|
| Modifier and Type | Field and 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 and Description |
|---|
ScriptingService() |
| Modifier and Type | Method and 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.BootableBootable.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.Bootablede.willuhn.boot.SkipServiceExceptionBootable.init(de.willuhn.boot.BootLoader, de.willuhn.boot.Bootable)public void shutdown()
shutdown in interface de.willuhn.boot.BootableBootable.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.IOExceptionpublic 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.