1   package org.jadetower.dao;
2   
3   /*
4   Copyright (c) 2003, J Aaron Farr
5   All rights reserved.
6   
7   This software is published under the terms of the JadeTower Software License,
8   a BSD derived license, a copy of which has been included with this
9   distribution in the LICENSE file.  <http://www.jadetower.org>
10  */
11  
12  
13  import java.util.Map;
14  import org.apache.commons.logging.Log;
15  
16  /***
17   * a singleton wrapper for a DaoContainer.  Note: you must initialize the container
18   * before calling getDaoManager()
19   */
20  public class SingletonDaoContainer {
21  
22    protected static DaoContainer m_container = null;
23  
24    protected SingletonDaoContainer() {}
25  
26    public static void initialize(final String[] configUrls, Map context, Log log) throws Exception {
27      if(m_container == null){
28        m_container = new DaoContainer(configUrls,context,log);
29      }
30    }
31  
32    public static DaoManager getDaoManager() throws Exception {
33      return m_container.getManager();
34    }
35  
36    public static DaoManager getDaoManager(String context) throws Exception {
37      return m_container.getManager(context);
38    }
39  
40  }
This page was automatically generated by Maven