Package org.jolokia.support.spring
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 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidCallback used for initializing and optionally starting up the servervoiddestroy()Stop the servervoidsetApplicationContext(org.springframework.context.ApplicationContext pContext) Look for the appropriate configuration, merge multiple ones if given and start up the Jolokia Server if lookupConfig is truevoidsetConfig(SpringJolokiaConfigHolder pConfig) Set the configuration which is used, if no other configuration options are givenvoidsetExposeApplicationContext(boolean pExposeApplicationContext) Whether to expose the spring container itself for outside access via an own Spring reaml '@spring'voidSet spring context id, required because an ID can be given.voidsetLogHandler(SpringJolokiaLogHandlerHolder pLogHandlerHolder) Set the log handler to use which is contained in the given holdervoidsetLookupConfig(boolean pLookupConfig) Whether to lookup dynamically configs in the application context after creation of this bean.voidsetLookupServices(boolean pLookupServices) Whether to lookupJolokiaServices from the application context.voidsetSystemPropertiesMode(String pMode) Set the system property mode for how to deal with configuration coming from system propertiesMethods inherited from class org.jolokia.jvmagent.JolokiaServer
addService, getAddress, getServerConfig, getUrl, init, start, start, stop
-
Constructor Details
-
SpringJolokiaAgent
public SpringJolokiaAgent()
-
-
Method Details
-
afterPropertiesSet
Callback used for initializing and optionally starting up the server- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
IOException
-
destroy
public void destroy()Stop the server- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean
-
setConfig
Set the configuration which is used, if no other configuration options are given- Parameters:
pConfig- configuration to use
-
setLogHandler
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 lookupJolokiaServices 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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Parameters:
pContext- spring context containing the bean definition
-
setSystemPropertiesMode
Set the system property mode for how to deal with configuration coming from system properties -
setId
Set spring context id, required because an ID can be given. Not used.- Parameters:
pId- id to set
-