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