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.service.impl;
16  
17  import com.liferay.portal.kernel.exception.SystemException;
18  import com.liferay.portal.kernel.log.Log;
19  import com.liferay.portal.kernel.log.LogFactoryUtil;
20  import com.liferay.portal.kernel.util.PropsKeys;
21  import com.liferay.portal.kernel.util.ReleaseInfo;
22  import com.liferay.portal.service.base.PortalServiceBaseImpl;
23  import com.liferay.portal.util.PrefsPropsUtil;
24  import com.liferay.portal.util.PropsValues;
25  
26  /**
27   * <a href="PortalServiceImpl.java.html"><b><i>View Source</i></b></a>
28   *
29   * @author Brian Wing Shun Chan
30   */
31  public class PortalServiceImpl extends PortalServiceBaseImpl {
32  
33      public String getAutoDeployDirectory() throws SystemException {
34          return PrefsPropsUtil.getString(
35              PropsKeys.AUTO_DEPLOY_DEPLOY_DIR,
36              PropsValues.AUTO_DEPLOY_DEPLOY_DIR);
37      }
38  
39      public int getBuildNumber() {
40          return ReleaseInfo.getBuildNumber();
41      }
42  
43      public void test() {
44          long userId = 0;
45  
46          try {
47              userId = getUserId();
48          }
49          catch (Exception e) {
50              e.printStackTrace();
51          }
52  
53          if (_log.isInfoEnabled()) {
54              _log.info("User id " + userId);
55          }
56      }
57  
58      public void testCounterRollback() throws SystemException {
59          int counterIncrement = PropsValues.COUNTER_INCREMENT;
60  
61          for (int i = 0; i < counterIncrement * 2; i++) {
62              counterLocalService.increment();
63          }
64  
65          throw new SystemException();
66      }
67  
68      private static Log _log = LogFactoryUtil.getLog(PortalServiceImpl.class);
69  
70  }