001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.counter.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    
019    /**
020     * @author Brian Wing Shun Chan
021     */
022    public class CounterFinderUtil {
023            public static java.util.List<java.lang.String> getNames()
024                    throws com.liferay.portal.kernel.exception.SystemException {
025                    return getFinder().getNames();
026            }
027    
028            public static long increment()
029                    throws com.liferay.portal.kernel.exception.SystemException {
030                    return getFinder().increment();
031            }
032    
033            public static long increment(java.lang.String name)
034                    throws com.liferay.portal.kernel.exception.SystemException {
035                    return getFinder().increment(name);
036            }
037    
038            public static long increment(java.lang.String name, int size)
039                    throws com.liferay.portal.kernel.exception.SystemException {
040                    return getFinder().increment(name, size);
041            }
042    
043            public static void rename(java.lang.String oldName, java.lang.String newName)
044                    throws com.liferay.portal.kernel.exception.SystemException {
045                    getFinder().rename(oldName, newName);
046            }
047    
048            public static void reset(java.lang.String name)
049                    throws com.liferay.portal.kernel.exception.SystemException {
050                    getFinder().reset(name);
051            }
052    
053            public static void reset(java.lang.String name, long size)
054                    throws com.liferay.portal.kernel.exception.SystemException {
055                    getFinder().reset(name, size);
056            }
057    
058            public static CounterFinder getFinder() {
059                    if (_finder == null) {
060                            _finder = (CounterFinder)PortalBeanLocatorUtil.locate(CounterFinder.class.getName());
061                    }
062    
063                    return _finder;
064            }
065    
066            public void setFinder(CounterFinder finder) {
067                    _finder = finder;
068            }
069    
070            private static CounterFinder _finder;
071    }