KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > jdo > PersistenceManagerImpl


1 package org.apache.ojb.jdo;
2
3 /* Copyright 2003-2005 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 import java.util.Collection JavaDoc;
19 import java.util.Iterator JavaDoc;
20
21 import javax.jdo.Extent;
22 import javax.jdo.InstanceCallbacks;
23 import javax.jdo.JDOFatalUserException;
24 import javax.jdo.PersistenceManager;
25 import javax.jdo.PersistenceManagerFactory;
26 import javax.jdo.Query;
27 import javax.jdo.Transaction;
28
29 import org.apache.ojb.broker.Identity;
30 import org.apache.ojb.broker.PBKey;
31 import org.apache.ojb.broker.PersistenceBrokerFactory;
32 import org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl;
33 import org.apache.ojb.broker.core.proxy.ProxyHelper;
34 import org.apache.ojb.otm.EditingContext;
35 import org.apache.ojb.otm.OTMConnection;
36 import org.apache.ojb.otm.OTMKit;
37 import org.apache.ojb.otm.kit.SimpleKit;
38 import org.apache.ojb.otm.lock.LockType;
39 import org.apache.ojb.otm.lock.LockingException;
40 import org.apache.ojb.otm.states.State;
41
42 /**
43  * @author <a HREF="mailto:mattbaird@yahoo.com">Matthew Baird</a>
44  * @author <a HREF="mailto:brianm@apache.org">Brian McCallister</a>
45  */

46 public class PersistenceManagerImpl implements PersistenceManager
47 {
48     private OTMConnection m_conn;
49     private OTMKit m_kit;
50     private boolean m_multiThreaded = false;
51     private boolean m_ignoreCache = false;
52     private PersistenceManagerFactory m_factory;
53     private String JavaDoc m_userID;
54     private String JavaDoc m_password;
55     private String JavaDoc m_alias;
56     private Object JavaDoc m_usersObject;
57     private TransactionImpl m_tx;
58
59     public PersistenceManagerImpl(PersistenceManagerFactory factory, String JavaDoc alias, String JavaDoc userid, String JavaDoc password)
60     {
61         m_factory = factory;
62         m_userID = userid;
63         m_password = password;
64         m_alias = alias;
65         m_kit = SimpleKit.getInstance();
66         /**
67          * if the alias is null, use the default.
68          */

69         if (null == m_alias)
70         {
71             m_conn = m_kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey());
72         }
73         else
74         {
75             PBKey key = new PBKey(m_alias, m_userID, m_password);
76             m_conn = m_kit.acquireConnection(key);
77         }
78         m_tx = new TransactionImpl(this, m_kit, m_conn);
79     }
80
81     OTMConnection getConnection()
82     {
83         return this.m_conn;
84     }
85
86     OTMKit getKit()
87     {
88         return this.m_kit;
89     }
90
91     public boolean isClosed()
92     {
93         return m_conn.isClosed();
94     }
95
96     /**
97      * Close database resources and
98      * Rollback transaction if there is one in progress
99      */

100     public void close()
101     {
102         if (isClosed())
103         {
104             throw new JDOFatalUserException(generateIsClosedErrorMessage("close()"));
105         }
106         if (m_tx.isActive()) m_tx.rollback();
107         m_conn.close();
108     }
109
110     public Transaction currentTransaction()
111     {
112         return m_tx;
113     }
114
115     /**
116      * evict all persistent-clean instances from the editing context cache
117      *
118      * @param o
119      */

