1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.expando.util;
16  
17  import com.liferay.portal.security.auth.CompanyThreadLocal;
18  import com.liferay.portlet.expando.model.ExpandoBridge;
19  
20  /**
21   * <a href="ExpandoBridgeFactoryUtil.java.html"><b><i>View Source</i></b></a>
22   *
23   * @author Brian Wing Shun Chan
24   */
25  public class ExpandoBridgeFactoryUtil {
26  
27      public static ExpandoBridge getExpandoBridge(
28          long companyId, String className) {
29  
30          return getExpandoBridgeFactory().getExpandoBridge(companyId, className);
31      }
32  
33      public static ExpandoBridge getExpandoBridge(
34          long companyId, String className, long classPK) {
35  
36          return getExpandoBridgeFactory().getExpandoBridge(
37              companyId, className, classPK);
38      }
39  
40      /**
41       * @deprecated {@link #getExpandoBridge(long, String)}
42       */
43      public static ExpandoBridge getExpandoBridge(String className) {
44          long companyId = CompanyThreadLocal.getCompanyId();
45  
46          return getExpandoBridge(companyId, className);
47      }
48  
49      /**
50       * @deprecated {@link #getExpandoBridge(long, String, long)}
51       */
52      public static ExpandoBridge getExpandoBridge(
53          String className, long classPK) {
54  
55          long companyId = CompanyThreadLocal.getCompanyId();
56  
57          return getExpandoBridge(companyId, className, classPK);
58      }
59  
60      public static ExpandoBridgeFactory getExpandoBridgeFactory() {
61          return _expandoBridgeFactory;
62      }
63  
64      public void setExpandoBridgeFactory(
65          ExpandoBridgeFactory expandoBridgeFactory) {
66  
67          _expandoBridgeFactory = expandoBridgeFactory;
68      }
69  
70      private static ExpandoBridgeFactory _expandoBridgeFactory;
71  
72  }