Descriptor desc = info.getDescriptor(); if (method.equals(pd.getReadMethod())) { desc.setField(FIELD_ROLE, ROLE_GETTER); Descriptor desc = info.getDescriptor(); desc.setField(FIELD_ROLE, ROLE_OPERATION); if (isExposeClassDescriptor()) {
m.getReturnType() .getName(), impact); info.getDescriptor().setField("visibility", Integer.toString(visibility)); infos.add(info);
Descriptor desc = info.getDescriptor(); if (method.equals(pd.getReadMethod())) { desc.setField(FIELD_ROLE, ROLE_GETTER); Descriptor desc = info.getDescriptor(); desc.setField(FIELD_ROLE, ROLE_OPERATION); if (isExposeClassDescriptor()) {
@Test public void testAttributeHasCorrespondingOperations() throws Exception { ModelMBeanInfo info = getMBeanInfoFromAssembler(); ModelMBeanOperationInfo get = info.getOperation("getName"); assertNotNull("get operation should not be null", get); assertEquals("get operation should have visibility of four", get.getDescriptor().getFieldValue("visibility"), new Integer(4)); assertEquals("get operation should have role \"getter\"", "getter", get.getDescriptor().getFieldValue("role")); ModelMBeanOperationInfo set = info.getOperation("setName"); assertNotNull("set operation should not be null", set); assertEquals("set operation should have visibility of four", set.getDescriptor().getFieldValue("visibility"), new Integer(4)); assertEquals("set operation should have role \"setter\"", "setter", set.getDescriptor().getFieldValue("role")); }
@Test public void testOperationDescriptor() throws Exception { ModelMBeanInfo info = getMBeanInfoFromAssembler(); Descriptor desc = info.getOperation("myOperation").getDescriptor(); assertEquals("Currency Time Limit should be 30", "30", desc.getFieldValue("currencyTimeLimit")); assertEquals("Role should be \"operation\"", "operation", desc.getFieldValue("role")); }
Descriptor operationDescriptor = operInfo.getDescriptor(); if (operationDescriptor == null) throw new MBeanException(new ServiceNotFoundException(
protected void initOperationContexts(MBeanOperationInfo[] operations) { // make sure we invoke the super class initialization sequence first super.initOperationContexts(operations); for (int i = 0; i < operations.length; ++i) { OperationKey key = new OperationKey(operations[i]); InvocationContext ctx = (InvocationContext) operationContextMap.get(key); ModelMBeanOperationInfo info = (ModelMBeanOperationInfo) operations[i]; ctx.setDescriptor(info.getDescriptor()); } }
protected void initOperationContexts(MBeanOperationInfo[] operations) { // make sure we invoke the super class initialization sequence first super.initOperationContexts(operations); for (int i = 0; i < operations.length; ++i) { OperationKey key = new OperationKey(operations[i]); InvocationContext ctx = (InvocationContext) operationContextMap.get(key); ModelMBeanOperationInfo info = (ModelMBeanOperationInfo) operations[i]; ctx.setDescriptor(info.getDescriptor()); } }
m.getReturnType() .getName(), impact); info.getDescriptor().setField("visibility", Integer.toString(visibility)); infos.add(info);
String role = (String) opinfo.getDescriptor().getFieldValue("role"); if ("getter".equals(role) || stripAllRoles) ModelMBeanOperationInfo opinfo = (ModelMBeanOperationInfo) opsMap.get(key); String role = (String) opinfo.getDescriptor().getFieldValue("role"); if ("setter".equals(role) || stripAllRoles)
Descriptor desc = info.getDescriptor(); if (method.equals(pd.getReadMethod())) { desc.setField(FIELD_ROLE, ROLE_GETTER); Descriptor desc = info.getDescriptor(); desc.setField(FIELD_ROLE, ROLE_OPERATION); if (isExposeClassDescriptor()) {
String role = (String) opinfo.getDescriptor().getFieldValue("role"); if ("getter".equals(role) || stripAllRoles) ModelMBeanOperationInfo opinfo = (ModelMBeanOperationInfo) opsMap.get(key); String role = (String) opinfo.getDescriptor().getFieldValue("role"); if ("setter".equals(role) || stripAllRoles)
protected JmxOperation buildOperation(Class<?> managedClass, Method operation) { MBeanOperation jmxOperation = new MBeanOperation( operation, getOperationExportName(managedClass, operation), getOperationDescription(managedClass, operation), getOperationParameters(managedClass, operation)); Descriptor desc = jmxOperation.getMetadata().getDescriptor(); populateOperationDescriptor(managedClass, operation, desc); jmxOperation.getMetadata().setDescriptor(desc); return jmxOperation; }
(getName(), getDescription(), parameters, getReturnType(), impact); Descriptor descriptor = info.getDescriptor(); descriptor.removeField("class"); descriptor.setField("role", getRole());
Descriptor operationDescriptor = operInfo.getDescriptor(); if (operationDescriptor == null) throw new MBeanException(new ServiceNotFoundException(LocalizedStrings.MX4JModelMBean_OPERATION_DESCRIPTOR_FOR_OPERATION_0_CANNOT_BE_NULL.toLocalizedString(method))); String role = (String)operationDescriptor.getFieldValue("role");
Descriptor operationDescriptor = operInfo.getDescriptor(); if (operationDescriptor == null) throw new MBeanException(new ServiceNotFoundException(LocalizedStrings.MX4JModelMBean_OPERATION_DESCRIPTOR_FOR_OPERATION_0_CANNOT_BE_NULL.toLocalizedString(method))); String role = (String)operationDescriptor.getFieldValue("role");