2 Replies Latest reply on Jun 19, 2009 5:31 AM by Marek Neumann

    Description / Parameter names etc in jmx-console

    Bob Damato Newbie

      I'm messing around with jboss-5.1.0 and I have created an annotated ejb3 bean as described here:
      http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/jboss_extensions.html
      It works as advertised (although I had to monkey with it to work with 5.1.0).
      Ideally I'd like to add some friendly operation descriptions to replace the default "Operation exposed for management" that shows up in the jmx-console.

      Is it possible to do this through annotations, or am I stuck having to create service xml files for these?

      package bob;
      
      public interface ServiceOneManagement {
      
       public void doATaskForMe(String input);
      
       public void setTheValue(int theValue);
      
       public int getTheValue();
      
       void create() throws Exception;
      
       void start() throws Exception;
      
       void stop();
      
       void destroy();
      
      }
      


      package bob;
      
      import org.jboss.ejb3.annotation.Management;
      import org.jboss.ejb3.annotation.Service;
      
      @Service(objectName = "bob.mbeans:serviceName=ServiceOne")
      @Management(ServiceOneManagement.class)
      public class ServiceOne implements ServiceOneManagement {
       private int theValue;
      
       public int getTheValue() {
       return theValue;
       }
      
       public void setTheValue(int theValue) {
       this.theValue = theValue;
       }
      
       public void doATaskForMe(String input) {
       System.out.println("Called do a task for me");
       }
      
       public void create() throws Exception {
       System.out.println("ServiceOne - Creating");
       }
      
       public void start() throws Exception {
       System.out.println("ServiceOne - Starting");
       }
      
       public void stop() {
       System.out.println("ServiceOne - Stopping");
       }
      
       public void destroy() {
       System.out.println("ServiceOne - Destroying");
       }
      }