KickJava   Java API By Example, From Geeks To Geeks.

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


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: DatabasePersistencePlugin.java 38205 2005-11-17 22:16:37Z dimitris $
25

26 import javax.management.MBeanServer JavaDoc;
27 import javax.management.ObjectName JavaDoc;
28 import java.io.Serializable JavaDoc;
29 import java.sql.SQLException JavaDoc;
30 import java.util.Date JavaDoc;
31 import java.util.List JavaDoc;
32
33 /**
34  * An implementation of of this interface provides database specific JDBC access that is
35  * not portable accros RDBMS systems.
36  *
37  * @author Thomas.Diesler@jboss.org
38  * @version $Revision: 38205 $
39  * @since 23-Sep-2004
40  */

41 public interface DatabasePersistencePlugin
42 {
43    /** Initialize the plugin */
44    void init(MBeanServer JavaDoc server, ObjectName JavaDoc dataSource) throws SQLException JavaDoc;
45
46    /** Create the timers table if it does not exist already */
47    void createTableIfNotExists() throws SQLException JavaDoc;
48
49    /** Insert a timer object */
50    void insertTimer(String JavaDoc timerId, TimedObjectId timedObjectId, Date JavaDoc initialExpiration, long intervalDuration, Serializable JavaDoc info) throws SQLException JavaDoc;
51
52    /** Select a list of currently persisted timer handles
53     * @return List<TimerHandleImpl>
54     */

55    List JavaDoc selectTimers(ObjectName JavaDoc containerId) throws SQLException JavaDoc;
56
57    /** Delete a timer. */
58    void deleteTimer(String JavaDoc timerId, TimedObjectId timedObjectId) throws SQLException JavaDoc;
59
60    /** Clear all persisted timers */
61    void clearTimers() throws SQLException JavaDoc;
62
63    /** Get the timer table name */
64    String JavaDoc getTableName();
65
66    /** Get the timer ID column name */
67    String JavaDoc getColumnTimerID();
68
69    /** Get the target ID column name */
70    String JavaDoc getColumnTargetID();
71
72    /** Get the initial date column name */
73    String JavaDoc getColumnInitialDate();
74
75    /** Get the timer interval column name */
76    String JavaDoc getColumnTimerInterval();
77
78    /** Get the instance PK column name */
79    String JavaDoc getColumnInstancePK();
80
81    /** Get the info column name */
82    String JavaDoc getColumnInfo();
83 }
84
85
Popular Tags