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

org.hibernate.search.backend.spi.Backend Maven / Gradle / Ivy

There is a newer version: 5.11.12.Final
Show newest version
/*
 * Hibernate Search, full-text search for your domain model
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.search.backend.spi;

import java.util.Properties;

import org.hibernate.search.indexes.spi.IndexManager;
import org.hibernate.search.spi.WorkerBuildContext;

/**
 * Interface for different types of queue processors. Implementations need a no-arg constructor.
 *
 * @author Yoann Rodiere
 *
 * @hsearch.experimental This type is under active development. You should be prepared
 * for incompatible changes in future releases.
 */
public interface Backend {

	/**
	 * Used at startup, called once as first method.
	 *
	 * @param properties all configuration properties
	 * @param context context giving access to required meta data
	 */
	default void initialize(Properties properties, WorkerBuildContext context) {
		// Empty default
	}

	/**
	 * Used to shutdown and eventually release resources.
	 * No other method should be used after this one.
	 * 

* The {@link #createQueueProcessor(IndexManager, WorkerBuildContext) produced queue processors} are * guaranteed to be closed before this is called. */ default void close() { // Empty default } /** * @return {@code true} if this backend is able to enlist in ongoing transactions. */ default boolean isTransactional() { return false; } /** * Called exactly once for each index manager using this backend. * @param indexManager the {@link IndexManager} the {@link BackendQueueProcessor} will point to * @param context context giving access to required meta data * @return a {@link BackendQueueProcessor} that will send its works to the given index manager */ BackendQueueProcessor createQueueProcessor(IndexManager indexManager, WorkerBuildContext context); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy