org.jboss.soa.esb.listeners.gateway
Class HibernateInterceptor

java.lang.Object
  extended by org.hibernate.EmptyInterceptor
      extended by org.jboss.soa.esb.listeners.gateway.HibernateInterceptor
All Implemented Interfaces:
java.io.Serializable, org.hibernate.Interceptor

public class HibernateInterceptor
extends org.hibernate.EmptyInterceptor

HibernateInterceptor intercepts Hibernate events and sends the object they are being performed upon in a message. The object is sent in the body of the message with the "hibernateObject" string. The default composer for the HibernateInterceptor is PackageHibernateMessageContents.

Since:
Version 4.2
Author:
tcunning@redhat.com
See Also:
Serialized Form

Field Summary
protected  java.lang.Object m_composer
           
protected  java.lang.Class m_composerClass
           
protected  java.lang.String m_composerName
           
protected  ConfigTree m_config
           
protected  java.lang.reflect.Method m_processMethod
           
protected  ServiceInvoker m_serviceInvoker
           
protected  java.lang.String m_targetServiceCategory
           
protected  java.lang.String m_targetServiceName
           
 
Fields inherited from class org.hibernate.EmptyInterceptor
INSTANCE
 
Constructor Summary
HibernateInterceptor(ConfigTree f_config, java.util.ArrayList<HibernateEventBean> f_list)
          This constructor takes in a configuration and a list of hibernate events to monitor.
 
