KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > speedo > pm > api > ProxyManagerSwitch


1 /**
2  * Speedo: an implementation of JDO compliant personality on top of JORM generic
3  * I/O sub-system.
4  * Copyright (C) 2001-2004 France Telecom R&D
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  *
21  *
22  * Contact: speedo@objectweb.org
23  *
24  * Authors: S.Chassande-Barrioz.
25  *
26  */

27 package org.objectweb.speedo.pm.api;
28
29
30 import java.util.Collection JavaDoc;
31
32 /**
33  * This interfaces defines a ProxyManager switch. It binds a thread to a
34  * list of ProxyManager. In a same context two proxy managers cannot be managed
35  * by the same PersistentManagerFactory.
36  *
37  * @author S.Chassande-Barrioz
38  */

39 public interface ProxyManagerSwitch {
40
41     /**
42      * @param pmf is persistent manager factory which manages the returned
43      * proxy manager.
44      * @return the ProxyManager managed by the given persistence manager factory
45      * and bound to current the context, or the null value if there is no
46      * ProxyManager.
47      */

48     ProxyManager lookup(ProxyManagerFactory pmf);
49
50     /**
51      * It assignes a ProxyManager to the current context.
52      * @param pm is the ProxyManager
53      */

54     void bind(ProxyManager pm);
55
56     /**
57      * It clears the list of ProxyManager for the current context.
58      */

59     void clear();
60
61     /**
62      * It clears a ProxyManager for the current context.
63      * @return true if the specified pm has been unbound from the context/thread
64      */

65     boolean unbind(ProxyManager pm);
66
67     /**
68      * It clears the ProxyManager associated to a ProxyManagerFactory for the
69      * current context
70      * @return true if a pm associated to the specified PMF, has been unbound
71      * from the context/thread
72      */

73     boolean unbind(ProxyManagerFactory pmf);
74
75     /**
76      * @return all ProxyManager instances bound with the current context
77      */

78     Collection JavaDoc entries();
79 }
80
Popular Tags