Class OSGiScriptEngineFactory

  • All Implemented Interfaces:
    javax.script.ScriptEngineFactory

    public class OSGiScriptEngineFactory
    extends java.lang.Object
    implements javax.script.ScriptEngineFactory
    This is a wrapper class for the ScriptEngineFactory class that deals with context class loader issues It is necessary because engines (at least ruby) use the context classloader to find their resources (i.e., their "native" classes)
    • Constructor Detail

      • OSGiScriptEngineFactory

        public OSGiScriptEngineFactory​(javax.script.ScriptEngineFactory factory,
                                       java.lang.ClassLoader contextClassLoader)
    • Method Detail

      • getEngineName

        public java.lang.String getEngineName()
        Specified by:
        getEngineName in interface javax.script.ScriptEngineFactory
      • getEngineVersion

        public java.lang.String getEngineVersion()
        Specified by:
        getEngineVersion in interface javax.script.ScriptEngineFactory
      • getExtensions

        public java.util.List<java.lang.String> getExtensions()
        Specified by:
        getExtensions in interface javax.script.ScriptEngineFactory
      • getLanguageName

        public java.lang.String getLanguageName()
        Specified by:
        getLanguageName in interface javax.script.ScriptEngineFactory
      • getLanguageVersion

        public java.lang.String getLanguageVersion()
        Specified by:
        getLanguageVersion in interface javax.script.ScriptEngineFactory
      • getMethodCallSyntax

        public java.lang.String getMethodCallSyntax​(java.lang.String obj,
                                                    java.lang.String m,
                                                    java.lang.String... args)
        Specified by:
        getMethodCallSyntax in interface javax.script.ScriptEngineFactory
      • getMimeTypes

        public java.util.List<java.lang.String> getMimeTypes()
        Specified by:
        getMimeTypes in interface javax.script.ScriptEngineFactory
      • getNames

        public java.util.List<java.lang.String> getNames()
        Specified by:
        getNames in interface javax.script.ScriptEngineFactory
      • getOutputStatement

        public java.lang.String getOutputStatement​(java.lang.String toDisplay)
        Specified by:
        getOutputStatement in interface javax.script.ScriptEngineFactory
      • getParameter

        public java.lang.Object getParameter​(java.lang.String key)
        Specified by:
        getParameter in interface javax.script.ScriptEngineFactory
      • getProgram

        public java.lang.String getProgram​(java.lang.String... statements)
        Specified by:
        getProgram in interface javax.script.ScriptEngineFactory
      • getScriptEngine

        public javax.script.ScriptEngine getScriptEngine()
        Specified by:
        getScriptEngine in interface javax.script.ScriptEngineFactory