Class NashornResourceReference

    • Constructor Detail

      • NashornResourceReference

        public NashornResourceReference​(String name,
                                        int coreSize,
                                        long delay,
                                        TimeUnit delayUnit)
        Creates a nashorn resource reference with the given name
        Parameters:
        name - the name of the nashorn resource reference
        coreSize - the core size of the script execution pool
        delay - the delay until a script execution is going to be terminated
        delayUnit - the unit until a script execution is going to be terminated
      • NashornResourceReference

        public NashornResourceReference​(String name,
                                        int coreSize,
                                        long delay,
                                        TimeUnit delayUnit,
                                        long wait,
                                        TimeUnit waitUnit,
                                        long maxScriptMemorySize)
        Creates a nashorn resource reference with the given name
        Parameters:
        name - the name of the nashorn resource reference
        coreSize - the core size of the script execution pool
        delay - the delay until a script execution is going to be terminated
        delayUnit - the unit until a script execution is going to be terminated
        wait - how long to w8 until the next memory check occurs
        waitUnit - the unit until the next memory check occurs
        maxScriptMemorySize - the memory usage the script process should use - else it will be aborted
    • Method Detail

      • setup

        protected void setup​(IResource.Attributes attributes,
                             Bindings bindings)
        Setup the bindings and make information available to the scripting context
        Parameters:
        attributes - the attributes of the request
        bindings - the bindings to add java objects to
      • getClassFilter

        protected ClassFilter getClassFilter()
        Gets the class filter to apply to the scripting engine
        Returns:
        the class filter to apply to the scripting engine
      • getWriter

        protected Writer getWriter()
        Gets the writer to which print outputs are going to be written to the default is to use NullWriter
        Returns:
        the writer for output
      • getErrorWriter

        protected Writer getErrorWriter()
        Gets the writer to which error messages are going to be written to the default is to use NullWriter
        Returns:
        the error writer
      • isDebug

        protected boolean isDebug()
        If debug is enabled
        Returns:
        if debug is enabled
      • getScheduledExecutorService

        public ScheduledExecutorService getScheduledExecutorService()
        Gets the scheduled executor services
        Returns:
        the scheduled executor service