KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb > txtimer > PersistencePolicy


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.ejb.txtimer;
23
24 // $Id: PersistencePolicy.java 38205 2005-11-17 22:16:37Z dimitris $
25

26 import java.io.Serializable JavaDoc;
27 import java.util.Date JavaDoc;
28 import java.util.List JavaDoc;
29
30 import javax.management.ObjectName JavaDoc;
31
32 /**
33  * Timers are persistent objects. In the event of a container crash, any single-event timers that have expired
34  * during the intervening time before container restart must cause the ejbTimeout method to be invoked
35  * upon restart. Any interval timers that have expired during the intervening time must cause the ejb-
36  * Timeout method to be invoked at least once upon restart.
37  *
38  * @author Thomas.Diesler@jboss.org
39  * @author Dimitris.Andreadis@jboss.org
40  * @version $Revision: 38205 $
41  * @since 09-Sep-2004
42  */

43 public interface PersistencePolicy
44 {
45    /**
46     * Inserts a timer into persistent storage.
47     *
48     * @param timerId The timer id
49     * @param targetId The timed object id
50     * @param firstEvent The point in time at which the first txtimer expiration must occur.
51     * @param periode The number of milliseconds that must elapse between txtimer expiration notifications.
52     * @param info A serializable handback object.
53     */

54    void insertTimer(String JavaDoc timerId, TimedObjectId targetId, Date JavaDoc firstEvent, long periode, Serializable JavaDoc info);
55
56    /**
57     * Deletes a timer from persistent storage.
58     *
59     * @param timerId The timer id
60     * @param timedObjectId The id of the timed object
61     */

62    void deleteTimer(String JavaDoc timerId, TimedObjectId timedObjectId);
63
64    /**
65     * List the persisted timer handles for a particular container
66     *
67     * @param containerId The Container ObjectName
68     * @param loader The ClassLoader to use for loading the handles
69     * @return a list of TimerHandleImpl objects
70     */

71    List JavaDoc listTimerHandles(ObjectName JavaDoc containerId, ClassLoader JavaDoc loader);
72    
73    /**
74     * List all the persisted timer handles
75     *
76     * @return a list of TimerHandleImpl objects
77     */

78    List JavaDoc listTimerHandles();
79    
80    /**
81     * Clear the persisted timers
82     */

83    void clearTimers();
84    
85 }
86
Popular Tags