KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > mq > pm > PersistenceManager


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.mq.pm;
23
24 import javax.jms.JMSException JavaDoc;
25
26 import org.jboss.mq.SpyDestination;
27 import org.jboss.mq.server.JMSDestination;
28 import org.jboss.mq.server.MessageCache;
29 import org.jboss.mq.server.MessageReference;
30
31 /**
32  * This class allows provides the base for user supplied persistence packages.
33  *
34  * @author Hiram Chirino (Cojonudo14@hotmail.com)
35  * @author Paul Kendall (paul.kendall@orion.co.nz)
36  * @author <a HREF="mailto:adrian@jboss.org">Adrian Brock</a>
37  * @version $Revision: 37459 $
38  */

39 public interface PersistenceManager
40 {
41    // Constants -----------------------------------------------------
42

43    // Public --------------------------------------------------------
44

45    /**
46     * Get the message cache
47     *
48     * @return the instance of the message cache
49     */

50    MessageCache getMessageCacheInstance();
51
52    /**
53      * Create and return a unique transaction id.
54      *
55      * @return the transaction
56     * @throws JMSException for any error
57      */

58    Tx createPersistentTx() throws javax.jms.JMSException JavaDoc;
59
60    /**
61      * Commit the transaction to the persistent store.
62      *
63      * @param txId Description of Parameter
64     * @throws JMSException for any error
65      */

66    void commitPersistentTx(Tx txId) throws javax.jms.JMSException JavaDoc;
67
68    /**
69      * Rollback the transaction.
70      *
71      * @param txId Description of Parameter
72     * @throws JMSException for any error
73      */

74    void rollbackPersistentTx(Tx txId) throws javax.jms.JMSException JavaDoc;
75
76
77    /**
78     * Get a transaction manager.
79     *
80     * @return the transaction manager
81     * @throws JMSException for any error
82     */

83    TxManager getTxManager();
84
85    /**
86      * Add a message to the persistent store. If the message is part of a
87      * transaction, txId is not null.
88      *
89      * @param message the message
90      * @param txId the transaction
91     * @throws JMSException for any error
92      */

93    void add(MessageReference message, Tx txId) throws JMSException JavaDoc;
94
95    /**
96      * Restore a queue.
97      *
98      * @param jmsDest the jms destination
99     * @param dest the client destination
100     * @throws JMSException for any error
101      */

102    void restoreQueue(JMSDestination jmsDest, SpyDestination dest) throws JMSException JavaDoc;
103
104    /**
105      * Update message in the persistent store. If the message is part of a
106      * transaction, txId is not null (not currently supported).
107      *
108      * @param message
109      * @param txId Description of Parameter
110     * @throws JMSException for any error
111      */

112    void update(MessageReference message, Tx txId) throws JMSException JavaDoc;
113
114    /**
115      * Remove message from the persistent store. If the message is part of a
116      * transaction, txId is not null.
117      *
118      * @param message the message
119      * @param txId the transaction
120     * @throws JMSException for any error
121      */

122    void remove(MessageReference message, Tx txId) throws JMSException JavaDoc;
123
124    /**
125     * Close a queue
126     *
127     * @param jmsDest the jms destination
128     * @param dest the client destination
129     * @throws JMSException for any error
130     */

131    void closeQueue(JMSDestination jmsDest, SpyDestination dest) throws JMSException JavaDoc;
132 }
Popular Tags