Are JMX CompositeDataSupport attributes always read-only in JConsole?

Following MXBeans in Java SE 6: Bundling Values Without Special JMX Client Configurations I managed to implement a MXBean which exposes a Map<String, String> for a list of configuration parameters. It appears in JConsole as expected, but all values are readonly.

In the MXBEans article, this illustration shows an example where it makes sense that the attributes are read-only as they are memory usage values.

Are JMX CompositeDataSupport attributes always read-only in JConsole?

Is there a way to make the attributes editable in JConsole?

--------------Solutions-------------

Try using Spring MBeanExporter.
I am not sure, if this is feasible with you or not.
But it is very easy. Here is a very good example.

Thanks.

To make attributes writable from JConsole, you need to expose the setter methods also in your MBean Interface.

package com.example;
public interface HelloMBean {

public void sayHello();
public int add(int x, int y);

public String getName();

public int getCacheSize();
public void setCacheSize(int size);

}

In this name is readOnly, cacheSize is read as well as write enabled.

I don't think you can make the individual elements writable (think about it from a remote API perspective, the compound type is simply a DTO, the mbean is the remote interface), but i do think you can make the whole compound attribute writable, e.g.:

public Map<String,String> getConfig() {}

public void setConfig(Map<String,String> newConfig) {}

that said, i'm not sure if jconsole supports editing compound attributes even if they are writable.

Category:java Time:2011-02-13 Views:2256
Tags: java jmx jconsole

Related post

  • How to activate JMX on my JVM for access with jconsole? 2009-05-13

    How to activate JMX on a JVM for access with jconsole? --------------Solutions------------- The relevant documentation can be found here: http://java.sun.com/javase/6/docs/technotes/guides/management/agent.html Start your program with following param

  • JMX MXBean Attributes all UNDEFINED - Spring 3.0.x/Tomcat 6.0 2011-04-22

    I've been trying to get a sample JMX MXBean working in a Spring-configured webapp, but any basic attributes on the MXBean are coming up as UNDEFINED when I connect with jconsole. Java interface/classes: public interface IJmxBean { // marker interface

  • understand tomcat HTTP connector port from JMX MBeans 2009-03-17

    I am connecting to tomcat over JMX. I wrote a simple JMX client to connect to tomcat and read different JMX MBean attributes to monitor tomcat. My problem is, I would like to know which port tomcat's HTTP connector is listenting. Is there a way to ge

  • What is the best or most commonly used JMX Console / Client 2009-11-16

    I have a server application that has been instrumented using JMX so that it can be monitored in test and production environments. I wish to show the current value of some JMX exposed attributes as well as the long term trends in a graphical format. W

  • JMX-Spring - When is a 'JMXNotification' broadcasted? 2010-11-23

    I was going through the Spring documentation on JMX and came across the following paragraph: By configuring NotificationListeners in place, every time a JMX Notification is broadcast from the target MBean (bean:name=testBean1),the ConsoleLoggingNotif

  • Does Java 6 open a default port for JMX remote connections? 2009-02-05

    My specific question has to do with JMX as used in JDK 1.6: if I am running a Java process using JRE 1.6 with com.sun.management.jmxremote in the command line, does Java pick a default port for remote JMX connections? Backstory: I am currently trying

  • How to activate JMX on my JROCKIT JVM for access with jconsole? 2011-01-21

    How to activate JMX on my JROCKIT JVM for access with jconsole? (somewhat a follow up question to How to activate JMX on my JVM for access with jconsole?) The main reason I ask is, because I get strange errors if I try to run jboss (6.0.0.Final) with

  • JBoss Application Server admin console? 2008-10-14

    I know that the JBoss Application Server has the JMX-Console as a GUI for administration. My question is, is there a similar admin tool using the command line? Does this tool come with the application server, and can it report on the status of variou

  • Connection Pool Monitoring 2011-11-23

    I need an insight on monitoring connection pool in my web application. The technical specifications about the application is mentioned below: Application Server - JBoss Application Server Database - Oracle 10g Back-end - Hibernate I need to know that

  • Apache shiro - how do I know that caching is working for authorization? 2012-02-20

    I am using Apache Shiro in my Tomcat and I want to enable caching of authorization through EhCache. What I've done is adding these two lines in shiro.ini: cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager securityManager.cacheManager = $ca

  • Starting and stopping Apache Camel routes from admin UI 2014-08-05

    I have a Apache Camel context which is part of a large Spring application. The application has a web based admin UI. I'd like to be able to stop/start/suspend/resume the camel routes from within this UI. How can I achieve this? Currently my Camel con

  • Tool for posting test messages onto a JMS queue? 2008-09-01

    Can anyone recommend a tool for quickly posting test messages onto a JMS queue? The tool should allow the user to enter some data, perhaps an XML payload, and then submit it to a queue? I know I could probably knock something up reasonably quickly to

  • Which memory related Tomcat JVM startup parameters are worth tuning? 2010-06-12

    I'm trying to understand the fine art of tuning Tomcat memory settings. In this quest I have the following three questions: Which memory related JVM startup parameters are worth setting when running Tomcat? Why? What are useful rule-of-thumbs when fi

  • Monitor JVM on tomcat service 2010-07-05

    Hi I noticed that different tools for monitoring JVM require that the process will be java.exe in the taskbar. Its process id is supplied to them and then statistics regarding garbage collection and etc are returned. When running tomcat as a service,

  • How can I connect to Weblogic remotely using JConsole? 2011-01-17

    Which URL, port and weblogic server side settings do I need to use? --------------Solutions------------- It depends if you want to connect to a WebLogic MBean server (Domain, Runtime, Edit) or platform (JDK) MBean server (See MBean Servers). Connecti

  • Howto use custom JMXAuthenticator 2011-05-25

    I have to authenticate JMX clients against entries in a database. Therefore I have written a custom JMXAuthenticator implementation. When starting up my application I can access the MBeans using JConsole via the 'Local Process'. But when I try to acc

  • System monitor for Java 2011-08-30

    We're running clusters of servers for a dozen customers. Each customer has a few app servers on Jetty. What's important here is: There are many Java processes to monitor. I need to be able to group (slice) them by machine and by customer (one machine

  • How can I get all messages from a ActiveMQ broker? 2011-10-11

    So I have an ActiveMQ broker and some producers that puts some self made objects in the broker. I also have some consumers that receive those messages(serialized objects) without problem. But I want to create a tool that connects to the broker and di

  • How to write a Java daemon 2011-10-18

    This will be a network application that will always (or near as always as I can manage) be listening on a given port. I'm fairly new to Java, and very new to non-web server side programming, so I'd like to get feedback from the community on my assump

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 18.003 (s). 14 q(s)