001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.counter.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     */
023    public class CounterFinderUtil {
024            public static java.util.List<java.lang.String> getNames()
025                    throws com.liferay.portal.kernel.exception.SystemException {
026                    return getFinder().getNames();
027            }
028    
029            public static long increment()
030                    throws com.liferay.portal.kernel.exception.SystemException {
031                    return getFinder().increment();
032            }
033    
034            public static long increment(java.lang.String name)
035                    throws com.liferay.portal.kernel.exception.SystemException {
036                    return getFinder().increment(name);
037            }
038    
039            public static long increment(java.lang.String name, int size)
040                    throws com.liferay.portal.kernel.exception.SystemException {
041                    return getFinder().increment(name, size);
042            }
043    
044            public static void rename(java.lang.String oldName, java.lang.String newName)
045                    throws com.liferay.portal.kernel.exception.SystemException {
046                    getFinder().rename(oldName, newName);
047            }
048    
049            public static void reset(java.lang.String name)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    getFinder().reset(name);
052            }
053    
054            public static void reset(java.lang.String name, long size)
055                    throws com.liferay.portal.kernel.exception.SystemException {
056                    getFinder().reset(name, size);
057            }
058    
059            public static CounterFinder getFinder() {
060                    if (_finder == null) {
061                            _finder = (CounterFinder)PortalBeanLocatorUtil.locate(CounterFinder.class.getName());
062    
063                            ReferenceRegistry.registerReference(CounterFinderUtil.class,
064                                    "_finder");
065                    }
066    
067                    return _finder;
068            }
069    
070            public void setFinder(CounterFinder finder) {
071                    _finder = finder;
072    
073                    ReferenceRegistry.registerReference(CounterFinderUtil.class, "_finder");
074            }
075    
076            private static CounterFinder _finder;
077    }