View Javadoc

1   package org.apache.ojb.odmg;
2   
3   /* Copyright 2002-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 org.apache.ojb.broker.util.factory.ConfigurableFactory;
19  import org.odmg.Implementation;
20  
21  
22  /**
23   * Facade to the persistence ObjectServer system.
24   * Implements the factory interface for a particular ODMG implementation.
25   *
26   * @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
27   * @version $Id: OJB.java,v 1.1 2007-08-24 22:17:37 ewestfal Exp $
28   */
29  public class OJB extends ConfigurableFactory
30  {
31      private static OJB instance;
32  
33      static
34      {
35          instance = new OJB();
36      }
37  
38      /**
39       * protected Constructor: use static factory method
40       * getInstance() to obtain an instance of {@link Implementation}
41       */
42      protected OJB()
43      {
44      }
45  
46      /**
47       * Return new instance of the {@link org.odmg.Implementation} class.
48       * The used implementation class can be specified in OJB properties file.
49       */
50      public static ImplementationExt getInstance()
51      {
52          return (ImplementationExt) instance.createNewInstance();
53      }
54  
55      protected String getConfigurationKey()
56      {
57          return "ImplementationClass";
58      }
59  }