120     public void evict(Object JavaDoc o)
121     {
122         if (isClosed())
123         {
124             throw new JDOFatalUserException(generateIsClosedErrorMessage("evict(Object)"));
125         }
126         if (null != o)
127         {
128             try
129             {
130                 Identity oid = m_conn.getIdentity(o);
131                 State state = m_conn.getEditingContext().lookupState(oid);
132                 /**
133                  * if the object is PersistentClean or non transactional, evict it.
134                  */

135                 if (State.PERSISTENT_CLEAN == state)
136                 {
137                     /**
138                      * spec says call the jdoPreClear if it's InstanceCallbacks aware
139                      */

140                     if (o instanceof InstanceCallbacks)
141                     {
142                         ((InstanceCallbacks) o).jdoPreClear();
143                     }
144                     m_conn.invalidate(m_conn.getIdentity(o));
145                     /**
146                      * set all fields to their default values
147                      */

148
149                     /**
150                      * set state to hollow
151                      */

152                 }
153                 if (null == state)
154                 {
155                     /**
156                      * not in the editing context, evict it from the global cache
157                      */

158                     m_conn.serviceObjectCache().remove(m_conn.getIdentity(o));
159                 }
160             }
161             catch (LockingException e)
162             {
163                 /**
164                  * shouldn't happen, we're only dealing with persistentClean and non transactional (aka non-locked)
165                  * objects.
166                  */

167             }
168         }
169     }
170
171     public void evictAll(Object JavaDoc[] objects)
172     {
173         if (isClosed())
174         {
175             throw new JDOFatalUserException(generateIsClosedErrorMessage("evictAll(Object[])"));
176         }
177         if (null == objects)
178         {
179             throw new NullPointerException JavaDoc("evictAll(Object[]) was passed a null Array.");
180         }
181         int length = objects.length;
182         for (int i = 0; i < length; i++)
183         {
184             evict(objects[i]);
185         }
186     }
187
188     public void evictAll(Collection JavaDoc collection)
189     {
190         if (isClosed())
191         {
192             throw new JDOFatalUserException(generateIsClosedErrorMessage("evictAll(Collection)"));
193         }
194         if (null == collection)
195         {
196             throw new NullPointerException JavaDoc("evictAll(Collection) was passed a null Collection.");
197         }
198         Iterator JavaDoc it = collection.iterator();
199         while (it.hasNext())
200         {
201             evict(it.next());
202         }
203     }
204
205     public void evictAll()
206     {
207         if (isClosed())
208         {
209             throw new JDOFatalUserException(generateIsClosedErrorMessage("evictAll()"));
210         }
211         EditingContext ctx = m_conn.getEditingContext();
212         if (ctx != null)
213         {
214             for (Iterator JavaDoc i = ctx.getAllObjectsInContext().iterator(); i.hasNext();)
215             {
216                 evict(i.next());
217             }
218         }
219         /**
220          * clear the rest of the global cache
221          */

222         m_conn.serviceObjectCache().clear();
223     }
224
225     public void refresh(Object JavaDoc o)
226     {
227         if (isClosed())
228         {
229             throw new JDOFatalUserException(generateIsClosedErrorMessage("refresh(Object)"));
230         }
231         m_conn.refresh(o);
232         if (o instanceof InstanceCallbacks)
233         {
234             ((InstanceCallbacks) o).jdoPostLoad();
235         }
236     }
237
238     public void refreshAll(Object JavaDoc[] objects)
239     {
240         if (isClosed())
241         {
242             throw new JDOFatalUserException(generateIsClosedErrorMessage("refreshAll(Object[])"));
243         }
244         if (null == objects)
245         {
246             throw new NullPointerException JavaDoc("refreshAll(Object[]) was passed a null Array.");
247         }
248         int length = objects.length;
249         for (int i = 0; i < length; i++)
250         {
251             refresh(objects[i]);
252         }
253     }
254
255     public void refreshAll(Collection JavaDoc collection)
256     {
257         if (isClosed())
258         {
259             throw new JDOFatalUserException(generateIsClosedErrorMessage("refreshAll(Collection)"));
260         }
261         if (null == collection)
262         {
263             throw new NullPointerException JavaDoc("refreshAll(Collection) was passed a null Collection.");
264         }
265         Iterator JavaDoc it = collection.iterator();
266         while (it.hasNext())
267         {
268             refresh(it.next());
269         }
270     }
271
272     public void refreshAll()
273     {
274         if (isClosed())
275         {
276             throw new JDOFatalUserException(generateIsClosedErrorMessage("refreshAll()"));
277         }
278         if (currentTransaction().isActive())
279         {
280             Collection JavaDoc collection = m_conn.getEditingContext().getAllObjectsInContext();
281             Iterator JavaDoc it = collection.iterator();
282             while (it.hasNext())
283             {
284                 refresh(it.next());
285             }
286         }
287     }
288
289     public Query newQuery()
290     {
291         if (isClosed())
292         {
293             throw new JDOFatalUserException(generateIsClosedErrorMessage("newQuery()"));
294         }
295
296         return new QueryImpl(this);
297     }
298
299     public Query newQuery(Object JavaDoc o)
300     {
301         if (isClosed())
302         {
303             throw new JDOFatalUserException(generateIsClosedErrorMessage("newQuery(Object)"));
304         }
305         try
306         {
307             return ((QueryImpl) o).ojbClone();
308         }
309         catch (ClassCastException JavaDoc e)
310         {
311             throw new IllegalArgumentException JavaDoc("newQuery(Object) must be passed a Query instance");
312         }
313     }
314
315     public Query newQuery(String JavaDoc s, Object JavaDoc o)
316     {
317         if (isClosed())
318         {
319             throw new JDOFatalUserException(generateIsClosedErrorMessage("newQuery(String, Object)"));
320         }
321
322         throw new UnsupportedOperationException JavaDoc("Not yet implemented!");
323     }
324
325     public Query newQuery(Class JavaDoc aClass)
326     {
327         if (isClosed())
328         {
329             throw new JDOFatalUserException(generateIsClosedErrorMessage("newQuery(Class)"));
330         }
331         Query query = new QueryImpl(this);
332         query.setClass(aClass);
333         return query;
334     }
335
336     public Query newQuery(Extent extent)
337     {
338         if (isClosed())
339         {
340             throw new JDOFatalUserException(generateIsClosedErrorMessage("newQuery(Extent)"));
341         }
342
343         Query query = new QueryImpl(this);
344         query.setCandidates(extent);
345         return query;
346     }
347
348     public Query newQuery(Class JavaDoc aClass, Collection JavaDoc collection)
349     {
350         if (isClosed())
351         {
352             throw new JDOFatalUserException(generateIsClosedErrorMessage("newQuery(Class, Collection)"));
353         }
354         Query query = new QueryImpl(this);
355         query.setCandidates(collection);
356         query.setClass(aClass);
357         return query;
358     }
359
360     public Query newQuery(Class JavaDoc aClass, String JavaDoc s)
361     {
362         if (isClosed())
363         {
364             throw new JDOFatalUserException(generateIsClosedErrorMessage("newQuery(Class, String)"));
365         }
366         Query query = new QueryImpl(this);
367         query.setClass(aClass);
368         query.setFilter(s);
369         return query;
370     }
371
372     public Query newQuery(Class JavaDoc aClass, Collection JavaDoc collection, String JavaDoc s)
373     {
374         if (isClosed())
375         {
376             throw new JDOFatalUserException(generateIsClosedErrorMessage("newQuery(Class, Collection, String)"));
377         }
378         Query query = new QueryImpl(this);
379         query.setCandidates(collection);
380         query.setClass(aClass);
381         query.setFilter(s);
382         return query;
383     }
384
385     public Query newQuery(Extent extent, String JavaDoc s)
386     {
387         if (isClosed())
388         {
389             throw new JDOFatalUserException(generateIsClosedErrorMessage("newQuery(Extent, String)"));
390         }
391         Query query = new QueryImpl(this);
392         query.setCandidates(extent);
393         query.setFilter(s);
394         return query;
395     }
396
397     /**
398      * @param aClass top level class
399      * @param include_extent include subclasses, presently ignored
400      * @return
401      * @todo figure out how to implement, may have to query all and filter objects
402      */

