[jboss-cvs] contrib/varia/src/main/org/jboss/monitor/services ...
Dimitris Andreadis
dimitris.andreadis at jboss.com
Thu Jul 13 10:54:20 EDT 2006
User: dimitris
Date: 06/07/13 10:54:19
Modified: varia/src/main/org/jboss/monitor/services Tag: Branch_4_0
TimerService.java TimerServiceMBean.java
Log:
JBAS-3391, add FixedRate setting
Revision Changes Path
No revision
No revision
1.1.2.4 +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.1.2.3
retrieving revision 1.1.2.4
diff -u -b -r1.1.2.3 -r1.1.2.4
--- TimerService.java 29 Oct 2005 05:06:42 -0000 1.1.2.3
+++ TimerService.java 13 Jul 2006 14:54:19 -0000 1.1.2.4
@@ -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.1.2.3 $
+ * @version $Revision: 1.1.2.4 $
*/
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.1.2.4 +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.1.2.3
retrieving revision 1.1.2.4
diff -u -b -r1.1.2.3 -r1.1.2.4
--- TimerServiceMBean.java 29 Oct 2005 05:06:42 -0000 1.1.2.3
+++ TimerServiceMBean.java 13 Jul 2006 14:54:19 -0000 1.1.2.4
@@ -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.1.2.3 $
+ * @version $Revision: 1.1.2.4 $
*/
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