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, unregisterExtensionpublic void activate(ComponentContext context) throws Exception
ComponentThis method is called by the runtime when a component is activated.
activate in interface Componentactivate in class DefaultComponentcontext - the runtime contextException - if an error occurs during activationpublic void deactivate(ComponentContext context) throws Exception
ComponentThis method is called by the runtime when a component is deactivated.
deactivate in interface Componentdeactivate in class DefaultComponentcontext - the runtime contextException - if an error occurs during activationpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution in class DefaultComponentpublic void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution in class DefaultComponentpublic ScriptEngineManager getScriptEngineManager()
getScriptEngineManager in interface ScriptingServicepublic void setScriptDir(File scriptDir)
setScriptDir in interface ScriptingServicepublic File getScriptDir()
getScriptDir in interface ScriptingServicepublic File getScriptFile(String path)
getScriptFile in interface ScriptingServicepublic void registerScript(ScriptDescriptor sd)
registerScript in interface ScriptingServicepublic void unregisterScript(ScriptDescriptor sd)
unregisterScript in interface ScriptingServicepublic void unregisterScript(String name)
unregisterScript in interface ScriptingServicepublic boolean isScriptRegistered(String name)
isScriptRegistered in interface ScriptingServicepublic CompiledScript getScript(String name) throws ScriptException, IOException
getScript in interface ScriptingServiceScriptExceptionIOExceptionpublic CompiledScript compile(String path) throws ScriptException
compile in interface ScriptingServiceScriptExceptionpublic Object eval(String path) throws ScriptException
eval in interface ScriptingServiceScriptExceptionpublic Object eval(String path, ScriptContext ctx) throws ScriptException
eval in interface ScriptingServiceScriptExceptionpublic ScriptEngine getEngineByFileName(String path)
getEngineByFileName in interface ScriptingServiceCopyright © 2011 Nuxeo SA. All Rights Reserved.