private static ObjectName getMBeanObjectName ( final String contextPath , final String objectType , final String mBeanPrefix , final String resourceType ) { String curCtxPath = contextPath ; if ( StringUtils . isEmpty ( curCtxPath ) ) { curCtxPath = ServletContextUtils . getContextPath ( null ) ; } if ( curCtxPath . charAt ( 0 ) == ( ' ' ) ) { curCtxPath = curCtxPath . substring ( 1 ) ; } String prefix = mBeanPrefix ; if ( prefix == null ) { prefix = DEFAULT_PREFIX ; } StringBuilder objectNameStr = new StringBuilder ( "net.jawr.web.jmx:type=" + objectType + ",prefix=" + prefix + ",webappContext=" + curCtxPath ) ; if ( resourceType != null ) { objectNameStr . append ( ",name=" ) . append ( resourceType ) . append ( "MBean" ) ; } return getObjectName ( objectNameStr . toString ( ) ) ; }
Returns the object name for the Jawr MBean