Community

Setting Attribute Values with @Service

created by Brad Collins in EJB 3.0 - View the full discussion

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?

Reply to this message by going to Community

Start a new discussion in EJB 3.0 at Community