if( ! ( realObj instanceof DynamicMBean )) {
return null;
}
DynamicMBean dmb=(DynamicMBean)realObj;
ManagedBean mbean= new ManagedBean();
MBeanInfo mbi=dmb.getMBeanInfo();
try {
MBeanAttributeInfo attInfo[]=mbi.getAttributes();
for( int i=0; i<attInfo.length; i++ ) {
MBeanAttributeInfo mai=attInfo[i];
String name=mai.getName();
AttributeInfo ai=new AttributeInfo();
ai.setName( name );
ai.setType( mai.getType());
ai.setReadable( mai.isReadable());
ai.setWriteable( mai.isWritable());
mbean.addAttribute(ai);
}
MBeanOperationInfo opInfo[]=mbi.getOperations();
for( int i=0; i<opInfo.length; i++ ) {
MBeanOperationInfo moi=opInfo[i];
OperationInfo op=new OperationInfo();
op.setName(moi.getName());
op.setReturnType(moi.getReturnType());
MBeanParameterInfo parms[]=moi.getSignature();
for(int j=0; j<parms.length; j++ ) {
ParameterInfo pi=new ParameterInfo();
pi.setType(parms[i].getType());
pi.setName(parms[i].getName());
op.addParameter(pi);
}
mbean.addOperation(op);
}
if( log.isDebugEnabled())
log.debug("Setting name: " + type );
mbean.setName( type );
return mbean;
} catch( Exception ex ) {
ex.printStackTrace();
return null;