Source Code Cross Referenced for SynchronizedStateManagerProxy.java in  » Testing » PolePosition-0.20 » com » versant » core » jdo » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » PolePosition 0.20 » com.versant.core.jdo 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 1998 - 2005 Versant Corporation
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         * Versant Corporation - initial API and implementation
010:         */
011:        package com.versant.core.jdo;
012:
013:        import com.versant.core.common.OID;
014:
015:        import javax.jdo.spi.PersistenceCapable;
016:        import javax.jdo.spi.StateManager;
017:        import javax.jdo.PersistenceManager;
018:
019:        /**
020:         * Wraps a VersantStateManager adding synchronizing all methods on a lock
021:         * object. This is used for thread safe PMs.
022:         */
023:        public final class SynchronizedStateManagerProxy implements 
024:                VersantStateManager {
025:
026:            private final Object lock;
027:            private final PCStateMan sm;
028:
029:            public SynchronizedStateManagerProxy(Object lock, PCStateMan sm) {
030:                this .lock = lock;
031:                this .sm = sm;
032:            }
033:
034:            public OID getOID() {
035:                return sm.getOID();
036:            }
037:
038:            public PersistenceCapable getPersistenceCapable() {
039:                return sm.getPersistenceCapable();
040:            }
041:
042:            public void makeDirty(PersistenceCapable persistenceCapable,
043:                    int managedFieldNo) {
044:                synchronized (lock) {
045:                    sm.makeDirty(persistenceCapable, managedFieldNo);
046:                }
047:            }
048:
049:            public byte replacingFlags(PersistenceCapable pc) {
050:                synchronized (lock) {
051:                    return sm.replacingFlags(pc);
052:                }
053:            }
054:
055:            public StateManager replacingStateManager(PersistenceCapable pc,
056:                    StateManager smp) {
057:                synchronized (lock) {
058:                    return sm.replacingStateManager(pc, smp);
059:                }
060:            }
061:
062:            public boolean isDirty(PersistenceCapable pc) {
063:                synchronized (lock) {
064:                    return sm.isDirty(pc);
065:                }
066:            }
067:
068:            public boolean isTransactional(PersistenceCapable pc) {
069:                synchronized (lock) {
070:                    return sm.isTransactional(pc);
071:                }
072:            }
073:
074:            public boolean isPersistent(PersistenceCapable pc) {
075:                synchronized (lock) {
076:                    return sm.isPersistent(pc);
077:                }
078:            }
079:
080:            public boolean isNew(PersistenceCapable pc) {
081:                synchronized (lock) {
082:                    return sm.isNew(pc);
083:                }
084:            }
085:
086:            public boolean isDeleted(PersistenceCapable pc) {
087:                synchronized (lock) {
088:                    return sm.isDeleted(pc);
089:                }
090:            }
091:
092:            public PersistenceManager getPersistenceManager(
093:                    PersistenceCapable pc) {
094:                synchronized (lock) {
095:                    return sm.getPersistenceManager(pc);
096:                }
097:            }
098:
099:            public void makeDirty(PersistenceCapable pc, String fieldName) {
100:                synchronized (lock) {
101:                    sm.makeDirty(pc, fieldName);
102:                }
103:            }
104:
105:            public Object getObjectId(PersistenceCapable pc) {
106:                synchronized (lock) {
107:                    return sm.getObjectId(pc);
108:                }
109:            }
110:
111:            public Object getTransactionalObjectId(PersistenceCapable pc) {
112:                synchronized (lock) {
113:                    return sm.getTransactionalObjectId(pc);
114:                }
115:            }
116:
117:            public boolean isLoaded(PersistenceCapable pc, int field) {
118:                synchronized (lock) {
119:                    return sm.isLoaded(pc, field);
120:                }
121:            }
122:
123:            public void preSerialize(PersistenceCapable pc) {
124:                synchronized (lock) {
125:                    sm.preSerialize(pc);
126:                }
127:            }
128:
129:            public synchronized boolean getBooleanField(PersistenceCapable pc,
130:                    int field, boolean currentValue) {
131:                synchronized (lock) {
132:                    return sm.getBooleanField(pc, field, currentValue);
133:                }
134:            }
135:
136:            public char getCharField(PersistenceCapable pc, int field,
137:                    char currentValue) {
138:                synchronized (lock) {
139:                    return sm.getCharField(pc, field, currentValue);
140:                }
141:            }
142:
143:            public byte getByteField(PersistenceCapable pc, int field,
144:                    byte currentValue) {
145:                synchronized (lock) {
146:                    return sm.getByteField(pc, field, currentValue);
147:                }
148:            }
149:
150:            public short getShortField(PersistenceCapable pc, int field,
151:                    short currentValue) {
152:                synchronized (lock) {
153:                    return sm.getShortField(pc, field, currentValue);
154:                }
155:            }
156:
157:            public int getIntField(PersistenceCapable pc, int field,
158:                    int currentValue) {
159:                synchronized (lock) {
160:                    return sm.getIntField(pc, field, currentValue);
161:                }
162:            }
163:
164:            public long getLongField(PersistenceCapable pc, int field,
165:                    long currentValue) {
166:                synchronized (lock) {
167:                    return sm.getLongField(pc, field, currentValue);
168:                }
169:            }
170:
171:            public float getFloatField(PersistenceCapable pc, int field,
172:                    float currentValue) {
173:                synchronized (lock) {
174:                    return sm.getFloatField(pc, field, currentValue);
175:                }
176:            }
177:
178:            public double getDoubleField(PersistenceCapable pc, int field,
179:                    double currentValue) {
180:                synchronized (lock) {
181:                    return sm.getDoubleField(pc, field, currentValue);
182:                }
183:            }
184:
185:            public String getStringField(PersistenceCapable pc, int field,
186:                    String currentValue) {
187:                synchronized (lock) {
188:                    return sm.getStringField(pc, field, currentValue);
189:                }
190:            }
191:
192:            public Object getObjectField(PersistenceCapable pc, int field,
193:                    Object currentValue) {
194:                synchronized (lock) {
195:                    return sm.getObjectField(pc, field, currentValue);
196:                }
197:            }
198:
199:            public void setBooleanField(PersistenceCapable pc, int field,
200:                    boolean currentValue, boolean newValue) {
201:                synchronized (lock) {
202:                    sm.setBooleanField(pc, field, currentValue, newValue);
203:                }
204:            }
205:
206:            public void setCharField(PersistenceCapable pc, int field,
207:                    char currentValue, char newValue) {
208:                synchronized (lock) {
209:                    sm.setCharField(pc, field, currentValue, newValue);
210:                }
211:            }
212:
213:            public void setByteField(PersistenceCapable pc, int field,
214:                    byte currentValue, byte newValue) {
215:                synchronized (lock) {
216:                    sm.setByteField(pc, field, currentValue, newValue);
217:                }
218:            }
219:
220:            public void setShortField(PersistenceCapable pc, int field,
221:                    short currentValue, short newValue) {
222:                synchronized (lock) {
223:                    sm.setShortField(pc, field, currentValue, newValue);
224:                }
225:            }
226:
227:            public void setIntField(PersistenceCapable pc, int field,
228:                    int currentValue, int newValue) {
229:                synchronized (lock) {
230:                    sm.setIntField(pc, field, currentValue, newValue);
231:                }
232:            }
233:
234:            public void setLongField(PersistenceCapable pc, int field,
235:                    long currentValue, long newValue) {
236:                synchronized (lock) {
237:                    sm.setLongField(pc, field, currentValue, newValue);
238:                }
239:            }
240:
241:            public void setFloatField(PersistenceCapable pc, int field,
242:                    float currentValue, float newValue) {
243:                synchronized (lock) {
244:                    sm.setFloatField(pc, field, currentValue, newValue);
245:                }
246:            }
247:
248:            public void setDoubleField(PersistenceCapable pc, int field,
249:                    double currentValue, double newValue) {
250:                synchronized (lock) {
251:                    sm.setDoubleField(pc, field, currentValue, newValue);
252:                }
253:            }
254:
255:            public void setStringField(PersistenceCapable pc, int field,
256:                    String currentValue, String newValue) {
257:                synchronized (lock) {
258:                    sm.setStringField(pc, field, currentValue, newValue);
259:                }
260:            }
261:
262:            public void setObjectField(PersistenceCapable pc, int field,
263:                    Object currentValue, Object newValue) {
264:                synchronized (lock) {
265:                    sm.setObjectField(pc, field, currentValue, newValue);
266:                }
267:            }
268:
269:            public void providedBooleanField(PersistenceCapable pc, int field,
270:                    boolean currentValue) {
271:                synchronized (lock) {
272:                    sm.providedBooleanField(pc, field, currentValue);
273:                }
274:            }
275:
276:            public void providedCharField(PersistenceCapable pc, int field,
277:                    char currentValue) {
278:                synchronized (lock) {
279:                    sm.providedCharField(pc, field, currentValue);
280:                }
281:            }
282:
283:            public void providedByteField(PersistenceCapable pc, int field,
284:                    byte currentValue) {
285:                synchronized (lock) {
286:                    sm.providedByteField(pc, field, currentValue);
287:                }
288:            }
289:
290:            public void providedShortField(PersistenceCapable pc, int field,
291:                    short currentValue) {
292:                synchronized (lock) {
293:                    sm.providedShortField(pc, field, currentValue);
294:                }
295:            }
296:
297:            public void providedIntField(PersistenceCapable pc, int field,
298:                    int currentValue) {
299:                synchronized (lock) {
300:                    sm.providedIntField(pc, field, currentValue);
301:                }
302:            }
303:
304:            public void providedLongField(PersistenceCapable pc, int field,
305:                    long currentValue) {
306:                synchronized (lock) {
307:                    sm.providedLongField(pc, field, currentValue);
308:                }
309:            }
310:
311:            public void providedFloatField(PersistenceCapable pc, int field,
312:                    float currentValue) {
313:                synchronized (lock) {
314:                    sm.providedFloatField(pc, field, currentValue);
315:                }
316:            }
317:
318:            public void providedDoubleField(PersistenceCapable pc, int field,
319:                    double currentValue) {
320:                synchronized (lock) {
321:                    sm.providedDoubleField(pc, field, currentValue);
322:                }
323:            }
324:
325:            public void providedStringField(PersistenceCapable pc, int field,
326:                    String currentValue) {
327:                synchronized (lock) {
328:                    sm.providedStringField(pc, field, currentValue);
329:                }
330:            }
331:
332:            public void providedObjectField(PersistenceCapable pc, int field,
333:                    Object currentValue) {
334:                synchronized (lock) {
335:                    sm.providedObjectField(pc, field, currentValue);
336:                }
337:            }
338:
339:            public boolean replacingBooleanField(PersistenceCapable pc,
340:                    int field) {
341:                synchronized (lock) {
342:                    return sm.replacingBooleanField(pc, field);
343:                }
344:            }
345:
346:            public char replacingCharField(PersistenceCapable pc, int field) {
347:                synchronized (lock) {
348:                    return sm.replacingCharField(pc, field);
349:                }
350:            }
351:
352:            public byte replacingByteField(PersistenceCapable pc, int field) {
353:                synchronized (lock) {
354:                    return sm.replacingByteField(pc, field);
355:                }
356:            }
357:
358:            public short replacingShortField(PersistenceCapable pc, int field) {
359:                synchronized (lock) {
360:                    return sm.replacingShortField(pc, field);
361:                }
362:            }
363:
364:            public int replacingIntField(PersistenceCapable pc, int field) {
365:                synchronized (lock) {
366:                    return sm.replacingIntField(pc, field);
367:                }
368:            }
369:
370:            public long replacingLongField(PersistenceCapable pc, int field) {
371:                synchronized (lock) {
372:                    return sm.replacingLongField(pc, field);
373:                }
374:            }
375:
376:            public float replacingFloatField(PersistenceCapable pc, int field) {
377:                synchronized (lock) {
378:                    return sm.replacingFloatField(pc, field);
379:                }
380:            }
381:
382:            public double replacingDoubleField(PersistenceCapable pc, int field) {
383:                synchronized (lock) {
384:                    return sm.replacingDoubleField(pc, field);
385:                }
386:            }
387:
388:            public String replacingStringField(PersistenceCapable pc, int field) {
389:                synchronized (lock) {
390:                    return sm.replacingStringField(pc, field);
391:                }
392:            }
393:
394:            public Object replacingObjectField(PersistenceCapable pc, int field) {
395:                synchronized (lock) {
396:                    return sm.replacingObjectField(pc, field);
397:                }
398:            }
399:
400:            public void fillNewAppPKField(int fieldNo) {
401:                synchronized (lock) {
402:                    sm.fillNewAppPKField(fieldNo);
403:                }
404:            }
405:
406:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.