Java Reference
In-Depth Information
private void buildDynamicMBeanInfo() throws Exception
{
MBeanOperationInfo[] ops =
new MBeanOperationInfo[ operations.size() ];
copyInto( ops, operations );
MBeanAttributeInfo[] atts =
new MBeanAttributeInfo[ attributes.size()];
copyInto( atts, attributes );
MBeanConstructorInfo[] cons =
new MBeanConstructorInfo[ constructors.size() ];
copyInto( cons, constructors );
mbeanInfo = new MBeanInfo(
this.getClass().getName(), description,
atts, cons, ops, null );
}
private void copyInto( Object[] array, Hashtable table )
{
Vector temp = new Vector( table.values() );
temp.copyInto( array );
}
private String getType( String attName,
boolean read, boolean write )
{
boolean allowed = true;
if( attributes.containsKey( attName ) )
{
MBeanAttributeInfo temp = ( MBeanAttributeInfo )
attributes.get( attName );
if( read )
{
if( !temp.isReadable() )
allowed = false;
}
if( write )
{
if( !temp.isWritable() )
allowed = false;
}
if( !allowed )
return null;
else
return temp.getType();
}
else return null;
}
}//class
Search WWH ::




Custom Search