Java Reference
In-Depth Information
else if( name.startsWith( "get" ) )
{
if ( atts.containsKey( name.substring( 3 ) ) )
atts.put( name.substring( 3 ), "rw" );
else
atts.put( name.substring( 3 ), "r" );
attributeGet = true;
}
else
{
ops.addElement( name );
if( m.getReturnType() != null )
opsReturns.put( name, m.getReturnType().getName() );
Class[] sig = m.getParameterTypes();
String[] params = new String[ sig.length ];
for( int k = 0; k < sig.length; k++ )
params[k] = sig[k].getName();
opsArgTypes.put( name, params );
}
if( attributeSet )
attTypes.put( name.substring( 3 ),
m.getReturnType().getName() );
else if( attributeGet )
attTypes.put( name.substring( 3 ), "java.lang.String" );
}//for
}
public static void main( String args[] )
{
String classname = args[0];
String location = args[1];
EJBMBeanGenerator emg = new EJBMBeanGenerator( classname );
emg.buildMBean( location );
}
}//class
14.6 Summary
This chapter presented the idea of combining JMX MBeans with your Enterprise
JavaBeans applications. EJB s deliver access and manipulation of enterprise data
and are the foundation for robust enterprise applications. However, EJB s do not
provide capabilities for managing EJB configurations or for EJB monitoring. By
integrating an MBean into each EJB , JMX can provide a window into an EJB
application and allow for back-end configuration and monitoring.
Search WWH ::




Custom Search