org.qi4j.scripting.beanshell
Class BeanShellMixin

java.lang.Object
  extended by org.qi4j.scripting.beanshell.BeanShellMixin
All Implemented Interfaces:
InvocationHandler, ScriptReloadable

@AppliesTo(value=BeanShellMixin.AppliesTo.class)
public class BeanShellMixin
extends Object
implements InvocationHandler, ScriptReloadable

Generic mixin that implements interfaces by delegating to BeanShell methods Each method in an interface is declared by a BeanShell method in a file located in classpath with the name "<interface>.bsh", where the interface name includes the package, and has "." replaced with "/".

Example: org/qi4j/samples/hello/domain/HelloWorldSpeaker.bsh


Nested Class Summary
static class BeanShellMixin.AppliesTo
           
 
Constructor Summary
BeanShellMixin()
           
 
Method Summary
protected static Reader getSource(Class compositeType, URL scriptUrl)
           
 Object invoke(Object proxy, Method method, Object[] args)
           
 void reloadScripts()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanShellMixin

public BeanShellMixin()
Method Detail

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Throws:
Throwable

getSource

protected static Reader getSource(Class compositeType,
                                  URL scriptUrl)
                           throws IOException
Throws:
IOException

reloadScripts

public void reloadScripts()
Specified by:
reloadScripts in interface ScriptReloadable