com.mtgi.jmx.export.naming
Class ApplicationNamingStrategy

java.lang.Object
  extended by com.mtgi.jmx.export.naming.ApplicationNamingStrategy
All Implemented Interfaces:
org.springframework.jmx.export.naming.ObjectNamingStrategy

public class ApplicationNamingStrategy
extends Object
implements org.springframework.jmx.export.naming.ObjectNamingStrategy

A delegating naming strategy, which collects all JMX beans into a single domain by application name. The original domain of all beans collected into the application is converted into the 'package' property, which is set at the beginning of the property list.

For example, com.mtgi:group=analytics,name=BehaviorTrackingLog would become myapp:package=com.mtgi,group=analytics,name=BehaviorTrackingLog if the application name is "myapp".

Useful primarily for complex deployments, where many applications might use the same framework classes (therefore increasing the risk of a naming collision).


Constructor Summary
ApplicationNamingStrategy()
           
 
Method Summary
 ObjectName getObjectName(Object managedBean, String beanKey)
           
static String quote(String input)
          reluctantly quote the given input string (quoting only applied if the string contains control characters)
 void setApplication(String application)
           
 void setDelegate(org.springframework.jmx.export.naming.ObjectNamingStrategy delegate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationNamingStrategy

public ApplicationNamingStrategy()
Method Detail

setApplication

public void setApplication(String application)

setDelegate

public void setDelegate(org.springframework.jmx.export.naming.ObjectNamingStrategy delegate)

getObjectName

public ObjectName getObjectName(Object managedBean,
                                String beanKey)
                         throws MalformedObjectNameException
Specified by:
getObjectName in interface org.springframework.jmx.export.naming.ObjectNamingStrategy
Throws:
MalformedObjectNameException

quote

public static final String quote(String input)
reluctantly quote the given input string (quoting only applied if the string contains control characters)