org.nuxeo.runtime.scripting
Class ScriptingComponent
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.runtime.scripting.ScriptingComponent
- All Implemented Interfaces:
- Adaptable, Component, Extensible, ScriptingService
public class ScriptingComponent
- extends DefaultComponent
- implements ScriptingService
- Author:
- Bogdan Stefanescu
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScriptingComponent
public ScriptingComponent()
activate
public void activate(ComponentContext context)
throws Exception
- Description copied from interface:
Component
- Activates the component.
This method is called by the runtime when a component is activated.
- Specified by:
activate in interface Component- Overrides:
activate in class DefaultComponent
- Parameters:
context - the runtime context
- Throws:
Exception - if an error occurs during activation
deactivate
public void deactivate(ComponentContext context)
throws Exception
- Description copied from interface:
Component
- Deactivates the component.
This method is called by the runtime when a component is deactivated.
- Specified by:
deactivate in interface Component- Overrides:
deactivate in class DefaultComponent
- Parameters:
context - the runtime context
- Throws:
Exception - if an error occurs during activation
registerContribution
public void registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor)
- Overrides:
registerContribution in class DefaultComponent
unregisterContribution
public void unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor)
- Overrides:
unregisterContribution in class DefaultComponent
getScriptEngineManager
public javax.script.ScriptEngineManager getScriptEngineManager()
- Specified by:
getScriptEngineManager in interface ScriptingService
setScriptDir
public void setScriptDir(File scriptDir)
- Specified by:
setScriptDir in interface ScriptingService
getScriptDir
public File getScriptDir()
- Specified by:
getScriptDir in interface ScriptingService
getScriptFile
public File getScriptFile(String path)
- Specified by:
getScriptFile in interface ScriptingService
registerScript
public void registerScript(ScriptDescriptor sd)
- Specified by:
registerScript in interface ScriptingService
unregisterScript
public void unregisterScript(ScriptDescriptor sd)
- Specified by:
unregisterScript in interface ScriptingService
unregisterScript
public void unregisterScript(String name)
- Specified by:
unregisterScript in interface ScriptingService
isScriptRegistered
public boolean isScriptRegistered(String name)
- Specified by:
isScriptRegistered in interface ScriptingService
getScript
public javax.script.CompiledScript getScript(String name)
throws javax.script.ScriptException,
IOException
- Specified by:
getScript in interface ScriptingService
- Throws:
javax.script.ScriptException
IOException
compile
public javax.script.CompiledScript compile(String path)
throws javax.script.ScriptException
- Specified by:
compile in interface ScriptingService
- Throws:
javax.script.ScriptException
eval
public Object eval(String path)
throws javax.script.ScriptException
- Specified by:
eval in interface ScriptingService
- Throws:
javax.script.ScriptException
eval
public Object eval(String path,
javax.script.ScriptContext ctx)
throws javax.script.ScriptException
- Specified by:
eval in interface ScriptingService
- Throws:
javax.script.ScriptException
getEngineByFileName
public javax.script.ScriptEngine getEngineByFileName(String path)
- Specified by:
getEngineByFileName in interface ScriptingService
getFileExtension
public static String getFileExtension(String path)
Copyright © 2010 Nuxeo SAS. All Rights Reserved.