403     public Extent getExtent(Class JavaDoc aClass, boolean include_extent)
404     {
405         if (!include_extent) throw new UnsupportedOperationException JavaDoc("Not yet implemented!");
406         if (isClosed())
407         {
408             throw new JDOFatalUserException(generateIsClosedErrorMessage("getExtent(Class, boolean)"));
409         }
410         return new ExtentImpl(aClass, m_conn, this, include_extent);
411     }
412
413     public Object JavaDoc getObjectById(Object JavaDoc o, boolean validate)
414     {
415         if (isClosed())
416         {
417             throw new JDOFatalUserException(generateIsClosedErrorMessage("getObjectById(Object, boolean)"));
418         }
419         Object JavaDoc retval = null;
420         try
421         {
422             retval = m_conn.getObjectByIdentity((Identity) o);
423         }
424         catch (LockingException e)
425         {
426             e.printStackTrace(); //To change body of catch statement use Options | File Templates.
427
}
428         catch (ClassCastException JavaDoc e)
429         {
430             throw new IllegalArgumentException JavaDoc("Object passed as id is not an id: " + o);
431         }
432         return retval;
433     }
434
435     /**
436      * @todo verify that Identity meets the requirements of the JDO spec
437      */

438     public Object JavaDoc getObjectId(Object JavaDoc o)
439     {
440         if (isClosed())
441         {
442             throw new JDOFatalUserException(generateIsClosedErrorMessage("getObjectId(Object)"));
443         }
444         return m_conn.getIdentity(o);
445     }
446
447     public Object JavaDoc getTransactionalObjectId(Object JavaDoc o)
448     {
449         if (isClosed())
450         {
451             throw new JDOFatalUserException(generateIsClosedErrorMessage("getTransactionalObjectId(Object)"));
452         }
453         return m_conn.getIdentity(o);
454     }
455
456     public Object JavaDoc newObjectIdInstance(Class JavaDoc aClass, String JavaDoc s)
457     {
458         if (isClosed())
459         {
460             throw new JDOFatalUserException(generateIsClosedErrorMessage("newObjectIdInstance(Class, String)"));
461         }
462         return null;
463     }
464
465     public void makePersistent(Object JavaDoc o)
466     {
467         if (isClosed())
468         {
469             throw new JDOFatalUserException(generateIsClosedErrorMessage("makePersistent(Object)"));
470         }
471         try
472         {
473             m_conn.makePersistent(o);
474         }
475         catch (LockingException e)
476         {
477             // throw runtime exception
478
}
479     }
480
481     public void makePersistentAll(Object JavaDoc[] objects)
482     {
483         if (isClosed())
484         {
485             throw new JDOFatalUserException(generateIsClosedErrorMessage("makePersistentAll(Object[])"));
486         }
487         if (null == objects)
488         {
489             throw new NullPointerException JavaDoc("makePersistentAll(Object[]) was passed a null Array.");
490         }
491         int length = objects.length;
492         for (int i = 0; i < length; i++)
493         {
494             makePersistent(objects[i]);
495         }
496     }
497
498     public void makePersistentAll(Collection JavaDoc collection)
499     {
500         if (isClosed())
501         {
502             throw new JDOFatalUserException(generateIsClosedErrorMessage("makePersistentAll(Collection)"));
503         }
504         if (null == collection)
505         {
506             throw new NullPointerException JavaDoc("makePersistentAll(Collection) was passed a null Collection.");
507         }
508         Iterator JavaDoc it = collection.iterator();
509         while (it.hasNext())
510         {
511             makePersistent(it.next());
512         }
513     }
514
515     public void deletePersistent(Object JavaDoc o)
516     {
517         if (isClosed())
518         {
519             throw new JDOFatalUserException(generateIsClosedErrorMessage("deletePersistent(Object)"));
520         }
521         try
522         {
523             m_conn.deletePersistent(o);
524         }
525         catch (LockingException e)
526         {
527             handleLockingException(e);
528         }
529     }
530
531     public void deletePersistentAll(Object JavaDoc[] objects)
532     {
533         if (isClosed())
534         {
535             throw new JDOFatalUserException(generateIsClosedErrorMessage("deletePersistentAll(Object[])"));
536         }
537         if (null == objects)
538         {
539             throw new NullPointerException JavaDoc("deletePersistentAll(Object[]) was passed a null Array.");
540         }
541         int length = objects.length;
542         for (int i = 0; i < length; i++)
543         {
544             deletePersistent(objects[i]);
545         }
546     }
547
548     public void deletePersistentAll(Collection JavaDoc collection)
549     {
550         if (isClosed())
551         {
552             throw new JDOFatalUserException(generateIsClosedErrorMessage("deletePersistentAll(Collection)"));
553         }
554         if (null == collection)
555         {
556             throw new NullPointerException JavaDoc("deletePersistentAll(Collection) was passed a null Collection.");
557         }
558         Iterator JavaDoc it = collection.iterator();
559         while (it.hasNext())
560         {
561             deletePersistent(it.next());
562         }
563     }
564
565     /**
566      * Right now this makes the object non-transactional.
567      *
568      * @todo figure out what this is supposed to really do
569      */

