public class ServerHandle extends Object
Constructor and Description |
---|
ServerHandle(String vendor,
String product,
String version,
Map<String,String> extraInfo)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected JSONObject |
getDetectorOptions(Configuration pConfig,
LogHandler pLogHandler)
Get the optional options used for detectors.
|
Map<String,String> |
getExtraInfo(MBeanServerExecutor pServerManager)
Get extra information specific to a server.
|
String |
getProduct()
Get the name of the server this agent is running in
|
String |
getVendor()
Get name of vendor
|
String |
getVersion()
Get version number of the agent server
|
void |
postDetect(MBeanServerExecutor pServerManager,
Configuration pConfig,
LogHandler pLoghandler)
Hook called after the detection phase.
|
void |
preDispatch(MBeanServerExecutor pMBeanServerExecutor,
JmxRequest pJmxReq)
Hook for performing certain workarounds/pre processing just before
a request gets dispatched
|
ObjectName |
registerMBeanAtServer(MBeanServer pServer,
Object pMBean,
String pName)
Register a MBean at the dedicated server.
|
JSONObject |
toJSONObject(MBeanServerExecutor pServerManager)
Return this info as an JSONObject
|
public String getVendor()
public String getProduct()
public String getVersion()
public Map<String,String> getExtraInfo(MBeanServerExecutor pServerManager)
pServerManager
- MBeanServers to querynull
if no extra information is given.public void preDispatch(MBeanServerExecutor pMBeanServerExecutor, JmxRequest pJmxReq)
pMBeanServerExecutor
- the detected MBeanServerspJmxReq
- the request to dispatchpublic void postDetect(MBeanServerExecutor pServerManager, Configuration pConfig, LogHandler pLoghandler)
pServerManager
- pConfig
- agent configurationpLoghandler
- logger to use for logging any error.public ObjectName registerMBeanAtServer(MBeanServer pServer, Object pMBean, String pName) throws MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException, MalformedObjectNameException
pServer
- server an MBean should be registeredpMBean
- the MBean to registerpName
- an optional name under which the MBean should be registered. Can be nullMBeanRegistrationException
- when registration failedInstanceAlreadyExistsException
- when there is already MBean with this nameNotCompliantMBeanException
MalformedObjectNameException
- if the name is not validpublic JSONObject toJSONObject(MBeanServerExecutor pServerManager)
pServerManager
- servers, for which dynamic part might be queriedprotected JSONObject getDetectorOptions(Configuration pConfig, LogHandler pLogHandler)
{ "glassfish" : { "bootAmx": true } }
pConfig
- the agent configurationpLogHandler
- a log handler for putting out error messagesCopyright © 2019. All rights reserved.