How to access Hawtio user in MBean code ?

Solution Verified - Updated -

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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content