KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > test > timer > interfaces > TimerSLSB


1 /*
2   * JBoss, Home of Professional Open Source
3   * Copyright 2005, JBoss Inc., and individual contributors as indicated
4   * by the @authors tag. See the copyright.txt in the distribution for a
5   * full listing of individual contributors.
6   *
7   * This is free software; you can redistribute it and/or modify it
8   * under the terms of the GNU Lesser General Public License as
9   * published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   *
12   * This software is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15   * Lesser General Public License for more details.
16   *
17   * You should have received a copy of the GNU Lesser General Public
18   * License along with this software; if not, write to the Free
19   * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20   * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21   */

22 package org.jboss.test.timer.interfaces;
23
24 import java.io.Serializable JavaDoc;
25
26 /**
27  * Remote interface for test/timer/TimerSLSB.
28  * @author Thomas Diesler
29  * @author Scott.Stark@jboss.org
30  * @version $Revision: 39635 $
31  */

32 public interface TimerSLSB
33    extends javax.ejb.EJBObject JavaDoc
34 {
35    /**
36     * Used in the unit tests. This is a key in a Map that can be used as the timer's
37     * info (timer.getInfo()). If this key maps to an Integer value in the Map,it will cause the
38     * ejbTimeout method to rollback the transaction that many times.
39     */

40    String JavaDoc INFO_EXEC_FAIL_COUNT = "ExecFailCount";
41
42
43    /**
44     * Used in the unit tests. This is a key in a Map that can be used as the timer's
45     * info (timer.getInfo()). If this key maps to an Integer value in the Map,it will cause the
46     * ejbTimeout method to sleep for number of milliseconds specified in the Integer.
47     * This is used to simulate a long running task, and helps to test JBAS-1926.
48     */

49    String JavaDoc INFO_TASK_RUNTIME = "TaskRuntime";
50
51    /**
52     * Start a single timer (if not already set) with the start date plus the period
53     * This method uses an implementation defined default value for the timer info.
54     * @param pPeriod Time that will elapse between now and the timed event in milliseconds
55     */

56    public byte[] startSingleTimer( long pPeriod )
57       throws java.rmi.RemoteException JavaDoc;
58
59    /**
60    * Start a single timer (if not already set) with the start date plus the period and specified info.
61    *
62    * @param pPeriod Time that will elapse between now and the timed event in milliseconds
63    * @param info an object to be used as the info for the timer.
64    **/

65    public byte[] startSingleTimer(long pPeriod, Serializable JavaDoc info)
66       throws java.rmi.RemoteException JavaDoc;
67
68    /**
69     * Start a timer (if not already set) with the start date plus the period and an interval of the given period.
70     * This method uses an implementation defined default value for the timer info.
71     * @param pPeriod Time that will elapse between two events in milliseconds
72     */

73    public byte[] startTimer( long pPeriod )
74       throws java.rmi.RemoteException JavaDoc;
75
76    /**
77     * Start a timer (if not already set) with the start date plus the period and an interval of the given
78     * period and the specified timer info
79     * @param pPeriod Time that will elapse between two events in milliseconds
80     * @param info an object to be used as the info for the timer.
81     */

82    public byte[] startTimer( long pPeriod, Serializable JavaDoc info )
83       throws java.rmi.RemoteException JavaDoc;
84
85    public void stopTimer(byte[] handle)
86       throws java.rmi.RemoteException JavaDoc;
87
88    public int getTimeoutCount(byte[] handle)
89       throws java.rmi.RemoteException JavaDoc;
90
91    public java.util.Date JavaDoc getNextTimeout(byte[] handle)
92       throws java.rmi.RemoteException JavaDoc;
93
94    public long getTimeRemaining(byte[] handle)
95       throws java.rmi.RemoteException JavaDoc;
96
97    public Object JavaDoc getInfo(byte[] handle)
98       throws java.rmi.RemoteException JavaDoc;
99
100    /**
101     * Returns the value from the RetryPolicyMBean. This is used by unit tests to help determine timing
102     * for some of the tests, specifically, those that test the fix for JBAS-1926.
103     */

104    public long getRetryTimeoutPeriod()
105       throws java.rmi.RemoteException JavaDoc;
106
107 }
108
Popular Tags