570     public void makeTransient(Object JavaDoc o)
571     {
572         if (isClosed())
573         {
574             throw new JDOFatalUserException(generateIsClosedErrorMessage("makeTransient(Object)"));
575         }
576         m_conn.getEditingContext().remove(m_conn.getIdentity(o));
577         m_conn.serviceObjectCache().remove(m_conn.getIdentity(o));
578     }
579
580     public void makeTransientAll(Object JavaDoc[] objects)
581     {
582         if (isClosed())
583         {
584             throw new JDOFatalUserException(generateIsClosedErrorMessage("makeTransientAll(Object[])"));
585         }
586         if (null == objects)
587         {
588             throw new NullPointerException JavaDoc("makeTransientAll(Object[]) was passed a null Array.");
589         }
590         for (int i = 0; i < objects.length; i++)
591         {
592             this.makeTransient(objects[i]);
593         }
594     }
595
596     public void makeTransientAll(Collection JavaDoc collection)
597     {
598         if (isClosed())
599         {
600             throw new JDOFatalUserException(generateIsClosedErrorMessage("makeTransientAll(Collection)"));
601         }
602         if (null == collection)
603         {
604             throw new NullPointerException JavaDoc("makeTransientAll(Collection) was passed a null Collection.");
605         }
606         for (Iterator JavaDoc iterator = collection.iterator(); iterator.hasNext();)
607         {
608             this.makeTransient(iterator.next());
609         }
610     }
611
612     public void makeTransactional(Object JavaDoc o)
613     {
614         if (isClosed())
615         {
616             throw new JDOFatalUserException(generateIsClosedErrorMessage("makeTransactional(Object)"));
617         }
618         try
619         {
620             m_conn.getEditingContext().insert(m_conn.getIdentity(o), o, LockType.READ_LOCK);
621         }
622         catch (LockingException e)
623         {
624             handleLockingException(e);
625         }
626     }
627
628     public void makeTransactionalAll(Object JavaDoc[] objects)
629     {
630         if (isClosed())
631         {
632             throw new JDOFatalUserException(generateIsClosedErrorMessage("makeTransactionalAll(Object[])"));
633         }
634         if (null == objects)
635         {
636             throw new NullPointerException JavaDoc("makeTransactionalAll(Object[]) was passed a null Array.");
637         }
638         for (int i = 0; i < objects.length; i++)
639         {
640             this.makeTransactional(objects[i]);
641         }
642     }
643
644     public void makeTransactionalAll(Collection JavaDoc collection)
645     {
646         if (isClosed())
647         {
648             throw new JDOFatalUserException(generateIsClosedErrorMessage("makeTransactionalAll(Collection)"));
649         }
650         if (null == collection)
651         {
652             throw new NullPointerException JavaDoc("makeTransactionalAll(Collection) was passed a null Collection.");
653         }
654         for (Iterator JavaDoc iterator = collection.iterator(); iterator.hasNext();)
655         {
656             this.makeTransactional(iterator.next());
657         }
658     }
659
660     /**
661      * @todo What is the difference between this and makeTransient?
662      */

