org.hibernate.search.engine.impl
Class HibernateStatelessInitializer

java.lang.Object
  extended by org.hibernate.search.engine.impl.HibernateStatelessInitializer
All Implemented Interfaces:
InstanceInitializer
Direct Known Subclasses:
HibernateSessionLoadingInitializer

public class HibernateStatelessInitializer
extends Object
implements InstanceInitializer

To be used for Hibernate initializations which don't need a specific Session. initializeCollection(Collection) and initializeMap(Map) are not supported.

Author:
Sanne Grinovero (C) 2011 Red Hat Inc.

Field Summary
static HibernateStatelessInitializer INSTANCE
           
 
Constructor Summary
protected HibernateStatelessInitializer()
           
 
Method Summary
<T> Class<T>
getClass(T entity)
           
<T> Class<T>
getClassFromWork(Work<T> work)
           
 Object[] initializeArray(Object[] value)
           
<T> Collection<T>
initializeCollection(Collection<T> value)
           
<K,V> Map<K,V>
initializeMap(Map<K,V> value)
           
 Object unproxy(Object instance)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final HibernateStatelessInitializer INSTANCE
Constructor Detail

HibernateStatelessInitializer

protected HibernateStatelessInitializer()
Method Detail

getClass

public <T> Class<T> getClass(T entity)
Specified by:
getClass in interface InstanceInitializer
Parameters:
entity - an instance or proxy of T
Returns:
the class from the instance, or the underlying class from a proxy.

unproxy

public Object unproxy(Object instance)
Specified by:
unproxy in interface InstanceInitializer
Parameters:
instance - the object to unproxy
Returns:
if value is a proxy, unwraps it, otherwise works as a pass-through function.

initializeCollection

public <T> Collection<T> initializeCollection(Collection<T> value)
Specified by:
initializeCollection in interface InstanceInitializer
Parameters:
value - the collection to initialize
Returns:
the initialized Collection, to be used on lazily-loading collections

initializeMap

public <K,V> Map<K,V> initializeMap(Map<K,V> value)
Specified by:
initializeMap in interface InstanceInitializer
Parameters:
value - the map to initialize
Returns:
the initialized Map, to be used on lazily-loading maps

initializeArray

public Object[] initializeArray(Object[] value)
Specified by:
initializeArray in interface InstanceInitializer
Parameters:
value - the array to initialize
Returns:
the initialized array, to be used on lazily-loading arrays

getClassFromWork

public <T> Class<T> getClassFromWork(Work<T> work)
Specified by:
getClassFromWork in interface InstanceInitializer


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