org.mule.components.script
Class AbstractScriptComponent
java.lang.Object
org.mule.components.script.AbstractScriptComponent
- All Implemented Interfaces:
- UMODescriptorAware, Callable, Disposable, Initialisable, Lifecycle, Startable, Stoppable, UMOEventListener, FileListener
public abstract class AbstractScriptComponent
- extends Object
- implements Initialisable, Lifecycle, UMODescriptorAware, FileListener, Callable
AbstractScriptComponent
is a component that can execute scripts as
components in Mule. This component also supports reloading if the script file
changes (providing the file is on the file system)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mule.umo.lifecycle.Callable |
onCall |
DEFAULT_RELOAD_INTERVAL_MS
public static final int DEFAULT_RELOAD_INTERVAL_MS
- See Also:
- Constant Field Values
logger
protected transient Log logger
- logger used by this class
descriptor
protected UMODescriptor descriptor
AbstractScriptComponent
public AbstractScriptComponent()
setDescriptor
public void setDescriptor(UMODescriptor descriptor)
- Specified by:
setDescriptor
in interface UMODescriptorAware
initialise
public void initialise()
throws InitialisationException
- Description copied from interface:
Initialisable
- Method used to perform any initialisation work. If a fatal error occurs during
initialisation an
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.
- Specified by:
initialise
in interface Initialisable
- Throws:
InitialisationException
- if a fatal error occurs causing the Mule
instance to shutdown
RecoverableException
- if an error occurs that can be recovered from
getScriptUrl
protected URL getScriptUrl(String scriptLocation)
getScript
public String getScript()
setScript
public void setScript(String script)
isAutoReload
public boolean isAutoReload()
setAutoReload
public void setAutoReload(boolean autoReload)
start
public void start()
throws UMOException
- Specified by:
start
in interface Startable
- Throws:
UMOException
stop
public void stop()
throws UMOException
- Specified by:
stop
in interface Stoppable
- Throws:
UMOException
dispose
public void dispose()
- Description copied from interface:
Disposable
- A lifecycle method where implementor should free up any resources. If an
exception is thrown it should just be logged and processing should continue.
This method should not throw Runtime exceptions.
- Specified by:
dispose
in interface Disposable
getScriptText
public String getScriptText()
setScriptText
public void setScriptText(String scriptText)
loadInterpreter
protected abstract void loadInterpreter(URL script)
throws InitialisationException
- Throws:
InitialisationException
loadInterpreter
protected abstract void loadInterpreter(String scriptText)
throws InitialisationException
- Throws:
InitialisationException
getDefaultFileExtension
protected abstract String getDefaultFileExtension()
Copyright © 2003-2008 MuleSource, Inc.. All Rights Reserved.