KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > perseus > persistence > api > StorageManager


1 /**
2  * Copyright (C) 2001-2002
3  * - France Telecom R&D
4  * - Laboratoire Logiciels, Systemes, Reseaux - UMR 5526, CNRS-INPG-UJF
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Release: 1.0
21  *
22  * Authors:
23  *
24  */

25
26 package org.objectweb.perseus.persistence.api;
27
28 /**
29  * It defines a manager permiting to manage a persitent object.
30  *
31  * @author Luciano Garcia-Banuelos (Luciano.Garcia@imag.fr)
32  */

33 public interface StorageManager {
34
35     /**
36      * Makes persitent an object.
37      * @param context permits to access to the data support.
38      * @param obj is the exported persistent object
39      * @return the identifier of the persistent object.
40      * @throws PersistenceException
41      */

42     Object JavaDoc export(ConnectionHolder context, Object JavaDoc obj) throws PersistenceException;
43
44     /**
45       * Makes persitent an object.
46       * @param context permits to access to the data support.
47       * @param obj is the exported persistent object
48       * @param hints helps to define the name of the persistent object.
49       * @return the identifier of the persistent object.
50       * @throws PersistenceException
51       */

52     Object JavaDoc export(ConnectionHolder context, Object JavaDoc obj, Object JavaDoc hints) throws PersistenceException;
53
54     /**
55      * Destroyes a persistent object
56      * @param context permits to access to the data support.
57      * @param oid is the object identifier of the removed persistent object.
58      * @throws PersistenceException
59      */

60     void unexport(ConnectionHolder context, Object JavaDoc oid) throws PersistenceException;
61
62     /**
63      * Destroyes a persistent object
64      * @param context permits to access to the data support.
65      * @param oid is the object identifier of the removed persistent object.
66      * @param hints helps to remove the persistent object.
67      * @throws PersistenceException
68      */

69     void unexport(ConnectionHolder context, Object JavaDoc oid, Object JavaDoc hints) throws PersistenceException;
70
71     /**
72      * Reads data of a persistent from the support object and puts them into
73      * an instance.
74      * @param context permits to access to the data support.
75      * @param oid is the identifier of the persistent object
76      * @param state is an instance of a persistent object which must be filled by
77      * the data read from the support
78      */

79     void read(ConnectionHolder context, Object JavaDoc oid, State state) throws PersistenceException;
80
81     /**
82      * Reads data of a persistent from the support object and puts them into
83      * an instance.
84      * @param context permits to access to the data support and to manage a
85      * prefetching context.
86      * @param oid is the identifier of the persistent object
87      * @param state is an instance of a persistent object which must be filled by
88      * the data read from the support
89      */

90     void read(WorkingSet context, Object JavaDoc oid, State state) throws PersistenceException;
91
92     /**
93      * Reads data of a persistent from the support object and puts them into
94      * an instance.
95      * @param context permits to access to the data support.
96      * @param oid is the identifier of the persistent object
97      * @param state the the persistent object instance which contains the data
98      * which must be written in the support
99      */

100     void write(ConnectionHolder context, Object JavaDoc oid, State state) throws PersistenceException;
101
102     /**
103      * Informes the Storage manager of the begining of a working set
104      * @param ws the working set which starts
105      */

106     void beginWS(WorkingSet ws);
107
108     /**
109      * Informes the Storage manager of the end of a working set
110      * @param ws the working set which finishes
111      */

112     void endWS(WorkingSet ws);
113 }
114
Popular Tags