001    /**
002     * Copyright (c) 2000-2013 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    @ProviderType
026    public class CounterFinderUtil {
027            public static void afterPropertiesSet() {
028                    getFinder().afterPropertiesSet();
029            }
030    
031            public static java.util.List<java.lang.String> getNames()
032                    throws com.liferay.portal.kernel.exception.SystemException {
033                    return getFinder().getNames();
034            }
035    
036            public static java.lang.String getRegistryName() {
037                    return getFinder().getRegistryName();
038            }
039    
040            public static long increment()
041                    throws com.liferay.portal.kernel.exception.SystemException {
042                    return getFinder().increment();
043            }
044    
045            public static long increment(java.lang.String name)
046                    throws com.liferay.portal.kernel.exception.SystemException {
047                    return getFinder().increment(name);
048            }
049    
050            public static long increment(java.lang.String name, int size)
051                    throws com.liferay.portal.kernel.exception.SystemException {
052                    return getFinder().increment(name, size);
053            }
054    
055            public static void invalidate() {
056                    getFinder().invalidate();
057            }
058    
059            public static void rename(java.lang.String oldName, java.lang.String newName)
060                    throws com.liferay.portal.kernel.exception.SystemException {
061                    getFinder().rename(oldName, newName);
062            }
063    
064            public static void reset(java.lang.String name)
065                    throws com.liferay.portal.kernel.exception.SystemException {
066                    getFinder().reset(name);
067            }
068    
069            public static void reset(java.lang.String name, long size)
070                    throws com.liferay.portal.kernel.exception.SystemException {
071                    getFinder().reset(name, size);
072            }
073    
074            public static CounterFinder getFinder() {
075                    if (_finder == null) {
076                            _finder = (CounterFinder)PortalBeanLocatorUtil.locate(CounterFinder.class.getName());
077    
078                            ReferenceRegistry.registerReference(CounterFinderUtil.class,
079                                    "_finder");
080                    }
081    
082                    return _finder;
083            }
084    
085            public void setFinder(CounterFinder finder) {
086                    _finder = finder;
087    
088                    ReferenceRegistry.registerReference(CounterFinderUtil.class, "_finder");
089            }
090    
091            private static CounterFinder _finder;
092    }