org.mule.components.script
Class AbstractScriptComponent

java.lang.Object
  extended byorg.mule.components.script.AbstractScriptComponent
All Implemented Interfaces:
org.mule.umo.lifecycle.Callable, org.mule.umo.lifecycle.Disposable, org.mule.util.monitor.FileListener, org.mule.umo.lifecycle.Initialisable, org.mule.umo.lifecycle.Lifecycle, org.mule.umo.lifecycle.Startable, org.mule.umo.lifecycle.Stoppable, org.mule.impl.UMODescriptorAware, org.mule.umo.lifecycle.UMOEventListener

public abstract class AbstractScriptComponent
extends Object
implements org.mule.umo.lifecycle.Initialisable, org.mule.umo.lifecycle.Lifecycle, org.mule.impl.UMODescriptorAware, org.mule.util.monitor.FileListener, org.mule.umo.lifecycle.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)


Field Summary
static int DEFAULT_RELOAD_INTERVAL_MS
           
protected  org.mule.umo.UMODescriptor descriptor
           
protected  Log logger
          logger used by this class
 
Fields inherited from interface org.mule.umo.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.umo.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.umo.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.umo.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
AbstractScriptComponent()
           
 
Method Summary
 void dispose()
           
protected abstract  String getDefaultFileExtension()
           
 String getScript()
           
 String getScriptText()
           
protected  URL getScriptUrl(String scriptLocation)
           
 void initialise()
           
 boolean isAutoReload()
           
protected abstract  void loadInterpreter(String scriptText)
           
protected abstract  void loadInterpreter(URL script)
           
 void setAutoReload(boolean autoReload)
           
 void setDescriptor(org.mule.umo.UMODescriptor descriptor)
           
 void setScript(String script)
           
 void setScriptText(String scriptText)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.util.monitor.FileListener
fileChanged
 
Methods inherited from interface org.mule.umo.lifecycle.Callable
onCall
 

Field Detail

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 org.mule.umo.UMODescriptor descriptor
Constructor Detail

AbstractScriptComponent

public AbstractScriptComponent()
Method Detail

setDescriptor

public void setDescriptor(org.mule.umo.UMODescriptor descriptor)
Specified by:
setDescriptor in interface org.mule.impl.UMODescriptorAware

initialise

public void initialise()
                throws org.mule.umo.lifecycle.InitialisationException
Specified by:
initialise in interface org.mule.umo.lifecycle.Initialisable
Throws:
org.mule.umo.lifecycle.InitialisationException

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 org.mule.umo.UMOException
Specified by:
start in interface org.mule.umo.lifecycle.Startable
Throws:
org.mule.umo.UMOException

stop

public void stop()
          throws org.mule.umo.UMOException
Specified by:
stop in interface org.mule.umo.lifecycle.Stoppable
Throws:
org.mule.umo.UMOException

dispose

public void dispose()
Specified by:
dispose in interface org.mule.umo.lifecycle.Disposable

getScriptText

public String getScriptText()

setScriptText

public void setScriptText(String scriptText)

loadInterpreter

protected abstract void loadInterpreter(URL script)
                                 throws org.mule.umo.lifecycle.InitialisationException
Throws:
org.mule.umo.lifecycle.InitialisationException

loadInterpreter

protected abstract void loadInterpreter(String scriptText)
                                 throws org.mule.umo.lifecycle.InitialisationException
Throws:
org.mule.umo.lifecycle.InitialisationException

getDefaultFileExtension

protected abstract String getDefaultFileExtension()


Copyright © 2003-2007 MuleSource, Inc.. All Rights Reserved.