public class ScriptingComponent extends DefaultComponent implements ScriptingService
Constructor and Description |
---|
ScriptingComponent() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
CompiledScript |
compile(String path) |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
Object |
eval(String path) |
Object |
eval(String path,
ScriptContext ctx) |
ScriptEngine |
getEngineByFileName(String path) |
static String |
getFileExtension(String path) |
CompiledScript |
getScript(String name) |
File |
getScriptDir() |
ScriptEngineManager |
getScriptEngineManager() |
File |
getScriptFile(String path) |
boolean |
isScriptRegistered(String name) |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
registerScript(ScriptDescriptor sd) |
void |
setScriptDir(File scriptDir) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unregisterScript(ScriptDescriptor sd) |
void |
unregisterScript(String name) |
applicationStarted, getAdapter, registerExtension, unregisterExtension
public void activate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void deactivate(ComponentContext context) throws Exception
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextException
- if an error occurs during activationpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public ScriptEngineManager getScriptEngineManager()
getScriptEngineManager
in interface ScriptingService
public void setScriptDir(File scriptDir)
setScriptDir
in interface ScriptingService
public File getScriptDir()
getScriptDir
in interface ScriptingService
public File getScriptFile(String path)
getScriptFile
in interface ScriptingService
public void registerScript(ScriptDescriptor sd)
registerScript
in interface ScriptingService
public void unregisterScript(ScriptDescriptor sd)
unregisterScript
in interface ScriptingService
public void unregisterScript(String name)
unregisterScript
in interface ScriptingService
public boolean isScriptRegistered(String name)
isScriptRegistered
in interface ScriptingService
public CompiledScript getScript(String name) throws ScriptException, IOException
getScript
in interface ScriptingService
ScriptException
IOException
public CompiledScript compile(String path) throws ScriptException
compile
in interface ScriptingService
ScriptException
public Object eval(String path) throws ScriptException
eval
in interface ScriptingService
ScriptException
public Object eval(String path, ScriptContext ctx) throws ScriptException
eval
in interface ScriptingService
ScriptException
public ScriptEngine getEngineByFileName(String path)
getEngineByFileName
in interface ScriptingService
Copyright © 2011 Nuxeo SA. All Rights Reserved.