org.ow2.jasmine.monitoring.mbeancmd.context
Class JmxContext

java.lang.Object
  extended by org.ow2.jasmine.monitoring.mbeancmd.context.JmxContext
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AuditContext, DumpContext, MonologContext, SamplerContext, StatContext

public abstract class JmxContext
extends Object
implements Serializable

Main context for jmx environment.

Author:
Guillaume Renault
See Also:
Serialized Form

Field Summary
protected  boolean adminNaming
          If true, the target name is used to identify the server instead of using server.
protected  String cmdid
          cmd id
protected  String domain
          Server domain.
protected  JmxAp jmxap
          JMX Access Point.
protected  String jmxUrl
          JMX URL to connect to.
protected  org.ow2.util.log.Log logger
           
protected  String name
          Name set for the target in probe-config.xml file.
protected  Set<ObjectName> onames
          Targeted names.
protected  String server
          Server name.
 
Constructor Summary
JmxContext()
          Create a context for a target to be monitored via a JMX connection.
 
Method Summary
 String getCmdId()
           
 String getDomain()
           
 JmxAp getJmxap()
           
 String getJmxUrl()
           
 MBeanServerConnection getMBeanServerConnection()
           
 String getName()
           
 Set<ObjectName> getObjectNames(ObjectName onPattern)
          Return a set of ObjectNames corresponding to a given ON pattern.
 Set<ObjectName> getObjectNames(String onPattern)
          Return a set of ObjectNames corresponding to a given ON pattern.
 Set<ObjectName> getOnames()
           
 String getServer()
           
 boolean isAdminNaming()
           
 boolean isStarted()
           
 void setAdminNaming(boolean adminNaming)
           
 void setCmdId(String c)
           
 void setDomain(String domain)
           
 void setJmxap(JmxAp jmxap)
           
 void setJmxUrl(String jmxUrl)
           
 void setName(String name)
           
 void setOnames(Set<ObjectName> onames)
           
 void setServer(String server)
           
 void setStarted(boolean started)
           
 void setUpManagentInfos()
          Connect to the target in order to get management information allowing to identify the target : - management domain name - server name Here we suppose that the target is a J2eeServer that exposes standard MBeans like JVM MBean.
 void updateOnames(ObjectName onPattern)
          Connect to the target and get the list of MBeans corresponding to a given ObjectName pattern.
 void updateOnames(String onPattern)
          Connect to the target and get the list of MBeans corresponding to a given ObjectName pattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.ow2.util.log.Log logger

name

protected String name
Name set for the target in probe-config.xml file.


server

protected String server
Server name.


domain

protected String domain
Server domain.


jmxUrl

protected String jmxUrl
JMX URL to connect to.


jmxap

protected JmxAp jmxap
JMX Access Point.


onames

protected Set<ObjectName> onames
Targeted names.


cmdid

protected String cmdid
cmd id


adminNaming

protected boolean adminNaming
If true, the target name is used to identify the server instead of using server. Otherwise, getServer() will return the value of server.

Constructor Detail

JmxContext

public JmxContext()
Create a context for a target to be monitored via a JMX connection. The true adminNaming value (default value) means that the target name is used instead the server name in the resulted monitoring data.

Method Detail

isAdminNaming

public boolean isAdminNaming()
Returns:
true if the target name is used instead of server name to identify the monitored server.

setAdminNaming

public void setAdminNaming(boolean adminNaming)

getName

public String getName()
Returns:
the target name

setName

public void setName(String name)
Parameters:
name - target name

getServer

public String getServer()
Returns:
the server name only if isAdminNaming() returns false. Otherwise return the target name.

setServer

public void setServer(String server)
Parameters:
server - the server name

getDomain

public String getDomain()

setDomain

public void setDomain(String domain)

getJmxUrl

public String getJmxUrl()

setJmxUrl

public void setJmxUrl(String jmxUrl)

getJmxap

public JmxAp getJmxap()

setJmxap

public void setJmxap(JmxAp jmxap)

getCmdId

public String getCmdId()

setCmdId

public void setCmdId(String c)

getOnames

public Set<ObjectName> getOnames()

setOnames

public void setOnames(Set<ObjectName> onames)

getMBeanServerConnection

public MBeanServerConnection getMBeanServerConnection()

updateOnames

public void updateOnames(String onPattern)
                  throws Exception
Connect to the target and get the list of MBeans corresponding to a given ObjectName pattern. Called on poll methods.

Parameters:
onPattern - the given ObjectName pattern.
Throws:
Exception - could not get the MBean's list at this moment.

updateOnames

public void updateOnames(ObjectName onPattern)
                  throws Exception
Connect to the target and get the list of MBeans corresponding to a given ObjectName pattern. Used by the stat command.

Parameters:
onPattern - the given ObjectName pattern.
Throws:
Exception - could not get the MBean's list at this moment.

getObjectNames

public Set<ObjectName> getObjectNames(String onPattern)
                               throws Exception
Return a set of ObjectNames corresponding to a given ON pattern. The search is done in the current JMXContext.

Parameters:
onPattern - the given ON pattern
Returns:
the ObjectName set that was found
Throws:
Exception

getObjectNames

public Set<ObjectName> getObjectNames(ObjectName onPattern)
                               throws Exception
Return a set of ObjectNames corresponding to a given ON pattern. The search is done in the current JMXContext.

Parameters:
onPattern - the given ON pattern
Returns:
the ObjectName set that was found
Throws:
Exception

isStarted

public boolean isStarted()

setStarted

public void setStarted(boolean started)

setUpManagentInfos

public void setUpManagentInfos()
Connect to the target in order to get management information allowing to identify the target : - management domain name - server name Here we suppose that the target is a J2eeServer that exposes standard MBeans like JVM MBean.



Copyright © 2012 OW2 Consortium. All Rights Reserved.