Class ScriptedCollectionSetBuilder


  • public class ScriptedCollectionSetBuilder
    extends java.lang.Object
    Uses an external script, executed via JSR-223, to generate a CollectionSet from some given object using the CollectionSetBuilder.
    Author:
    jwhite
    • Constructor Detail

      • ScriptedCollectionSetBuilder

        public ScriptedCollectionSetBuilder​(java.io.File script)
                                     throws java.io.IOException,
                                            javax.script.ScriptException
        Throws:
        java.io.IOException
        javax.script.ScriptException
      • ScriptedCollectionSetBuilder

        public ScriptedCollectionSetBuilder​(java.io.File script,
                                            org.osgi.framework.BundleContext bundleContext)
                                     throws java.io.IOException,
                                            javax.script.ScriptException
        Throws:
        java.io.IOException
        javax.script.ScriptException
      • ScriptedCollectionSetBuilder

        public ScriptedCollectionSetBuilder​(java.io.File script,
                                            javax.script.ScriptEngineManager manager)
                                     throws java.io.IOException,
                                            javax.script.ScriptException
        Throws:
        java.io.IOException
        javax.script.ScriptException
    • Method Detail

      • build

        public CollectionSet build​(CollectionAgent agent,
                                   java.lang.Object message,
                                   java.lang.Long timestamp)
                            throws javax.script.ScriptException
        Builds a collection set from the given message. WARNING: This method is not necessarily thread safe. This depends on the script, and the script engine that is being used.
        Parameters:
        agent - the agent associated with the collection set
        message - the messaged passed to script containing the metrics
        Returns:
        a collection set
        Throws:
        javax.script.ScriptException