public abstract class AbstractJMSHibernateSearchController extends Object implements javax.jms.MessageListener
Constructor and Description |
---|
AbstractJMSHibernateSearchController() |
Modifier and Type | Method and Description |
---|---|
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 |
onMessage(javax.jms.Message message)
Process the Hibernate Search work queues received
|
public AbstractJMSHibernateSearchController()
protected abstract org.hibernate.Session getSession()
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();
}
protected abstract void cleanSessionIfNeeded(org.hibernate.Session session)
public void onMessage(javax.jms.Message message)
onMessage
in interface javax.jms.MessageListener
Copyright © 2006–2015 Hibernate. All rights reserved.