663     public void makeNontransactional(Object JavaDoc o)
664     {
665         if (isClosed())
666         {
667             throw new JDOFatalUserException(generateIsClosedErrorMessage("makeNontransactional(Object)"));
668         }
669         this.makeTransient(o);
670     }
671
672     public void makeNontransactionalAll(Object JavaDoc[] objects)
673     {
674         if (isClosed())
675         {
676             throw new JDOFatalUserException(generateIsClosedErrorMessage("makeNontransactionalAll(Object[])"));
677         }
678         if (null == objects)
679         {
680             throw new NullPointerException JavaDoc("makeNontransactionalAll(Object[]) was passed a null Array.");
681         }
682         for (int i = 0; i < objects.length; i++)
683         {
684             this.makeNontransactional(objects[i]);
685         }
686     }
687
688     public void makeNontransactionalAll(Collection JavaDoc collection)
689     {
690         if (isClosed())
691         {
692             throw new JDOFatalUserException(generateIsClosedErrorMessage("makeNontransactionalAll(Collection)"));
693         }
694         if (null == collection)
695         {
696             throw new NullPointerException JavaDoc("makeNontransactionalAll(Collection) was passed a null Collection.");
697         }
698         for (Iterator JavaDoc iterator = collection.iterator(); iterator.hasNext();)
699         {
700             this.makeNontransactional(iterator.next());
701         }
702     }
703
704     /**
705      * Force materialization of real object
706      * @param o
707      */

708     public void retrieve(Object JavaDoc o)
709     {
710         if (isClosed())
711         {
712             throw new JDOFatalUserException(generateIsClosedErrorMessage("retrieve(Object)"));
713         }
714         ProxyHelper.getRealObject(o);
715     }
716
717     /**
718      * Force materialization of all items in collection
719      * @param collection
720      */

