my jboss-service.xml got chomped during the post process.

Here is another shot at it...

  | 
  | package services.jmx;
  | 
  | import java.io.*;
  | import java.lang.*;
  | import org.jboss.system.*;
  | 
  | import org.apache.commons.logging.Log;
  | import org.apache.commons.logging.LogFactory;
  | 
  | /**
  |  * JBoss Service XMBean
  |  * 
  |  * @jmx.mbean name=":service=MemoryMonitorService,type=Service"
  |  *            description="A JBoss Service for MemoryMonitor Metrics"
  |  *            extends="org.jboss.system.ServiceMBean"
  |  *            persistPolicy="OnTimer"
  |  *            persistPeriod="10"
  |  *            currencyTimeLimit="10"
  |  *            state-action-on-update="keep-running"
  |  *   
  |  * @jboss.service 
  |  *                    servicefile="memorymonitor"
  |  * @jboss.depends 
  |  *                    name="Naming"
  |  * @jboss.destination-jndi-name 
  |  *                    name="jmx/MemoryMonitorService"
  |  * @jmx.mbean
  |  *                    persistpolicy="OnTimer"
  |  */
  | public abstract class MemoryMonitorService extends 
org.jboss.system.ServiceMBeanSupport 
  |     implements MemoryMonitorServiceMBean
  | {
  |   /**
  |    * Default constructor
  |    * @jmx.managed-constructor description="Default constructor"
  |    */ 
  |   public MemoryMonitorService () {
  |   }
  |   
  |   /**
  |    * @jmx.managed-attribute
  |    *    access="read-write"
  |    *    currencyTimeLimit="30"
  |    *    description="long attribute"
  |    *    persistPeriod="30"
  |    *    persistPolicy="OnTimer"
  |    *    value="0"
  |    */
  |   public long getAvailableMemory () {
  |     return Runtime.getRuntime().freeMemory();
  |   }
  |   
  |   /**
  |    * @jmx.managed-attribute
  |    *    access="read-write"
  |    *    currencyTimeLimit="30"
  |    *    description="long attribute"
  |    *    persistPeriod="30"
  |    *    persistPolicy="OnTimer"
  |    *    value="0"
  |    */
  |   public void setAvailableMemory (long value) {
  |   }
  |   
  |   /**
  |    * @jmx.managed-attribute
  |    *    access="read-write"
  |    *    currencyTimeLimit="30"
  |    *    description="long attribute"
  |    *    persistPeriod="30"
  |    *    persistPolicy="OnTimer"
  |    *    value="0"
  |    */
  |   public long getTotalMemory () {
  |     return Runtime.getRuntime().totalMemory();
  |   }
  |   
  |   /**
  |    * @jmx.managed-attribute
  |    *    access="read-write"
  |    *    currencyTimeLimit="30"
  |    *    description="long attribute"
  |    *    persistPeriod="30"
  |    *    persistPolicy="OnTimer"
  |    *    value="0"
  |    */
  |   public void setTotalMemory (long value) {
  |   }
  |   
  |   /**
  |    * @jmx.managed-attribute
  |    *    access="read-write"
  |    *    currencyTimeLimit="30"
  |    *    description="long attribute"
  |    *    persistPeriod="30"
  |    *    persistPolicy="OnTimer"
  |    *    value="0"
  |    */
  |   public long getMaxMemory () {
  |     return Runtime.getRuntime().maxMemory();
  |   }
  |   
  |   /**
  |    * @jmx.managed-attribute
  |    *    access="read-write"
  |    *    currencyTimeLimit="30"
  |    *    description="long attribute"
  |    *    persistPeriod="30"
  |    *    persistPolicy="OnTimer"
  |    *    value="0"
  |    */
  |   public void setMaxMemory (long value) {
  |   } 
  |   
  |   /**
  |    * @see ServiceMBeanSupport#createService()
  |    */
  |   protected void createService() throws Exception
  |   {
  |       super.createService();
  |       //jmsServer = new JMSDestinationManager();
  |       // Create the JSR-77 management representation
  |   }
  |   
  |   /**
  |    * @see ServiceMBeanSupport#startService()
  |    */
  |   protected void startService() throws Exception
  |   {
  |       super.startService();
  |   }  
  |   
  |   /**
  |    * @see ServiceMBeanSupport#stopService()
  |    */
  |   protected void stopService() throws Exception
  |   {
  |       super.stopService();
  |   }
  |   
  |   /**
  |    * @see ServiceMBeanSupport#destroyService()
  |    */
  |   protected void destroyService() throws Exception
  |   {
  |       super.destroyService();
  |   }  
  | }
  | 
  | 
  | /*
  |  * Generated file - Do not edit!
  |  */
  | package services.jmx;
  | 
  | /**
  |  * MBean interface.
  |  * @xdoclet-generated at ${TODAY}
  |  * @copyright 
  |  * @author 
  |  * @version ${version}
  |  */
  | public interface MemoryMonitorServiceMBean extends 
org.jboss.system.ServiceMBean {
  | 
  |   long getAvailableMemory() ;
  | 
  |   void setAvailableMemory(long value) ;
  | 
  |   long getTotalMemory() ;
  | 
  |   void setTotalMemory(long value) ;
  | 
  |   long getMaxMemory() ;
  | 
  |   void setMaxMemory(long value) ;
  | 
  | }
  | 
  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <server>
  | 
  |   <mbean code="services.jmx.MemoryMonitorService"
  |          name=":service=MemoryMonitorService,type=Service"
  |          >
  |     <!--A JBoss Service for MemoryMonitor Metrics-->
  |     <!--Attribute AvailableMemory, type long, long attribute-->
  |     <attribute name="AvailableMemory">0</attribute>
  |     <!--Attribute TotalMemory, type long, long attribute-->
  |     <attribute name="TotalMemory">0</attribute>
  |     <!--Attribute MaxMemory, type long, long attribute-->
  |     <attribute name="MaxMemory">0</attribute>
  |     <depends>jboss:service=Naming</depends>
  |   </mbean>
  | 
  |   <!--
  |   To use non XDoclet mbeans, create a jboss-service.ent file that
  |   contains the additional mbeans and place it in your
  |   project's merge dir.
  |   -->
  | 
  | </server>
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3927591#3927591

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3927591


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to