[jboss-cvs] contrib/varia/src/main/org/jboss/monitor/services ...

Dimitris Andreadis dimitris.andreadis at jboss.com
Thu Jul 13 10:55:00 EDT 2006


  User: dimitris
  Date: 06/07/13 10:55:00

  Modified:    varia/src/main/org/jboss/monitor/services  
                        TimerService.java TimerServiceMBean.java
  Log:
  JBAS-3391, add FixedRate setting
  
  Revision  Changes    Path
  1.3       +43 -25    contrib/varia/src/main/org/jboss/monitor/services/TimerService.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TimerService.java
  ===================================================================
  RCS file: /cvsroot/jboss/contrib/varia/src/main/org/jboss/monitor/services/TimerService.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- TimerService.java	30 Oct 2005 00:07:23 -0000	1.2
  +++ TimerService.java	13 Jul 2006 14:55:00 -0000	1.3
  @@ -1,24 +1,24 @@
   /*
  -* JBoss, Home of Professional Open Source
  -* Copyright 2005, JBoss Inc., and individual contributors as indicated
  -* by the @authors tag. See the copyright.txt in the distribution for a
  -* full listing of individual contributors.
  -*
  -* This is free software; you can redistribute it and/or modify it
  -* under the terms of the GNU Lesser General Public License as
  -* published by the Free Software Foundation; either version 2.1 of
  -* the License, or (at your option) any later version.
  -*
  -* This software is distributed in the hope that it will be useful,
  -* but WITHOUT ANY WARRANTY; without even the implied warranty of
  -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  -* Lesser General Public License for more details.
  -*
  -* You should have received a copy of the GNU Lesser General Public
  -* License along with this software; if not, write to the Free
  -* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  -* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -*/
  + * JBoss, Home of Professional Open Source
  + * Copyright 2005, JBoss Inc., and individual contributors as indicated
  + * by the @authors tag. See the copyright.txt in the distribution for a
  + * full listing of individual contributors.
  + *
  + * This is free software; you can redistribute it and/or modify it
  + * under the terms of the GNU Lesser General Public License as
  + * published by the Free Software Foundation; either version 2.1 of
  + * the License, or (at your option) any later version.
  + *
  + * This software is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  + * Lesser General Public License for more details.
  + *
  + * You should have received a copy of the GNU Lesser General Public
  + * License along with this software; if not, write to the Free
  + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  + */
   package org.jboss.monitor.services;
   
   import java.util.Date;
  @@ -35,11 +35,8 @@
    * A simple service used to configure the periodic emition of notifications
    * by a standard JMX Timer.
    *  
  - * @jmx:mbean
  - *    extends="org.jboss.system.ServiceMBean"
  - * 
    * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public class TimerService extends ServiceMBeanSupport
      implements TimerServiceMBean
  @@ -58,6 +55,9 @@
      /** Number of occurences */
      private long repeatitions;
      
  +   /** Periodic execution mode */
  +   private boolean fixedRate;
  +   
      /** TimerMBean name */
      private ObjectName timerObjectName;
      
  @@ -150,6 +150,22 @@
      /**
       * @jmx:managed-attribute
       */ 
  +   public void setFixedRate(boolean fixedRate)
  +   {
  +      this.fixedRate = fixedRate;
  +   }
  +   
  +   /**
  +    * @jmx:managed-attribute
  +    */     
  +   public boolean getFixedRate()
  +   {
  +      return fixedRate;
  +   }
  +   
  +   /**
  +    * @jmx:managed-attribute
  +    */ 
      public void setTimerMBean(ObjectName timerMBean)
      {
         this.timerProxy = (TimerMBean)MBeanServerInvocationHandler
  @@ -180,13 +196,15 @@
                  null, // UserData
                  new Date(), // now
                  timerPeriod,
  -               repeatitions);
  +               repeatitions,
  +               fixedRate);
            
            log.debug("Added timer notification(" + id
                  + ") : type=" + notificationType
                  + ", message=" + notificationMessage
                  + ", period=" + timerPeriodString
                  + ", repeatitions=" + repeatitions
  +               + ", fixedRate=" + fixedRate
                  + ", to timer '" + timerObjectName + "'");
         }
         else
  
  
  
  1.3       +27 -21    contrib/varia/src/main/org/jboss/monitor/services/TimerServiceMBean.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TimerServiceMBean.java
  ===================================================================
  RCS file: /cvsroot/jboss/contrib/varia/src/main/org/jboss/monitor/services/TimerServiceMBean.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- TimerServiceMBean.java	30 Oct 2005 00:07:23 -0000	1.2
  +++ TimerServiceMBean.java	13 Jul 2006 14:55:00 -0000	1.3
  @@ -1,24 +1,24 @@
   /*
  -* JBoss, Home of Professional Open Source
  -* Copyright 2005, JBoss Inc., and individual contributors as indicated
  -* by the @authors tag. See the copyright.txt in the distribution for a
  -* full listing of individual contributors.
  -*
  -* This is free software; you can redistribute it and/or modify it
  -* under the terms of the GNU Lesser General Public License as
  -* published by the Free Software Foundation; either version 2.1 of
  -* the License, or (at your option) any later version.
  -*
  -* This software is distributed in the hope that it will be useful,
  -* but WITHOUT ANY WARRANTY; without even the implied warranty of
  -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  -* Lesser General Public License for more details.
  -*
  -* You should have received a copy of the GNU Lesser General Public
  -* License along with this software; if not, write to the Free
  -* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  -* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  -*/
  + * JBoss, Home of Professional Open Source
  + * Copyright 2005, JBoss Inc., and individual contributors as indicated
  + * by the @authors tag. See the copyright.txt in the distribution for a
  + * full listing of individual contributors.
  + *
  + * This is free software; you can redistribute it and/or modify it
  + * under the terms of the GNU Lesser General Public License as
  + * published by the Free Software Foundation; either version 2.1 of
  + * the License, or (at your option) any later version.
  + *
  + * This software is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  + * Lesser General Public License for more details.
  + *
  + * You should have received a copy of the GNU Lesser General Public
  + * License along with this software; if not, write to the Free
  + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  + * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  + */
   package org.jboss.monitor.services;
   
   import javax.management.ObjectName;
  @@ -32,7 +32,7 @@
    * @see javax.management.timer.Timer
    * 
    * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
  - * @version $Revision: 1.2 $
  + * @version $Revision: 1.3 $
    */
   public interface TimerServiceMBean extends ServiceMBean
   {
  @@ -64,6 +64,12 @@
      long getRepeatitions();
      
      /**
  +    * The execution mode, true==fixed-rate, false==fixed-delay (default)
  +    */
  +   void setFixedRate(boolean fixedRate);
  +   boolean getFixedRate();
  +   
  +   /**
       * The utilized TimerMBean
       */
      void setTimerMBean(ObjectName timerMBean);
  
  
  



More information about the jboss-cvs-commits mailing list