01: package org.apache.ojb.odmg;
02:
03: /* Copyright 2002-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * 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: * Facade to the persistence ObjectServer system.
23: * Implements the factory interface for a particular ODMG implementation.
24: *
25: * @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
26: * @version $Id: OJB.java,v 1.17.2.2 2005/12/21 22:29:21 tomdz Exp $
27: */
28: public class OJB extends ConfigurableFactory {
29: private static OJB instance;
30:
31: static {
32: instance = new OJB();
33: }
34:
35: /**
36: * protected Constructor: use static factory method
37: * getInstance() to obtain an instance of {@link Implementation}
38: */
39: protected OJB() {
40: }
41:
42: /**
43: * Return new instance of the {@link org.odmg.Implementation} class.
44: * The used implementation class can be specified in OJB properties file.
45: */
46: public static ImplementationExt getInstance() {
47: return (ImplementationExt) instance.createNewInstance();
48: }
49:
50: protected String getConfigurationKey() {
51: return "ImplementationClass";
52: }
53: }
|