1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jdo.impl.model.jdo.caching;
18
19 import org.apache.jdo.model.java.JavaModel;
20 import org.apache.jdo.model.jdo.JDOModel;
21 import org.apache.jdo.model.jdo.JDOModelFactory;
22
23 import org.apache.jdo.impl.model.jdo.JDOModelFactoryImplDynamic;
24
25 /***
26 * Factory for caching JDOModel instances.
27 *
28 * @author Michael Bouschen
29 * @since 1.1
30 * @version 1.1
31 */
32 public class JDOModelFactoryImplCaching extends JDOModelFactoryImplDynamic {
33
34 /*** The singleton JDOModelFactory instance. */
35 private static JDOModelFactory jdoModelFactory =
36 new JDOModelFactoryImplCaching();
37
38 /***
39 * Creates new JDOModelFactoryImplCaching. This constructor
40 * should not be called directly; instead, the singleton access
41 * method {@link #getInstance} should be used.
42 */
43 protected JDOModelFactoryImplCaching() {}
44
45 /***
46 * Get an instance of JDOModelFactoryImpl.
47 * @return an instance of JDOModelFactoryImpl
48 */
49 public static JDOModelFactory getInstance() {
50 return jdoModelFactory;
51 }
52
53 /***
54 * Creates a new empty JDOModel instance.
55 * The returned JDOModel instance uses the specified flag
56 * <code>loadXMLMetadataDefault</code> to set the default behavior
57 * for the creation of new JDOClass instances using methods
58 * {@link JDOModel#createJDOClass(String)} and
59 * {@link JDOModel#getJDOClass(String)} for which the caller doesn't
60 * explicitly specify whether to read XML metatdata or not.
61 * @param loadXMLMetadataDefault the default setting for whether to
62 * read XML metatdata in JDOModel's methods for JDOClass creation.
63 */
64 public JDOModel createJDOModel(JavaModel javaModel,
65 boolean loadXMLMetadataDefault) {
66 return new JDOModelImplCaching(javaModel, loadXMLMetadataDefault);
67 }
68
69 }