* @param entity must not be null
*/
public void index(Object entity) {
if (entity == null) return;
Class clazz = entity.getClass();
FullTextIndexEventListener listener = ContextHelper.getLuceneEventListener( session );
DocumentBuilder<Object> builder = listener.getDocumentBuilders().get( clazz );
if ( builder != null ) {
Serializable id = session.getIdentifier( entity );
Document doc = builder.getDocument( entity, id );
UpdateWork work = new UpdateWork( id, entity.getClass(), doc );
processWork( work, listener.getDocumentBuilders(), listener.getLockableDirectoryProviders() );
}
//TODO
//need to add elements in a queue kept at the Session level
//the queue will be processed by a Lucene(Auto)FlushEventListener
//note that we could keep this queue somewhere in the event listener in the mean time but that requires