How to access Hawtio user in MBean code ?
Issue
- I am using JBoss Fuse 6.2.1 as a standalone server. I have now created a MBean which I configured with the following blueprint snippet:
<bean id="addJobMBean" class="xyz.abc.MBeanWrapper" />
<bean id="mbeanRegistrer" class="org.apache.karaf.management.MBeanRegistrer" init-method="init">
<property name="mbeans">
<map>
<entry value="xyz.jobs:name=AddJob" key-ref="addJobMBean"/>
</map>
</property>
</bean>
<reference id="mbeanServer" interface="javax.management.MBeanServer">
<reference-listener ref="mbeanRegistrer" bind-method="registerMBeanServer" unbind-method="unregisterMBeanServer"/>
</reference>
- I’m accessing my MBean using Hawtio / Jolokia and everything work fine.
- But now I want to access the name of the Hawtio user, which calls my MBean methods in the Java code of my MBean. How can I access this information?
Environment
- Red Hat JBoss Fuse
- 6.2.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
