|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.EmptyInterceptor org.addsimplicity.anicetus.hibernate.TelemetryInterceptor
public class TelemetryInterceptor
The telemetry interceptor uses the Hibernate interceptor interface to capture operations that are performed by Hibernate and create a telemetry artifact. The telemetry is created at the start of a transaction so that it can gather all of the entities and operations that are done during the transaction. The operation timer is started at the beginning of the commit so the time captured is database processing time. Note that telemetry is not captured if a Hibernate transaction is not used. The interceptor relies upon Spring to retrieve the context used for managing the state of the transactional stack.
Field Summary |
---|
Fields inherited from class org.hibernate.EmptyInterceptor |
---|
INSTANCE |
Constructor Summary | |
---|---|
TelemetryInterceptor()
|
Method Summary | |
---|---|
void |
afterTransactionBegin(org.hibernate.Transaction tx)
This method is called by Hibernate after the begin transaction operation. |
void |
afterTransactionCompletion(org.hibernate.Transaction tx)
This method is called by Hibernate when the transaction completes. |
void |
beforeTransactionCompletion(org.hibernate.Transaction tx)
This method is called by Hibernate before the transaction begins to commit to the database. |
java.lang.String |
getManagerName()
Get the key used to retrieve the TelemetryContext from the Spring context. |
void |
onDelete(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] state,
java.lang.String[] propertyNames,
org.hibernate.type.Type[] types)
This method is called by Hibernate prior to an entity being deleted. |
boolean |
onFlushDirty(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] currentState,
java.lang.Object[] previousState,
java.lang.String[] propertyNames,
org.hibernate.type.Type[] types)
This method is called by Hibernate prior to an entity being updated. |
boolean |
onLoad(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] state,
java.lang.String[] propertyNames,
org.hibernate.type.Type[] types)
This method is called prior to an object being loaded from the database. |
java.lang.String |
onPrepareStatement(java.lang.String sql)
This method is called by Hibernate each time a SQL statement is prepared. |
boolean |
onSave(java.lang.Object entity,
java.io.Serializable id,
java.lang.Object[] state,
java.lang.String[] propertyNames,
org.hibernate.type.Type[] types)
This method is called by Hibernate each time an entity is being inserted. |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory factory)
This method is called by Spring to set the context used to create the bean. |
void |
setManagerName(java.lang.String managerName)
Set the Spring key that is used to retrieve the TelemetryContext from the Spring container. |
Methods inherited from class org.hibernate.EmptyInterceptor |
---|
findDirty, getEntity, getEntityName, instantiate, isTransient, onCollectionRecreate, onCollectionRemove, onCollectionUpdate, postFlush, preFlush |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TelemetryInterceptor()
Method Detail |
---|
public void afterTransactionBegin(org.hibernate.Transaction tx)
afterTransactionBegin
in interface org.hibernate.Interceptor
afterTransactionBegin
in class org.hibernate.EmptyInterceptor
public void afterTransactionCompletion(org.hibernate.Transaction tx)
afterTransactionCompletion
in interface org.hibernate.Interceptor
afterTransactionCompletion
in class org.hibernate.EmptyInterceptor
public void beforeTransactionCompletion(org.hibernate.Transaction tx)
beforeTransactionCompletion
in interface org.hibernate.Interceptor
beforeTransactionCompletion
in class org.hibernate.EmptyInterceptor
public java.lang.String getManagerName()
public void onDelete(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
onDelete
in interface org.hibernate.Interceptor
onDelete
in class org.hibernate.EmptyInterceptor
public boolean onFlushDirty(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] currentState, java.lang.Object[] previousState, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
onFlushDirty
in interface org.hibernate.Interceptor
onFlushDirty
in class org.hibernate.EmptyInterceptor
public boolean onLoad(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
onLoad
in interface org.hibernate.Interceptor
onLoad
in class org.hibernate.EmptyInterceptor
public java.lang.String onPrepareStatement(java.lang.String sql)
onPrepareStatement
in interface org.hibernate.Interceptor
onPrepareStatement
in class org.hibernate.EmptyInterceptor
public boolean onSave(java.lang.Object entity, java.io.Serializable id, java.lang.Object[] state, java.lang.String[] propertyNames, org.hibernate.type.Type[] types)
onSave
in interface org.hibernate.Interceptor
onSave
in class org.hibernate.EmptyInterceptor
public void setBeanFactory(org.springframework.beans.factory.BeanFactory factory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
public void setManagerName(java.lang.String managerName)
managerName
- The key to the TelemetryContext
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |