Class SpringJolokiaAgent

java.lang.Object
org.jolokia.jvmagent.JolokiaServer
org.jolokia.support.spring.SpringJolokiaAgent
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class SpringJolokiaAgent extends org.jolokia.jvmagent.JolokiaServer implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
A specialized JVM Agent for Spring environments
Since:
26.12.12
Author:
roland
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Callback used for initializing and optionally starting up the server
    void
    Stop the server
    void
    setApplicationContext(org.springframework.context.ApplicationContext pContext)
    Look for the appropriate configuration, merge multiple ones if given and start up the Jolokia Server if lookupConfig is true
    void
    Set the configuration which is used, if no other configuration options are given
    void
    setExposeApplicationContext(boolean pExposeApplicationContext)
    Whether to expose the spring container itself for outside access via an own Spring reaml '@spring'
    void
    Set spring context id, required because an ID can be given.
    void
    Set the log handler to use which is contained in the given holder
    void
    setLookupConfig(boolean pLookupConfig)
    Whether to lookup dynamically configs in the application context after creation of this bean.
    void
    setLookupServices(boolean pLookupServices)
    Whether to lookup JolokiaServices from the application context.
    void
    Set the system property mode for how to deal with configuration coming from system properties

    Methods inherited from class org.jolokia.jvmagent.JolokiaServer

    addService, clearWatchedFiles, getAddress, getServerConfig, getUrl, getWatchedFiles, init, init, start, start, stop

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpringJolokiaAgent

      public SpringJolokiaAgent()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws IOException
      Callback used for initializing and optionally starting up the server
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      IOException
    • destroy

      public void destroy()
      Stop the server
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
    • setConfig

      public void setConfig(SpringJolokiaConfigHolder pConfig)
      Set the configuration which is used, if no other configuration options are given
      Parameters:
      pConfig - configuration to use
    • setLogHandler

      public void setLogHandler(SpringJolokiaLogHandlerHolder pLogHandlerHolder)
      Set the log handler to use which is contained in the given holder
      Parameters:
      pLogHandlerHolder - holder of a log handler
    • setLookupConfig

      public void setLookupConfig(boolean pLookupConfig)
      Whether to lookup dynamically configs in the application context after creation of this bean. This especially useful if the server is automatically started in a different module and needs some extra customization. Used e.g for the spring plugin.
      Parameters:
      pLookupConfig - whether to lookup configuration dynamically. Default is false.
    • setExposeApplicationContext

      public void setExposeApplicationContext(boolean pExposeApplicationContext)
      Whether to expose the spring container itself for outside access via an own Spring reaml '@spring'
      Parameters:
      pExposeApplicationContext - true if the container itself should be exposed via Jolokia. Default is false
    • setLookupServices

      public void setLookupServices(boolean pLookupServices)
      Whether to lookup JolokiaServices from the application context. These are added according to their order to the set of the services present.
      Parameters:
      pLookupServices - whether to lookup jolokia services.
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext pContext)
      Look for the appropriate configuration, merge multiple ones if given and start up the Jolokia Server if lookupConfig is true
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Parameters:
      pContext - spring context containing the bean definition
    • setSystemPropertiesMode

      public void setSystemPropertiesMode(String pMode)
      Set the system property mode for how to deal with configuration coming from system properties
    • setId

      public void setId(String pId)
      Set spring context id, required because an ID can be given. Not used.
      Parameters:
      pId - id to set