KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > internal > sessions > ClientSessionIdentityMapAccessor


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2005, Oracle. All rights reserved.
22
package oracle.toplink.essentials.internal.sessions;
23
24 import oracle.toplink.essentials.internal.identitymaps.*;
25 import oracle.toplink.essentials.internal.sessions.IdentityMapAccessor;
26 import oracle.toplink.essentials.threetier.*;
27
28 /**
29  * INTERNAL:
30  * IdentityMapAccessor subclass for client sessions.
31  * Note: A client session will always use it's parent session's IdentityMapManager
32  */

33 public class ClientSessionIdentityMapAccessor extends IdentityMapAccessor {
34
35     /**
36      * INTERNAL:
37      * Create a ClientSessionIdentityMapAccessor
38      * Since the parent session's identity map manager is used, an IdentityMapManager
39      * does not need to be supplied to the constructor
40      */

41     public ClientSessionIdentityMapAccessor(ClientSession session) {
42         super(session, null);
43     }
44
45     /**
46      * INTERNAL:
47      * Was PUBLIC: customer will be redirected to {@link oracle.toplink.essentials.sessions.Session}.
48      * Reset the entire object cache.
49      * This method blows away both this session's and its parents caches, including the server cache or any other cache.
50      * This throws away any objects that have been read in.
51      * Extream caution should be used before doing this because object identity will no longer
52      * be maintained for any objects currently read in. This should only be called
53      * if the application knows that it no longer has references to object held in the cache.
54      */

55     public void initializeAllIdentityMaps() {
56         ((ClientSession)session).getParent().getIdentityMapAccessor().initializeAllIdentityMaps();
57     }
58
59     /**
60      * INTERNAL:
61      * Return the IdentityMapManager for the client session.
62      * This overrides the IdentityMapAccessor version of getIdentityMapManager to
63      * return the parent session's IdentityMapManager
64      */

65     public IdentityMapManager getIdentityMapManager() {
66         return ((ClientSession)session).getParent().getIdentityMapAccessorInstance().getIdentityMapManager();
67     }
68
69     /**
70      * INTERNAL:
71      * The client session does not have a local indentity map, so this has no effect and should not be used.
72      */

73     public void initializeIdentityMap(Class JavaDoc theClass) {
74         ;// Do nothing
75
}
76
77     /**
78      * INTERNAL:
79      * The client session does not have a local indentity map, so this has no effect and should not be used.
80      */

81     public void initializeIdentityMaps() {
82         ;// Do nothing
83
}
84
85     /**
86      * INTERNAL:
87      * The identity map manager cannot be set on a client session since it
88      * looks at it's parent session's identity map manager.
89      */

90     public void setIdentityMapManager(IdentityMapManager identityMapManager) {
91     }
92 }
93
Popular Tags