01: /*
02: * JBoss, Home of Professional Open Source.
03: * Copyright 2006, Red Hat Middleware LLC, and individual contributors
04: * as indicated by the @author tags. See the copyright.txt file in the
05: * distribution for a full listing of individual contributors.
06: *
07: * This is free software; you can redistribute it and/or modify it
08: * under the terms of the GNU Lesser General Public License as
09: * 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 57209 2006-09-26 12:21:57Z dimitris@jboss.org $
25:
26: import javax.management.MBeanServer;
27: import javax.management.ObjectName;
28: import java.io.Serializable;
29: import java.sql.SQLException;
30: import java.util.Date;
31: import java.util.List;
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: 57209 $
39: * @since 23-Sep-2004
40: */
41: public interface DatabasePersistencePlugin {
42: /** Initialize the plugin */
43: void init(MBeanServer server, ObjectName dataSource)
44: throws SQLException;
45:
46: /** Create the timers table if it does not exist already */
47: void createTableIfNotExists() throws SQLException;
48:
49: /** Insert a timer object */
50: void insertTimer(String timerId, TimedObjectId timedObjectId,
51: Date initialExpiration, long intervalDuration,
52: Serializable info) throws SQLException;
53:
54: /** Select a list of currently persisted timer handles
55: * @return List<TimerHandleImpl>
56: */
57: List selectTimers(ObjectName containerId) throws SQLException;
58:
59: /** Delete a timer. */
60: void deleteTimer(String timerId, TimedObjectId timedObjectId)
61: throws SQLException;
62:
63: /** Clear all persisted timers */
64: void clearTimers() throws SQLException;
65:
66: /** Get the timer table name */
67: String getTableName();
68:
69: /** Get the timer ID column name */
70: String getColumnTimerID();
71:
72: /** Get the target ID column name */
73: String getColumnTargetID();
74:
75: /** Get the initial date column name */
76: String getColumnInitialDate();
77:
78: /** Get the timer interval column name */
79: String getColumnTimerInterval();
80:
81: /** Get the instance PK column name */
82: String getColumnInstancePK();
83:
84: /** Get the info column name */
85: String getColumnInfo();
86: }
|