KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > db4o > ext > ExtClient


1 /* Copyright (C) 2004 - 2006 db4objects Inc. http://www.db4o.com
2
3 This file is part of the db4o open source object database.
4
5 db4o is free software; you can redistribute it and/or modify it under
6 the terms of version 2 of the GNU General Public License as published
7 by the Free Software Foundation and as clarified by db4objects' GPL
8 interpretation policy, available at
9 http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10 Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11 Suite 350, San Mateo, CA 94403, USA.
12
13 db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 for more details.
17
18 You should have received a copy of the GNU General Public License along
19 with this program; if not, write to the Free Software Foundation, Inc.,
20 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */

21 package com.db4o.ext;
22
23 /**
24  * extended client functionality for the
25  * {@link ExtObjectContainer ExtObjectContainer} interface.
26  * <br><br>Both
27  * {@link com.db4o.Db4o#openClient Db4o.openClient()} methods always
28  * return an <code>ExtClient</code> object so a cast is possible.<br><br>
29  * The ObjectContainer functionality is split into multiple interfaces to allow newcomers to
30  * focus on the essential methods.
31  */

32 public interface ExtClient extends ExtObjectContainer{
33
34     /**
35      * requests opening a different server database file for this client session.
36      * <br><br>
37      * This method can be used to switch between database files from the client
38      * side while not having to open a new socket connection or closing the
39      * current one.
40      * <br><br>
41      * If the database file does not exist on the server, it will be created.
42      * <br><br>
43      * A typical usecase:<br>
44      * The main database file is used for login, user and rights management only.
45      * Only one single db4o server session needs to be run. Multiple satellite
46      * database files are used for different applications or multiple user circles.
47      * Storing the data to multiple database files has the following advantages:<br>
48      * - easier rights management<br>
49      * - easier backup<br>
50      * - possible later load balancing to multiple servers<br>
51      * - better performance of smaller individual database files<br>
52      * - special debugging database files can be used
53      * <br><br>
54      * User authorization to the alternative database file will not be checked.
55      * <br><br>
56      * All persistent references to objects that are currently in memory
57      * are discarded during the switching process.<br><br>
58      * @param fileName the fully qualified path of the requested database file.
59      */

60     public void switchToFile(String JavaDoc fileName);
61     
62     
63     /**
64      * requests switching back to the main database file after a previous call
65      * to <code>switchToFile(String fileName)</code>.
66      * <br><br>
67      * All persistent references to objects that are currently in memory
68      * are discarded during the switching process.<br><br>
69      */

70     public void switchToMainFile();
71     
72     /**
73      * checks if the client is currently connected to a server.
74      * @return true if the client is alive.
75      */

76     public boolean isAlive();
77 }
78
79
Popular Tags