1 Reply Latest reply on May 19, 2010 4:04 AM by jaikiran pai

    Setting Attribute Values with @Service

    Brad Collins Newbie

      We are converting from JBoss 4.2 to JBoss AS 5.1. I'm converting our SARs from using deployment descriptors to using annotations, and I cannot figure out how to set attribute values using annotations.

       

      Our jboss-service.xml file for JBoss 4.2 looks something like this (names changed to protect the innocent):

       

      <server>
        <mbean code="messagebus.service.MessageBusService" name="jboss.jmx:service=MessageBus" interface="messagebus.service.MessageBusServiceMBean">
          <attribute name="ApplicationName">bus</attribute>
          <attribute name="JnpProviderUrl">ssl://localhost:61617</attribute>
          <attribute name="ConfigTopic">config</attribute>
        </mbean>
      </server>

       

      Using annotations for 5.1, the source code is as follows:

       

      @Management

      public interface MessageBusServiceMBean {

        ...

      }


      @Service(name="jboss.jmx:service=MessageBus")
      public class MessageBusService implements MessageBusServiceMBean {
        ...
      }
      So then, how do I set my ApplicationName, JnpProviderUrl, and ConfigTopic attributes?