String name=info.getName().substring(0, 1).toUpperCase()+info.getName().substring(1);
if(info.isReadable()){
//For each readable attribute, we generate a getter method (following the isXX for booleans
//when it is being used on the remote side)
if(info.isIs()){
methods.add(new Signature("is"+name, Type.BOOLEAN_TYPE, new Type[0]));
}
else{
try{
methods.add(new Signature("get"+name, getType(info.getType()), new Type[0]));
}catch(ClassNotFoundException cnfe){
System.out.println("JMXINTROSPECTOR WARNING: "+info.getType()+" could not be found. Attribute will not be added to proxy.");
continue;
}
}
}
//Same with each writable att, but with setters.
if(info.isWritable()){
try{
Type [] params=new Type[]{getType(info.getType())};
Signature s=new Signature("set"+name, Type.VOID_TYPE, params);
methods.add(s);
}catch(ClassNotFoundException cnfe){
System.out.println("JMXINTROSPECTOR WARNING: "+info.getType()+" could not be found. Attribute will not be added to proxy.");
continue;
}
}
}
//same for each operation
for (MBeanOperationInfo info : minfo.getOperations()) {
try{
Type[] params=new Type[info.getSignature().length];
for (int i = 0; i < params.length; i++) {
params[i]=getType(info.getSignature()[i].getType());
}
Signature s=new Signature(info.getName(), getType(info.getReturnType()), params);
methods.add(s);
}catch(ClassNotFoundException cnfe){
System.out.println("JMXINTROSPECTOR WARNING: "+info.toString()+" could not be created. Operation will not be added to proxy.");
continue;