001    /**
002     * Copyright (c) 2000-present 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                    return getFinder().getNames();
033            }
034    
035            public static java.lang.String getRegistryName() {
036                    return getFinder().getRegistryName();
037            }
038    
039            public static long increment() {
040                    return getFinder().increment();
041            }
042    
043            public static long increment(java.lang.String name) {
044                    return getFinder().increment(name);
045            }
046    
047            public static long increment(java.lang.String name, int size) {
048                    return getFinder().increment(name, size);
049            }
050    
051            public static void invalidate() {
052                    getFinder().invalidate();
053            }
054    
055            public static void rename(java.lang.String oldName, java.lang.String newName) {
056                    getFinder().rename(oldName, newName);
057            }
058    
059            public static void reset(java.lang.String name) {
060                    getFinder().reset(name);
061            }
062    
063            public static void reset(java.lang.String name, long size) {
064                    getFinder().reset(name, size);
065            }
066    
067            public static CounterFinder getFinder() {
068                    if (_finder == null) {
069                            _finder = (CounterFinder)PortalBeanLocatorUtil.locate(CounterFinder.class.getName());
070    
071                            ReferenceRegistry.registerReference(CounterFinderUtil.class,
072                                    "_finder");
073                    }
074    
075                    return _finder;
076            }
077    
078            public void setFinder(CounterFinder finder) {
079                    _finder = finder;
080    
081                    ReferenceRegistry.registerReference(CounterFinderUtil.class, "_finder");
082            }
083    
084            private static CounterFinder _finder;
085    }