721     public void retrieveAll(Collection JavaDoc collection)
722     {
723         if (isClosed())
724         {
725             throw new JDOFatalUserException(generateIsClosedErrorMessage("retrieveAll(Collection)"));
726         }
727         if (null == collection)
728         {
729             throw new NullPointerException JavaDoc("retrieveAll(Collection) was passed a null Collection.");
730         }
731
732         /* @todo I consider this a hack as CPDI is configurable now! */
733         if (collection instanceof CollectionProxyDefaultImpl)
734         {
735             CollectionProxyDefaultImpl cp = (CollectionProxyDefaultImpl) collection;
736             cp.getData();
737         }
738     }
739
740     public void retrieveAll(Object JavaDoc[] objects)
741     {
742         if (isClosed())
743         {
744             throw new JDOFatalUserException(generateIsClosedErrorMessage("retrieveAll(Object[])"));
745         }
746         if (null == objects)
747         {
748             throw new NullPointerException JavaDoc("retrieveAll(Object[]) was passed a null Array.");
749         }
750         // We don't proxy arrays
751
}
752
753     public void setUserObject(Object JavaDoc o)
754     {
755         if (isClosed())
756         {
757             throw new JDOFatalUserException(generateIsClosedErrorMessage("setUserObject(Object)"));
758         }
759         m_usersObject = o;
760     }
761
762     public Object JavaDoc getUserObject()
763     {
764         if (isClosed())
765         {
766             throw new JDOFatalUserException(generateIsClosedErrorMessage("getUserObject()"));
767         }
768         return m_usersObject;
769     }
770
771     public PersistenceManagerFactory getPersistenceManagerFactory()
772     {
773         if (isClosed())
774         {
775             throw new JDOFatalUserException(generateIsClosedErrorMessage("getPersistenceManagerFactory()"));
776         }
777         return this.m_factory;
778     }
779
780     /**
781      * @todo This will need to change when we have a JDO compliant Identity implementation
782      */

783     public Class JavaDoc getObjectIdClass(Class JavaDoc aClass)
784     {
785         if (isClosed())
786         {
787             throw new JDOFatalUserException(generateIsClosedErrorMessage("getObjectIdClass(Class)"));
788         }
789         return Identity.class;
790     }
791
792     public void setMultithreaded(boolean b)
793     {
794         if (isClosed())
795         {
796             throw new JDOFatalUserException(generateIsClosedErrorMessage("setMultithreaded(boolean)"));
797         }
798         m_multiThreaded = b;
799     }
800
801     public boolean getMultithreaded()
802     {
803         if (isClosed())
804         {
805             throw new JDOFatalUserException(generateIsClosedErrorMessage("getMultithreaded()"));
806         }
807         return m_multiThreaded;
808     }
809
810     public void setIgnoreCache(boolean b)
811     {
812         if (isClosed())
813         {
814             throw new JDOFatalUserException(generateIsClosedErrorMessage("setIgnoreCache(boolean)"));
815         }
816         m_ignoreCache = b;
817     }
818
819     public boolean getIgnoreCache()
820     {
821         if (isClosed())
822         {
823             throw new JDOFatalUserException(generateIsClosedErrorMessage("getIgnoreCache()"));
824         }
825         return m_ignoreCache;
826     }
827
828     /**
829      * TODO i18n these messages
830      *
831      * @param methodSignature
832      * @return
833      */

834     private static final String JavaDoc generateIsClosedErrorMessage(String JavaDoc methodSignature)
835     {
836         return "PersistenceManager already closed, cannot call '" + methodSignature + "'. Obtain a new PersistenceBroker and retry.";
837     }
838
839     private void handleLockingException(LockingException e)
840     {
841         throw new UnsupportedOperationException JavaDoc("Not yet implemented!");
842     }
843
844     /**
845      * TODO i18n these messages
846      *
847      * @param methodSignature
848      * @param type
849      * @return
850      */

851     private static final String JavaDoc generateNullParameterErrorMessage(String JavaDoc methodSignature, String JavaDoc type)
852     {
853         return methodSignature + " was passed a null " + type + ".";
854     }
855
856     /**
857      * @todo what does this do?
858      * @see javax.jdo.PersistenceManager#retrieveAll(java.util.Collection, boolean)
859      */

860     public void retrieveAll(Collection JavaDoc arg0, boolean arg1)
861     {
862         // TODO Auto-generated method stub
863

864     }
865
866     /**
867      * @todo what does this do?
868      * @see javax.jdo.PersistenceManager#retrieveAll(java.lang.Object[], boolean)
869      */

870     public void retrieveAll(Object JavaDoc[] arg0, boolean arg1)
871     {
872         // TODO Auto-generated method stub
873
}
874 }
875
Popular Tags