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.portal.kernel.util;
16  
17  import javax.mail.Session;
18  
19  import javax.sql.DataSource;
20  
21  /**
22   * <a href="InfrastructureUtil.java.html"><b><i>View Source</i></b></a>
23   *
24   * @author Brian Wing Shun Chan
25   * @author Michael Young
26   */
27  public class InfrastructureUtil {
28  
29      public static DataSource getDataSource() {
30          return _dataSource;
31      }
32  
33      public static Object getDynamicDataSourceTargetSource() {
34          return _dynamicDataSourceTargetSource;
35      }
36  
37      public static Session getMailSession() {
38          return _mailSession;
39      }
40  
41      public static Object getShardDataSourceTargetSource() {
42          return _shardDataSourceTargetSource;
43      }
44  
45      public static Object getShardSessionFactoryTargetSource() {
46          return _shardSessionFactoryTargetSource;
47      }
48  
49      public static Object getTransactionManager() {
50          return _transactionManager;
51      }
52  
53      public void setDataSource(DataSource dataSource) {
54          _dataSource = dataSource;
55      }
56  
57      public void setDynamicDataSourceTargetSource(
58          Object dynamicDataSourceTargetSource) {
59  
60          _dynamicDataSourceTargetSource = dynamicDataSourceTargetSource;
61      }
62  
63      public void setMailSession(Session mailSession) {
64          _mailSession = mailSession;
65      }
66  
67      public void setShardDataSourceTargetSource(
68          Object shardDataSourceTargetSource) {
69  
70          _shardDataSourceTargetSource = shardDataSourceTargetSource;
71      }
72  
73      public void setShardSessionFactoryTargetSource(
74          Object shardSessionFactoryTargetSource) {
75  
76          _shardSessionFactoryTargetSource = shardSessionFactoryTargetSource;
77      }
78  
79      public void setTransactionManager(Object transactionManager) {
80          _transactionManager = transactionManager;
81      }
82  
83      private static DataSource _dataSource;
84      private static Object _dynamicDataSourceTargetSource;
85      private static Session _mailSession;
86      private static Object _shardDataSourceTargetSource;
87      private static Object _shardSessionFactoryTargetSource;
88      private static Object _transactionManager;
89  
90  }