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

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

public abstract class JmxContext
extends java.lang.Object
implements java.io.Serializable

Main context for jmx environment.

Author:
Guillaume Renault
See Also:
Serialized Form

Field Summary
protected  java.lang.String domain
          Server domain.
protected  JmxAp jmxap
          JMX Access Point.
protected  java.lang.String jmxUrl
          JMX URL to connect to.
protected  org.ow2.util.log.Log logger
           
protected  java.lang.String name
          Name set for the target in the jmxurls.properties file.
protected  java.util.Set<javax.management.ObjectName> onames
          Targeted names.
protected  java.lang.String server
          Server name.
 
Constructor Summary
JmxContext()
           
 
Method Summary
 java.lang.String getDomain()
           
 JmxAp getJmxap()
           
 java.lang.String getJmxUrl()
           
 javax.management.MBeanServerConnection getMBeanServerConnection()
           
 java.lang.String getName()
           
 java.util.Set<javax.management.ObjectName> getObjectNames(javax.management.ObjectName onPattern)
          Return a set of ObjectNames corresponding to a given ON pattern.
 java.util.Set<javax.management.ObjectName> getObjectNames(java.lang.String onPattern)
          Return a set of ObjectNames corresponding to a given ON pattern.
 java.util.Set<javax.management.ObjectName> getOnames()
           
 java.lang.String getServer()
           
 boolean isStarted()
           
 void setDomain(java.lang.String domain)
           
 void setJmxap(JmxAp jmxap)
           
 void setJmxUrl(java.lang.String jmxUrl)
           
 void setName(java.lang.String name)
           
 void setOnames(java.util.Set<javax.management.ObjectName> onames)
           
 void setServer(java.lang.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(javax.management.ObjectName onPattern)
          Connect to the target and get the list of MBeans corresponding to a given ObjectName pattern.
 void updateOnames(java.lang.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 java.lang.String name
Name set for the target in the jmxurls.properties file.


server

protected java.lang.String server
Server name.


domain

protected java.lang.String domain
Server domain.


jmxUrl

protected java.lang.String jmxUrl
JMX URL to connect to.


jmxap

protected JmxAp jmxap
JMX Access Point.


onames

protected java.util.Set<javax.management.ObjectName> onames
Targeted names.

Constructor Detail

JmxContext

public JmxContext()
Method Detail

getName

public java.lang.String getName()
Returns:
the target name

setName

public void setName(java.lang.String name)
Parameters:
name - target name

getServer

public java.lang.String getServer()
Returns:
the server name

setServer

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

getDomain

public java.lang.String getDomain()

setDomain

public void setDomain(java.lang.String domain)

getJmxUrl

public java.lang.String getJmxUrl()

setJmxUrl

public void setJmxUrl(java.lang.String jmxUrl)

getJmxap

public JmxAp getJmxap()

setJmxap

public void setJmxap(JmxAp jmxap)

getOnames

public java.util.Set<javax.management.ObjectName> getOnames()

setOnames

public void setOnames(java.util.Set<javax.management.ObjectName> onames)

getMBeanServerConnection

public javax.management.MBeanServerConnection getMBeanServerConnection()

updateOnames

public void updateOnames(java.lang.String onPattern)
                  throws java.lang.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:
java.lang.Exception - could not get the MBean's list at this moment.

updateOnames

public void updateOnames(javax.management.ObjectName onPattern)
                  throws java.lang.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:
java.lang.Exception - could not get the MBean's list at this moment.

getObjectNames

public java.util.Set<javax.management.ObjectName> getObjectNames(java.lang.String onPattern)
                                                          throws java.lang.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:
java.lang.Exception

getObjectNames

public java.util.Set<javax.management.ObjectName> getObjectNames(javax.management.ObjectName onPattern)
                                                          throws java.lang.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:
java.lang.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 © 2010 OW2 Consortium. All Rights Reserved.