Method Summary
 void afterTransactionBegin(org.hibernate.Transaction arg0)
           
 void afterTransactionCompletion(org.hibernate.Transaction arg0)
           
 void beforeTransactionCompletion(org.hibernate.Transaction arg0)
           
 void onCollectionRecreate(java.lang.Object entity, java.io.Serializable id)
           
 void onCollectionRemove(java.lang.Object entity, java.io.Serializable id)
           
 void onCollectionUpdate(java.lang.Object entity, java.io.Serializable id)
           
 void onDelete(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
           
 boolean onFlushDirty(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] newValues, java.lang.Object[] oldValues, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
           
 boolean onLoad(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
           
 boolean onSave(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
           
 void postFlush(java.util.Iterator arg0)
           
 void preFlush(java.util.Iterator arg0)
           
protected  void resolveComposerClass()
          This method resolves the composer class.
 
Methods inherited from class org.hibernate.EmptyInterceptor
findDirty, getEntity, getEntityName, instantiate, isTransient, onPrepareStatement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_composerClass

protected java.lang.Class m_composerClass

m_processMethod

protected java.lang.reflect.Method m_processMethod

m_composer

protected java.lang.Object m_composer

m_composerName

protected java.lang.String m_composerName

m_config

protected ConfigTree m_config

m_serviceInvoker

protected ServiceInvoker m_serviceInvoker

m_targetServiceCategory

protected java.lang.String m_targetServiceCategory

m_targetServiceName

protected java.lang.String m_targetServiceName
Constructor Detail

HibernateInterceptor

public HibernateInterceptor(ConfigTree f_config,
                            java.util.ArrayList<HibernateEventBean> f_list)
                     throws ManagedLifecycleException
This constructor takes in a configuration and a list of hibernate events to monitor.

Parameters:
f_config -
f_list -
Throws:
ManagedLifecycleException
Method Detail

resolveComposerClass

protected void resolveComposerClass()
                             throws ConfigurationException
This method resolves the composer class. As a default, the HibernateInterceptor uses

Throws:
ConfigurationException

afterTransactionBegin

public void afterTransactionBegin(org.hibernate.Transaction arg0)
Specified by:
afterTransactionBegin in interface org.hibernate.Interceptor
Overrides:
afterTransactionBegin in class org.hibernate.EmptyInterceptor

afterTransactionCompletion

public void afterTransactionCompletion(org.hibernate.Transaction arg0)
Specified by:
afterTransactionCompletion in interface org.hibernate.Interceptor
Overrides:
afterTransactionCompletion in class org.hibernate.EmptyInterceptor

beforeTransactionCompletion

public void beforeTransactionCompletion(org.hibernate.Transaction arg0)
Specified by:
beforeTransactionCompletion in interface org.hibernate.Interceptor
Overrides:
beforeTransactionCompletion in class org.hibernate.EmptyInterceptor

onCollectionRecreate

public void onCollectionRecreate(java.lang.Object entity,
                                 java.io.Serializable id)
                          throws org.hibernate.CallbackException
Specified by:
onCollectionRecreate in interface org.hibernate.Interceptor
Overrides:
onCollectionRecreate in class org.hibernate.EmptyInterceptor
Throws:
org.hibernate.CallbackException

onCollectionRemove

public void onCollectionRemove(java.lang.Object entity,
                               java.io.Serializable id)
                        throws org.hibernate.CallbackException
Specified by:
onCollectionRemove in interface org.hibernate.Interceptor
Overrides:
onCollectionRemove in class org.hibernate.EmptyInterceptor
Throws:
org.hibernate.CallbackException

onCollectionUpdate

public void onCollectionUpdate(java.lang.Object entity,
                               java.io.Serializable id)
                        throws org.hibernate.CallbackException
Specified by:
onCollectionUpdate in interface org.hibernate.Interceptor
Overrides:
onCollectionUpdate in class org.hibernate.EmptyInterceptor
Throws:
org.hibernate.CallbackException

onDelete

public void onDelete(java.lang.Object entity,
                     java.io.Serializable id,
                     java.lang.Object[] state,
                     java.lang.String[] propertyNames,
                     org.hibernate.type.Type[] types)
              throws org.hibernate.CallbackException
Specified by:
onDelete in interface org.hibernate.Interceptor
Overrides:
onDelete in class org.hibernate.EmptyInterceptor
Throws:
org.hibernate.CallbackException

onFlushDirty

public boolean onFlushDirty(java.lang.Object entity,
                            java.io.Serializable id,
                            java.lang.Object[] newValues,
                            java.lang.Object[] oldValues,
                            java.lang.String[] propertyNames,
                            org.hibernate.type.Type[] types)
                     throws org.hibernate.CallbackException
Specified by:
onFlushDirty in interface org.hibernate.Interceptor
Overrides:
onFlushDirty in class org.hibernate.EmptyInterceptor
Throws:
org.hibernate.CallbackException

onLoad

public boolean onLoad(java.lang.Object entity,
                      java.io.Serializable id,
                      java.lang.Object[] state,
                      java.lang.String[] propertyNames,
                      org.hibernate.type.Type[] types)
               throws org.hibernate.CallbackException
Specified by:
onLoad in interface org.hibernate.Interceptor
Overrides:
onLoad in class org.hibernate.EmptyInterceptor
Throws:
org.hibernate.CallbackException

onSave

public boolean onSave(java.lang.Object entity,
                      java.io.Serializable id,
                      java.lang.Object[] state,
                      java.lang.String[] propertyNames,
                      org.hibernate.type.Type[] types)
               throws org.hibernate.CallbackException
Specified by:
onSave in interface org.hibernate.Interceptor
Overrides:
onSave in class org.hibernate.EmptyInterceptor
Throws:
org.hibernate.CallbackException

postFlush

public void postFlush(java.util.Iterator arg0)
               throws org.hibernate.CallbackException
Specified by:
postFlush in interface org.hibernate.Interceptor
Overrides:
postFlush in class org.hibernate.EmptyInterceptor
Throws:
org.hibernate.CallbackException

preFlush

public void preFlush(java.util.Iterator arg0)
              throws org.hibernate.CallbackException
Specified by:
preFlush in interface org.hibernate.Interceptor
Overrides:
preFlush in class org.hibernate.EmptyInterceptor
Throws:
org.hibernate.CallbackException