All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.liferay.portal.kernel.search.IndexerRegistryUtil Maven / Gradle / Ivy

There is a newer version: 7.4.3.112-ga112
Show newest version
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.liferay.portal.kernel.search;

import com.liferay.portal.kernel.util.ServiceProxyFactory;

import java.util.Set;

/**
 * @author Raymond Augé
 */
public class IndexerRegistryUtil {

	public static  Indexer getIndexer(Class clazz) {
		return _indexerRegistry.getIndexer(clazz);
	}

	public static  Indexer getIndexer(String className) {
		return _indexerRegistry.getIndexer(className);
	}

	/**
	 * @deprecated As of Judson (7.1.x), with no direct replacement
	 */
	@Deprecated
	public static IndexerRegistry getIndexerRegistry() {
		return _indexerRegistry;
	}

	public static Set> getIndexers() {
		return _indexerRegistry.getIndexers();
	}

	public static  Indexer nullSafeGetIndexer(Class clazz) {
		return _indexerRegistry.nullSafeGetIndexer(clazz);
	}

	public static  Indexer nullSafeGetIndexer(String className) {
		return _indexerRegistry.nullSafeGetIndexer(className);
	}

	public static void register(Indexer indexer) {
		_indexerRegistry.register(indexer);
	}

	/**
	 * @deprecated As of Wilberforce (7.0.x), replaced by {@link
	 *             #register(Indexer)}
	 */
	@Deprecated
	public static void register(String className, Indexer indexer) {
		_indexerRegistry.register(indexer);
	}

	public static void unregister(Indexer indexer) {
		_indexerRegistry.unregister(indexer);
	}

	public static void unregister(String className) {
		_indexerRegistry.unregister(className);
	}

	private static volatile IndexerRegistry _indexerRegistry =
		ServiceProxyFactory.newServiceTrackedInstance(
			IndexerRegistry.class, IndexerRegistryUtil.class,
			"_indexerRegistry", false);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy