01: /**
02: * Speedo: an implementation of JDO compliant personality on top of JORM generic
03: * I/O sub-system.
04: * Copyright (C) 2001-2004 France Telecom R&D
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: */package org.objectweb.speedo.pm.api;
27:
28: import java.util.Collection;
29:
30: /**
31: * This interfaces defines a POManagerItf switch. It binds a thread to a
32: * list of POManagerItf. In a same context two po managers cannot be managed
33: * by the same PersistentManagerFactory.
34: *
35: * @author S.Chassande-Barrioz
36: */
37: public interface POManagerSwitchItf {
38:
39: /**
40: * @param pmf is persistent manager factory which manages the returned
41: * po manager.
42: * @return the POManagerItf managed by the given persistence manager factory
43: * and bound to current the context, or the null value if there is no
44: * POManagerItf.
45: */
46: POManagerItf lookup(POManagerFactoryItf pmf);
47:
48: /**
49: * It assignes a POManagerItf to the current context.
50: * @param pm is the POManagerItf
51: */
52: void bind(POManagerItf pm);
53:
54: /**
55: * It clears the list of POManagerItf for the current context.
56: */
57: void clear();
58:
59: /**
60: * It clears a POManagerItf for the current context.
61: * @return true if the specified pm has been unbound from the context/thread
62: */
63: boolean unbind(POManagerItf pm);
64:
65: /**
66: * It clears the POManagerItf associated to a POManagerFactoryItf for the
67: * current context
68: * @return true if a pm associated to the specified PMF, has been unbound
69: * from the context/thread
70: */
71: boolean unbind(POManagerFactoryItf pmf);
72:
73: /**
74: * @return all POManagerItf instances bound with the current context
75: */
76: Collection entries();
77: }
|