001    package org.apache.ojb.odmg;
002    
003    /* Copyright 2002-2005 The Apache Software Foundation
004     *
005     * Licensed under the Apache License, Version 2.0 (the "License");
006     * you may not use this file except in compliance with the License.
007     * You may obtain a copy of the License at
008     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    
018    import org.apache.ojb.broker.util.factory.ConfigurableFactory;
019    import org.odmg.Implementation;
020    
021    
022    /**
023     * Facade to the persistence ObjectServer system.
024     * Implements the factory interface for a particular ODMG implementation.
025     *
026     * @author <a href="mailto:armin@codeAuLait.de">Armin Waibel</a>
027     * @version $Id: OJB.java,v 1.1 2007-08-24 22:17:37 ewestfal Exp $
028     */
029    public class OJB extends ConfigurableFactory
030    {
031        private static OJB instance;
032    
033        static
034        {
035            instance = new OJB();
036        }
037    
038        /**
039         * protected Constructor: use static factory method
040         * getInstance() to obtain an instance of {@link Implementation}
041         */
042        protected OJB()
043        {
044        }
045    
046        /**
047         * Return new instance of the {@link org.odmg.Implementation} class.
048         * The used implementation class can be specified in OJB properties file.
049         */
050        public static ImplementationExt getInstance()
051        {
052            return (ImplementationExt) instance.createNewInstance();
053        }
054    
055        protected String getConfigurationKey()
056        {
057            return "ImplementationClass";
058        }
059    }