org.hibernate.search.impl
Class ReflectionReplacingSearchConfiguration

java.lang.Object
  extended by org.hibernate.search.impl.ReflectionReplacingSearchConfiguration
All Implemented Interfaces:
SearchConfiguration

public final class ReflectionReplacingSearchConfiguration
extends Object
implements SearchConfiguration

Wraps another SearchConfiguration to override it's ReflectionManager

Since:
4.1
Author:
Sanne Grinovero

Constructor Summary
ReflectionReplacingSearchConfiguration(org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager, SearchConfiguration cfg)
          Create a new SearchConfiguration which returns the same values as the provided SearchConfiguration instance, with the exception of getReflectionManager() which will return the constructor defined ReflectionManager.
 
Method Summary
 Class<?> getClassMapping(String name)
          Returns a Class from a String parameter.
 Iterator<Class<?>> getClassMappings()
          Returns an iterator over the list of indexed classes
 InstanceInitializer getInstanceInitializer()
           
 SearchMapping getProgrammaticMapping()
           
 Properties getProperties()
          Gets properties as a java.util.Properties object.
 String getProperty(String propertyName)
          Gets a configuration property from its name or null if not present
 Map<Class<? extends ServiceProvider<?>>,Object> getProvidedServices()
          Provide service instances.
 org.hibernate.annotations.common.reflection.ReflectionManager getReflectionManager()
          Returns a reflection manager if already available in the environment null otherwise
 boolean isIndexMetadataComplete()
           
 boolean isTransactionManagerExpected()
          By default Hibernate Search expects to execute in the context of a transaction, and will log warning when certain operations are executed out of such a scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionReplacingSearchConfiguration

public ReflectionReplacingSearchConfiguration(org.hibernate.annotations.common.reflection.ReflectionManager reflectionManager,
                                              SearchConfiguration cfg)
Create a new SearchConfiguration which returns the same values as the provided SearchConfiguration instance, with the exception of getReflectionManager() which will return the constructor defined ReflectionManager.

Parameters:
reflectionManager -
cfg -
Method Detail

getClassMappings

public Iterator<Class<?>> getClassMappings()
Description copied from interface: SearchConfiguration
Returns an iterator over the list of indexed classes

Specified by:
getClassMappings in interface SearchConfiguration
Returns:
iterator of indexed classes.

getClassMapping

public Class<?> getClassMapping(String name)
Description copied from interface: SearchConfiguration
Returns a Class from a String parameter.

Specified by:
getClassMapping in interface SearchConfiguration
Returns:
corresponding class instance.

getProperty

public String getProperty(String propertyName)
Description copied from interface: SearchConfiguration
Gets a configuration property from its name or null if not present

Specified by:
getProperty in interface SearchConfiguration
Parameters:
propertyName - - as a String.
Returns:
the property as a String

getProperties

public Properties getProperties()
Description copied from interface: SearchConfiguration
Gets properties as a java.util.Properties object.

Specified by:
getProperties in interface SearchConfiguration
Returns:
a java.util.Properties object.
See Also:
object

getReflectionManager

public org.hibernate.annotations.common.reflection.ReflectionManager getReflectionManager()
Description copied from interface: SearchConfiguration
Returns a reflection manager if already available in the environment null otherwise

Specified by:
getReflectionManager in interface SearchConfiguration
Returns:
ReflectionManager

getProgrammaticMapping

public SearchMapping getProgrammaticMapping()
Specified by:
getProgrammaticMapping in interface SearchConfiguration
Returns:
the programmatic configuration or null

getProvidedServices

public Map<Class<? extends ServiceProvider<?>>,Object> getProvidedServices()
Description copied from interface: SearchConfiguration
Provide service instances. Return the provided services (provider and instance at stake) These services are passed untouched by Hibernate Search via the BuildContext.requestService(Class) API Note that the lifecycle methods: - org.hibernate.search.spi.ServiceProvider#start(java.util.Properties) - ServiceProvider.stop() of the provider are *not* called. For services using the same ServiceProvider class, provided services have priority over managed services (ie the ones using the service locator pattern).

Specified by:
getProvidedServices in interface SearchConfiguration

isTransactionManagerExpected

public boolean isTransactionManagerExpected()
Description copied from interface: SearchConfiguration
By default Hibernate Search expects to execute in the context of a transaction, and will log warning when certain operations are executed out of such a scope.

Specified by:
isTransactionManagerExpected in interface SearchConfiguration
Returns:
when returning false Search will avoid logging such warnings.

getInstanceInitializer

public InstanceInitializer getInstanceInitializer()
Specified by:
getInstanceInitializer in interface SearchConfiguration

isIndexMetadataComplete

public boolean isIndexMetadataComplete()
Specified by:
isIndexMetadataComplete in interface SearchConfiguration
Returns:
true if it is safe to assume that the information we have about index metadata is accurate. This should be set to false for example if the index could contain Documents related to types not known to this SearchFactory instance.


Copyright © 2006-2012 Red Hat Middleware, LLC. All Rights Reserved