Class RubyScript

  • All Implemented Interfaces:
    org.tentackle.script.Script

    public class RubyScript
    extends org.tentackle.script.AbstractScript
    A Ruby script.
    Author:
    harald
    • Constructor Summary

      Constructors 
      Constructor Description
      RubyScript​(RubyLanguage language, org.jruby.embed.ScriptingContainer container, java.lang.String code, boolean cached, boolean threadSafe)
      Creates a ruby script.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected CompiledRubyScript compileScript​(java.lang.String code)
      Compiles script code.
      <T> T execute​(java.util.Set<org.tentackle.script.ScriptVariable> variables)  
      protected <T> T executeImpl​(CompiledRubyScript script, java.util.Collection<org.tentackle.script.ScriptVariable> variables)  
      protected CompiledRubyScript getCompiledScript()
      Gets the compiled script.
      Will be parsed if not done yet.
      void validate()  
      • Methods inherited from class org.tentackle.script.AbstractScript

        execute, getCode, getLanguage, isCached, isThreadSafe, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RubyScript

        public RubyScript​(RubyLanguage language,
                          org.jruby.embed.ScriptingContainer container,
                          java.lang.String code,
                          boolean cached,
                          boolean threadSafe)
        Creates a ruby script.
        Parameters:
        language - the language
        code - the scripting code
        cached - true if cached
        threadSafe - true if threadsafety required
    • Method Detail

      • validate

        public void validate()
      • execute

        public <T> T execute​(java.util.Set<org.tentackle.script.ScriptVariable> variables)
      • getCompiledScript

        protected CompiledRubyScript getCompiledScript()
        Gets the compiled script.
        Will be parsed if not done yet.
        Returns:
        the compiled script
      • compileScript

        protected CompiledRubyScript compileScript​(java.lang.String code)
        Compiles script code.
        Parameters:
        code - the scripting source code
        Returns:
        the compiled script
      • executeImpl

        protected <T> T executeImpl​(CompiledRubyScript script,
                                    java.util.Collection<org.tentackle.script.ScriptVariable> variables)