private static MBeanConstructorInfo customize(MBeanConstructorInfo ci, String description, MBeanParameterInfo[] signature) { if (equal(description, ci.getDescription()) && identicalArrays(signature, ci.getSignature())) return ci; if (ci instanceof OpenMBeanConstructorInfo) { OpenMBeanParameterInfo[] oparams = paramsToOpenParams(signature); return new OpenMBeanConstructorInfoSupport(ci.getName(), description, oparams, ci.getDescriptor()); } else { return new MBeanConstructorInfo(ci.getName(), description, signature, ci.getDescriptor()); } }
private OpenMBeanConstructorInfo[] createMBeanConstructorInfo() { return new OpenMBeanConstructorInfoSupport[] { }; }
protected void cacheMBeanInfo(MBeanInfo info) { if (info == null) return; try { MBeanAttributeInfo[] oldA = info.getAttributes(); OpenMBeanAttributeInfo[] attribs = new OpenMBeanAttributeInfoSupport[oldA.length]; for (int a = 0; a < oldA.length; ++a) { OpenMBeanParameterInfo param = Translator.translate(oldA[a].getType()); if (param.getMinValue() == null) { Object[] lv; if (param.getLegalValues() == null) lv = null; else lv = param.getLegalValues().toArray(); attribs[a] = new OpenMBeanAttributeInfoSupport(oldA[a].getName(), oldA[a].getDescription(), ((OpenType<Object>) param.getOpenType()), oldA[a].isReadable(), oldA[a].isWritable(), oldA[a].isIs(), param.getDefaultValue(), lv); } else attribs[a] = new OpenMBeanAttributeInfoSupport(oldA[a].getName(), oldA[a].getDescription(), ((OpenType<Object>) param.getOpenType()), oldA[a].isReadable(), oldA[a].isWritable(), oldA[a].isIs(), param.getDefaultValue(), ((Comparable<Object>) param.getMinValue()), ((Comparable<Object>) param.getMaxValue())); } MBeanConstructorInfo[] oldC = info.getConstructors(); OpenMBeanConstructorInfo[] cons = new OpenMBeanConstructorInfoSupport[oldC.length]; for (int a = 0; a < oldC.length; ++a) cons[a] = new OpenMBeanConstructorInfoSupport(oldC[a].getName(), oldC[a].getDescription(), translateSignature(oldC[a].getSignature())); MBeanOperationInfo[] oldO = info.getOperations(); OpenMBeanOperationInfo[] ops = new OpenMBeanOperationInfoSupport[oldO.length]; for (int a = 0; a < oldO.length; ++a) ops[a] = new OpenMBeanOperationInfoSupport(oldO[a].getName(), oldO[a].getDescription(), translateSignature(oldO[a].getSignature()), Translator.translate(oldO[a].getReturnType()).getOpenType(), oldO[a].getImpact()); openInfo = new OpenMBeanInfoSupport(info.getClassName(), info.getDescription(), attribs, cons, ops, info.getNotifications()); } catch (OpenDataException e) { throw (InternalError) (new InternalError("A problem occurred creating the open type " + "descriptors.").initCause(e)); } }
private OpenMBeanConstructorInfo[] getConstructors() { //This can be left empty return null; }