cz.cuni.amis.pogamut.base.utils.jmx
Class PogamutJMX

Package class diagram package PogamutJMX
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.utils.jmx.PogamutJMX

public class PogamutJMX
extends Object

PogamutJMX serves as a placeholder for creating ObjectNames for various Pogamut components (classes).

It will be important to you only in the case when you will need to interface Pogamut agents via JMX, it will allow you to construct correct ObjectNames that identifies them inside the MBean server.

Still the biggest trick is to obtain IAgentId (or at least its IAgentId.getToken()) in order to obtain correct getAgentObjectName(IToken).

Note that concrete object names of various agent's components might be obtained by calling static method on concrete class, i.e., JMXLogCategories#getJMXLogCategoryName.

Author:
Jimmy

Field Summary
static String ACT_NAME
          Used by Act class
static String AGENT_LOGGER_SUBTYPE
          Used by AgentLogger class.
static String AGENT_SUBTYPE
          Used by AbstractAgent (i.e., AgentJMXComponents) class
static String FLAGS_SUBTYPE
          Flag class
static String INTROSPECTION_NAME
          introspection FolderToJMXEnabledAdapter class
static String LOGCATEGORIES_NAME
          Used by LogCategory class
static String LOGCATEGORY_SUBTYPE
          LogCategory class
 
Constructor Summary
PogamutJMX()
           
 
Method Summary
static ObjectName getAgentObjectName(cz.cuni.amis.utils.token.IToken agentId)
          Returns an ObjectName for the Pogamut's agents given by his 'agentId'.
static ObjectName getAgentObjectName(String agentId)
          Returns an ObjectName for the Pogamut's agents given by his 'agentId'.
static ObjectName getObjectName(ObjectName parent, String childName)
          Creates hierarchical ObjectNames given a parent and name of the MBean.
static ObjectName getObjectName(ObjectName parent, String childName, String childTypeExtra)
          Creates hierarchical ObjectNames given a parent and name of the MBean.
static ObjectName getObjectName(String jmxDomain, String type, String name)
          Returns well formed JMX indentificator based on the domain / type / name.
static String getPogamutJMXDomain()
          Returns an JMX Domain id used by Pogamut's agents.
static String getSafeObjectNamePart(String str)
          Replaces JMX URL chars with '_'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AGENT_SUBTYPE

public static final String AGENT_SUBTYPE
Used by AbstractAgent (i.e., AgentJMXComponents) class

See Also:
Constant Field Values

ACT_NAME

public static final String ACT_NAME
Used by Act class

See Also:
Constant Field Values

LOGCATEGORIES_NAME

public static final String LOGCATEGORIES_NAME
Used by LogCategory class

See Also:
Constant Field Values

LOGCATEGORY_SUBTYPE

public static final String LOGCATEGORY_SUBTYPE
LogCategory class

See Also:
Constant Field Values

FLAGS_SUBTYPE

public static final String FLAGS_SUBTYPE
Flag class

See Also:
Constant Field Values

INTROSPECTION_NAME

public static final String INTROSPECTION_NAME
introspection FolderToJMXEnabledAdapter class

See Also:
Constant Field Values

AGENT_LOGGER_SUBTYPE

public static String AGENT_LOGGER_SUBTYPE
Used by AgentLogger class.

Constructor Detail

PogamutJMX

public PogamutJMX()
Method Detail

getAgentObjectName

public static ObjectName getAgentObjectName(cz.cuni.amis.utils.token.IToken agentId)
Returns an ObjectName for the Pogamut's agents given by his 'agentId'.

Used by AgentJMXComponents.

Parameters:
agentId - id of the agent that

getAgentObjectName

public static ObjectName getAgentObjectName(String agentId)
Returns an ObjectName for the Pogamut's agents given by his 'agentId'.

Used by AgentJMXComponents.

Parameters:
agentId - id of the agent that

getPogamutJMXDomain

public static String getPogamutJMXDomain()
Returns an JMX Domain id used by Pogamut's agents.

Returns:
jmx domain used by Pogamut's agents.

getObjectName

public static ObjectName getObjectName(ObjectName parent,
                                       String childName,
                                       String childTypeExtra)
                                throws PogamutJMXNameException
Creates hierarchical ObjectNames given a parent and name of the MBean. Extra elements can be inserted into the path through typeExtra param.

Parameters:
parent - parent's ObjectName
childName - name of this object, if null no name element will be appended
childTypeExtra - extra element inserted to the end of hierarchical path, may be null
Returns:
ObjectName of form: domain=[parent's domain],type=[parent's type].[parent's name].[child extra type],name=[childName]
Throws:
PogamutJMXNameException

getObjectName

public static ObjectName getObjectName(ObjectName parent,
                                       String childName)
                                throws PogamutJMXNameException
Creates hierarchical ObjectNames given a parent and name of the MBean. Extra elements can be inserted into the path through typeExtra param.

Parameters:
parent - parent's ObjectName
childName - name of this object, if null no name element will be appended
Returns:
ObjectName of form: domain=[parent's domain],type=[parent's type].[parent's name],name=[name]
Throws:
PogamutJMXNameException

getSafeObjectNamePart

public static String getSafeObjectNamePart(String str)
Replaces JMX URL chars with '_'.

Parameters:
str -
Returns:

getObjectName

public static ObjectName getObjectName(String jmxDomain,
                                       String type,
                                       String name)
                                throws PogamutJMXNameException
Returns well formed JMX indentificator based on the domain / type / name.

Can be used to create ObjectName instance from javax.management package to identify the object inside MBeanServer.

Parameters:
jmxDomain - must be well formed
type - must be well formed
name - may be null, may contain invalid chars (will be replaced with '_')
Returns:
instance containing well-formed ObjectName
Throws:
PogamutJMXNameException


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.