try { minfo = mBeanServer.getMBeanInfo(oname); code = minfo.getClassName(); String prs = ""; try {
try { minfo = mBeanServer.getMBeanInfo(oname); code = minfo.getClassName(); if (description) descriptionStr = minfo.getDescription(); String prs = "";
sb.append(bean); sb.append('\n'); sb.append(mbinfo.getClassName()); sb.append('\n'); sb.append(" - " + mbinfo.getDescription());
private static void listBeans(ObjectName query, JsonGenerator jg, MBeanServerConnection mBeanServer) throws Exception { Set<ObjectName> names = null; names = mBeanServer.queryNames(query, null); jg.writeArrayFieldStart("beans"); Iterator<ObjectName> it = names.iterator(); while (it.hasNext()) { ObjectName oname = it.next(); MBeanInfo minfo; String code = ""; minfo = mBeanServer.getMBeanInfo(oname); code = minfo.getClassName(); String prs = ""; if ("org.apache.commons.modeler.BaseModelMBean".equals(code)) { prs = "modelerType"; code = (String) mBeanServer.getAttribute(oname, prs); } jg.writeStartObject(); jg.writeStringField("name", oname.toString()); jg.writeStringField("modelerType", code); MBeanAttributeInfo attrs[] = minfo.getAttributes(); for (int i = 0; i < attrs.length; i++) { writeAttribute(mBeanServer, jg, oname, attrs[i]); } jg.writeEndObject(); } jg.writeEndArray(); }
return; log.info("CLASSNAME: \t" + info.getClassName()); log.info("DESCRIPTION: \t" + info.getDescription()); log.info("ATTRIBUTES");
try { minfo = mBeanServer.getMBeanInfo(oname); code = minfo.getClassName(); String prs = ""; try {
entry.setTimestamp(System.currentTimeMillis()); entry.setTarget(extractTargetTypeProperty(objectName)); entry.setOperation(this.getMBeanInfo().getClassName() + "." + s);
MBeanInfo mBeanInfo = mbs.getMBeanInfo(oname); assertEquals(MetricsMBeanImpl.class.getName(), mBeanInfo.getClassName());
/** * The update method is overridden here directly since the usual extraction method * is not needed * * {@inheritDoc} * */ @Override void update(JSONObject pJSONObject, MBeanInfo pMBeanInfo, Stack<String> pPathStack) { verifyThatPathIsEmpty(pPathStack); pJSONObject.put(getKey(), pMBeanInfo.getClassName()); }
private MBeanInfo getWrappedInfo(MBeanInfo pMBeanInfo) { MBeanAttributeInfo[] attrInfo = getWrappedAttributeInfo(pMBeanInfo); MBeanOperationInfo[] opInfo = getWrappedOperationInfo(pMBeanInfo); return new MBeanInfo(pMBeanInfo.getClassName(), pMBeanInfo.getDescription(), attrInfo, null, /* We dont allow construction of this MBean, hence null-constructors */ opInfo, pMBeanInfo.getNotifications() ); }
private Object invokeOperation(Message<?> requestMessage, ObjectName objectName, String operation, Map<String, Object> paramsFromMessage) throws JMException, IOException { MBeanInfo mbeanInfo = this.server.getMBeanInfo(objectName); MBeanOperationInfo[] opInfoArray = mbeanInfo.getOperations(); boolean hasNoArgOption = false; for (MBeanOperationInfo opInfo : opInfoArray) { if (operation.equals(opInfo.getName())) { MBeanParameterInfo[] paramInfoArray = opInfo.getSignature(); if (paramInfoArray.length == 0) { hasNoArgOption = true; } if (paramInfoArray.length == paramsFromMessage.size()) { Object[] values = new Object[paramInfoArray.length]; String[] signature = new String[paramInfoArray.length]; int index = populateValuesAndSignature(paramsFromMessage, paramInfoArray, values, signature); if (index == paramInfoArray.length) { return this.server.invoke(objectName, operation, values, signature); } } } } if (hasNoArgOption) { return this.server.invoke(objectName, operation, null, null); } else { throw new MessagingException(requestMessage, "failed to find JMX operation '" + operation + "' on MBean [" + objectName + "] of type [" + mbeanInfo.getClassName() + "] with " + paramsFromMessage.size() + " parameters: " + paramsFromMessage); } }
try { MBeanInfo info = server.getMBeanInfo(name); className = info.getClassName(); description = info.getDescription(); Object mxbeanValue = info.getDescriptor().getFieldValue("mxbean");
TreeElement root = new TreeElement(info.getClassName()); row("ClassName", info.getClassName()). row("Description", info.getDescription()
public Object getAttribute(MBeanMetaData metadata, String attribute) throws MBeanException, AttributeNotFoundException, ReflectionException { checkPermission(metadata.info.getClassName(), attribute, metadata.name, "getAttribute"); return super.getAttribute(metadata, attribute); }
@Override public ObjectInstance getObjectInstance(ObjectName name) throws InstanceNotFoundException { DynamicMBean mbean = getMBean(name); return new ObjectInstance(name, mbean.getMBeanInfo().getClassName()); }
@Override public MBeanInfo getMBeanInfo() { MBeanInfo info = super.getMBeanInfo(); return new MBeanInfo(info.getClassName(), info.getDescription(), info.getAttributes(), info.getConstructors(), fillMBeanOperationInfo(), info.getNotifications()); }
@Override public MBeanInfo getMBeanInfo() { MBeanInfo info = super.getMBeanInfo(); return new MBeanInfo(info.getClassName(), info.getDescription(), info.getAttributes(), info.getConstructors(), MBeanInfoHelper.getMBeanOperationsInfo(TopicControl.class), info.getNotifications()); }
@Override public MBeanInfo getMBeanInfo() { MBeanInfo info = super.getMBeanInfo(); return new MBeanInfo(info.getClassName(), info.getDescription(), info.getAttributes(), info.getConstructors(), fillMBeanOperationInfo(), info.getNotifications()); }
protected ManagedBeanInfo createManagedBeanInfo(JmxInstance jmx, ObjectName name, MBeanInfo info) { ManagedBeanInfo mbi = metadata.create(ManagedBeanInfo.class); mbi.setClassName(info.getClassName()); mbi.setDescription(info.getDescription()); mbi.setObjectName(name.toString()); mbi.setDomain(name.getDomain()); mbi.setPropertyList(name.getKeyPropertyListString()); mbi.setJmxInstance(jmx); return mbi; }
public void serialize(QName name, Attributes attributes, Object value, SerializationContext context) throws IOException { MBeanInfo info = (MBeanInfo)value; context.startElement(name, attributes); context.serialize(CLASS_NAME_QNAME, null, info.getClassName()); context.serialize(DESCRIPTION_QNAME, null, info.getDescription()); context.serialize(ATTRIBUTES_QNAME, null, info.getAttributes()); context.serialize(CONSTRUCTORS_QNAME, null, info.getConstructors()); context.serialize(OPERATIONS_QNAME, null, info.getOperations()); context.serialize(NOTIFICATIONS_QNAME, null, info.getNotifications()); context.endElement(); }