PageRenderTime 28ms CodeModel.GetById 15ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/v3.2/nimbits-tds/src/com/nimbits/PMF.java

http://nimbits-server.googlecode.com/
Java | 30 lines | 13 code | 5 blank | 12 comment | 2 complexity | a1ccb530bb9ec778386c79584f919552 MD5 | raw file
 1/*
 2 * Copyright (c) 2010 Tonic Solutions LLC.
 3 *
 4 * http://www.nimbits.com
 5 *
 6 *
 7 * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
 8 *
 9 * http://www.gnu.org/licenses/gpl.html
10 *
11 * Unless required by applicable law or agreed to in writing, software distributed under the license is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
12 */
13
14package com.nimbits;
15
16import javax.jdo.JDOHelper;
17import javax.jdo.PersistenceManagerFactory;
18
19public final class PMF {
20    private static PersistenceManagerFactory pmfInstance;
21
22    private PMF() {}
23
24    public static PersistenceManagerFactory get() {
25        if (pmfInstance == null) {
26            pmfInstance = JDOHelper.getPersistenceManagerFactory("transactions-optional");
27        }
28        return pmfInstance;
29    }
30}