Class JvmAgent


  • public final class JvmAgent
    extends Object
    A JVM level agent using the JDK6 HTTP Server HttpServer or its SSL variant HttpsServer. Beside the configuration defined in ConfigKey, this agent honors the following additional configuration keys:
    • host : Host address to bind to
    • port : Port to listen on
    • backlog : max. nr of requests queued up before they get rejected
    • config : path to a properties file containing configuration
    • ....
    Configuration will be also looked up from a properties file found in the class path as /default-jolokia-agent.properties All configurations will be merged in the following order with the later taking precedence:
    • Default properties from /default-jolokia-agent.properties
    • Configuration from a config file (if given)
    • Options given on the command line in the form -javaagent:agent.jar=key1=value1,key2=value2...
    Since:
    Mar 3, 2010
    Author:
    roland
    • Method Detail

      • premain

        public static void premain​(String agentArgs,
                                   Instrumentation inst)
        Entry point for the agent, using command line attach (that is via -javaagent command line argument)
        Parameters:
        agentArgs - arguments as given on the command line
      • agentmain

        public static void agentmain​(String agentArgs,
                                     Instrumentation instrumentation)
        Entry point for the agent, using dynamic attach. (this is a post VM initialisation attachment, via com.sun.attach)
        Parameters:
        agentArgs - arguments as given on the command line