org.hibernate.search.backend.impl.jms
Class AbstractJMSHibernateSearchController

java.lang.Object
  extended by org.hibernate.search.backend.impl.jms.AbstractJMSHibernateSearchController
All Implemented Interfaces:
javax.jms.MessageListener

public abstract class AbstractJMSHibernateSearchController
extends java.lang.Object
implements javax.jms.MessageListener

Implement the Hibernate Search controller responsible for processing the work send through JMS by the slave nodes.

Author:
Emmanuel Bernard

Constructor Summary
AbstractJMSHibernateSearchController()
           
 
Method Summary
protected abstract  void cleanSessionIfNeeded(org.hibernate.Session session)
          Ensure to clean the resources after use.
protected abstract  org.hibernate.Session getSession()
          Return the current or give a new session This session is not used per se, but is the link to access the Search configuration.
 void initialize()
           
 void onMessage(javax.jms.Message message)
          Process the Hibernate Search work queues received
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractJMSHibernateSearchController

public AbstractJMSHibernateSearchController()
Method Detail

getSession

protected abstract org.hibernate.Session getSession()
Return the current or give a new session This session is not used per se, but is the link to access the Search configuration.

A typical EJB 3.0 usecase would be to get the session from the container (injected) eg in JBoss EJB 3.0

@PersistenceContext private Session session;

protected Session getSession() {
   return session
}

eg in any container
@PersistenceContext private EntityManager entityManager;

protected Session getSession() {
   return (Session) entityManager.getdelegate();
}


cleanSessionIfNeeded

protected abstract void cleanSessionIfNeeded(org.hibernate.Session session)
Ensure to clean the resources after use. If the session has been directly or indirectly injected, this method is empty


onMessage

public void onMessage(javax.jms.Message message)
Process the Hibernate Search work queues received

Specified by:
onMessage in interface javax.jms.MessageListener

initialize

@PostConstruct
public void initialize()

shutdown

@PreDestroy
public void shutdown()


Copyright © 2006-2010 Hibernate. All Rights Reserved.