I had the same question, sort of. I think I want the same thing you do. I want a "read-only" attribute (I don't want any user code modifying it - either through a JMX console, a remote JMX API call, etc.). However, i want the deployer to be able to set it in via its [mbean>[attribute> setting in my jboss-service.xml.
The only way I can this as being possible is to have my MBean define a read-write attribute, but have it act as a "read-but-write-only-once". My setter will have to maintain an internal member variable "wasSet" whose default is false. When the setter is called, if "wasSet" is false, it sets the attribute but then sets wasSet to true, disabling any future calls to the setter. This would allow, at deployment time, the [mbean>[attribute> setting to work, but thereafter, the MBean attribute is considered read-only. The use-case for this feature is a security setting that I have. I have a setting that, for security purposes, should not be allowed to be set by anyone during the time the MBean is registered in the MBeanServer. But I want the deployer of the MBean to have the option to configure this security feature (enable it or disable it). Hence why I need the capability to set the attribute for the first time. This way, the deploy can set the [mbean>[attribute> to whatever they want and not be afraid that some other code will come later and revert the setting. Am I missing some JBossAS feature or is this the only way to do it? View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3864422#3864422 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3864422 ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ JBoss-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jboss-user
