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

org.hibernate.search.engine.environment.bean.BeanRetrieval Maven / Gradle / Ivy

There is a newer version: 8.0.0.Alpha1
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.engine.environment.bean;

/**
 * Defines where beans are retrieved from.
 */
public enum BeanRetrieval {

	/**
	 * Retrieve a built-in bean.
	 * 

* Retrieve the bean from a registry defined using * {@link org.hibernate.search.engine.environment.bean.spi.BeanConfigurer}s. * If a name is provided, it is interpreted as the name passed to * {@link org.hibernate.search.engine.environment.bean.spi.BeanConfigurationContext#define(Class, String, BeanReference)}. */ BUILTIN, /** * Retrieve an actual managed bean. *

* Retrieve the bean from the bean manager (e.g. CDI, Spring, ...). * If a name is provided, it is interpreted as a bean name, * for example assigned through {@code jakarta.inject.Named}. */ BEAN, /** * Retrieve an instance of a class. *

* First, attempt to retrieve the bean from the bean manager, (e.g. CDI, Spring, ...). * Failing that, instantiate the bean using reflection, through its public, no-arg constructor. * If a name is provided, it is interpreted as a class name. */ CLASS, /** * Retrieve an instance of a class through the constructor directly, ignoring any bean manager. *

* Instantiate the bean using reflection, through its public, no-arg constructor. * If a name is provided, it is interpreted as a class name. */ CONSTRUCTOR, /** * Retrieve a bean using any available method. *

* Attempts are made in the following order: *

    *
  1. Retrieve a pre-configured bean (see {@link #BUILTIN})
  2. *
  3. Retrieve an actual managed bean, interpreting the name (if any) as the bean name (see {@link #BEAN})
  4. *
  5. Retrieve an actual managed bean, interpreting the name (if any) as the class name (see {@link #CLASS})
  6. *
  7. Retrieve an instance of a class through reflection, * interpreting the name (if any) as the class name (see {@link #CONSTRUCTOR})
  8. *
*/ ANY }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy