HHH-17347 Rename HibernateEvent to HibernateMonitoringEvent

This commit is contained in:
Andrea Boriero 2023-11-15 12:08:54 +01:00 committed by Steve Ebersole
parent 9f1f8e6c09
commit d61749374a
38 changed files with 187 additions and 177 deletions

View File

@ -18,7 +18,7 @@ import org.hibernate.engine.spi.SessionEventListenerManager;
import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.event.service.spi.EventListenerGroup; import org.hibernate.event.service.spi.EventListenerGroup;
import org.hibernate.event.spi.EventSource; import org.hibernate.event.spi.EventSource;
import org.hibernate.event.spi.PostCommitInsertEventListener; import org.hibernate.event.spi.PostCommitInsertEventListener;
@ -164,7 +164,7 @@ public class EntityInsertAction extends AbstractEntityInsertAction {
protected boolean cacheInsert(EntityPersister persister, Object ck) { protected boolean cacheInsert(EntityPersister persister, Object ck) {
SharedSessionContractImplementor session = getSession(); SharedSessionContractImplementor session = getSession();
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
final EntityDataAccess cacheAccessStrategy = persister.getCacheAccessStrategy(); final EntityDataAccess cacheAccessStrategy = persister.getCacheAccessStrategy();
boolean insert = false; boolean insert = false;
try { try {
@ -256,7 +256,7 @@ public class EntityInsertAction extends AbstractEntityInsertAction {
SharedSessionContractImplementor session = getSession(); SharedSessionContractImplementor session = getSession();
final SessionEventListenerManager eventListenerManager = session.getEventListenerManager(); final SessionEventListenerManager eventListenerManager = session.getEventListenerManager();
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
boolean afterInsert = false; boolean afterInsert = false;
try { try {
eventListenerManager.cachePutStart(); eventListenerManager.cachePutStart();

View File

@ -20,7 +20,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.engine.spi.Status; import org.hibernate.engine.spi.Status;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.event.service.spi.EventListenerGroup; import org.hibernate.event.service.spi.EventListenerGroup;
import org.hibernate.event.spi.EventSource; import org.hibernate.event.spi.EventSource;
import org.hibernate.event.spi.PostCommitUpdateEventListener; import org.hibernate.event.spi.PostCommitUpdateEventListener;
@ -310,7 +310,7 @@ public class EntityUpdateAction extends EntityAction {
protected boolean updateCache(EntityPersister persister, Object previousVersion, Object ck) { protected boolean updateCache(EntityPersister persister, Object previousVersion, Object ck) {
final SharedSessionContractImplementor session = getSession(); final SharedSessionContractImplementor session = getSession();
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
final EntityDataAccess cacheAccessStrategy = persister.getCacheAccessStrategy(); final EntityDataAccess cacheAccessStrategy = persister.getCacheAccessStrategy();
boolean update = false; boolean update = false;
try { try {
@ -436,7 +436,7 @@ public class EntityUpdateAction extends EntityAction {
protected void cacheAfterUpdate(EntityDataAccess cache, Object ck, SharedSessionContractImplementor session) { protected void cacheAfterUpdate(EntityDataAccess cache, Object ck, SharedSessionContractImplementor session) {
final SessionEventListenerManager eventListenerManager = session.getEventListenerManager(); final SessionEventListenerManager eventListenerManager = session.getEventListenerManager();
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
boolean put = false; boolean put = false;
try { try {
eventListenerManager.cachePutStart(); eventListenerManager.cachePutStart();

View File

@ -18,7 +18,7 @@ import org.hibernate.cache.spi.QueryResultsRegion;
import org.hibernate.cache.spi.TimestampsCache; import org.hibernate.cache.spi.TimestampsCache;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import static org.hibernate.cache.spi.SecondLevelCacheLogger.L2CACHE_LOGGER; import static org.hibernate.cache.spi.SecondLevelCacheLogger.L2CACHE_LOGGER;
@ -64,7 +64,7 @@ public class QueryResultsCacheImpl implements QueryResultsCache {
); );
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
try { try {
session.getEventListenerManager().cachePutStart(); session.getEventListenerManager().cachePutStart();
cacheRegion.putIntoCache( key, cacheItem, session ); cacheRegion.putIntoCache( key, cacheItem, session );
@ -154,7 +154,7 @@ public class QueryResultsCacheImpl implements QueryResultsCache {
private CacheItem getCachedData(QueryKey key, SharedSessionContractImplementor session) { private CacheItem getCachedData(QueryKey key, SharedSessionContractImplementor session) {
CacheItem cachedItem = null; CacheItem cachedItem = null;
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cacheGetEvent = eventManager.beginCacheGetEvent(); final HibernateMonitoringEvent cacheGetEvent = eventManager.beginCacheGetEvent();
try { try {
session.getEventListenerManager().cacheGetStart(); session.getEventListenerManager().cacheGetStart();
cachedItem = (CacheItem) cacheRegion.getFromCache( key, session ); cachedItem = (CacheItem) cacheRegion.getFromCache( key, session );

View File

@ -15,7 +15,7 @@ import org.hibernate.engine.spi.SessionEventListenerManager;
import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.stat.spi.StatisticsImplementor; import org.hibernate.stat.spi.StatisticsImplementor;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
@ -61,7 +61,7 @@ public class TimestampsCacheEnabledImpl implements TimestampsCache {
log.debugf( "Pre-invalidating space [%s], timestamp: %s", space, ts ); log.debugf( "Pre-invalidating space [%s], timestamp: %s", space, ts );
} }
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
try { try {
eventListenerManager.cachePutStart(); eventListenerManager.cachePutStart();
@ -103,7 +103,7 @@ public class TimestampsCacheEnabledImpl implements TimestampsCache {
final SessionEventListenerManager eventListenerManager = session.getEventListenerManager(); final SessionEventListenerManager eventListenerManager = session.getEventListenerManager();
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
try { try {
eventListenerManager.cachePutStart(); eventListenerManager.cachePutStart();
timestampsRegion.putIntoCache( space, ts, session ); timestampsRegion.putIntoCache( space, ts, session );
@ -195,7 +195,7 @@ public class TimestampsCacheEnabledImpl implements TimestampsCache {
private Long getLastUpdateTimestampForSpace(String space, SharedSessionContractImplementor session) { private Long getLastUpdateTimestampForSpace(String space, SharedSessionContractImplementor session) {
Long ts = null; Long ts = null;
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cacheGetEvent = eventManager.beginCacheGetEvent(); final HibernateMonitoringEvent cacheGetEvent = eventManager.beginCacheGetEvent();
try { try {
session.getEventListenerManager().cacheGetStart(); session.getEventListenerManager().cacheGetStart();
ts = (Long) timestampsRegion.getFromCache( space, session ); ts = (Long) timestampsRegion.getFromCache( space, session );

View File

@ -13,7 +13,7 @@ import org.hibernate.cache.spi.access.CachedDomainDataAccess;
import org.hibernate.engine.spi.SessionEventListenerManager; import org.hibernate.engine.spi.SessionEventListenerManager;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.metamodel.mapping.JdbcMapping; import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.persister.collection.CollectionPersister; import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
@ -47,7 +47,7 @@ public final class CacheHelper {
Object cachedValue = null; Object cachedValue = null;
eventListenerManager.cacheGetStart(); eventListenerManager.cacheGetStart();
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cacheGetEvent = eventManager.beginCacheGetEvent(); final HibernateMonitoringEvent cacheGetEvent = eventManager.beginCacheGetEvent();
try { try {
cachedValue = cacheAccess.get( session, cacheKey ); cachedValue = cacheAccess.get( session, cacheKey );
} }
@ -74,7 +74,7 @@ public final class CacheHelper {
Object cachedValue = null; Object cachedValue = null;
eventListenerManager.cacheGetStart(); eventListenerManager.cacheGetStart();
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cacheGetEvent = eventManager.beginCacheGetEvent(); final HibernateMonitoringEvent cacheGetEvent = eventManager.beginCacheGetEvent();
try { try {
cachedValue = cacheAccess.get( session, cacheKey ); cachedValue = cacheAccess.get( session, cacheKey );
} }

View File

@ -24,7 +24,7 @@ import org.hibernate.engine.spi.Resolution;
import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.metamodel.mapping.EntityMappingType; import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.NaturalIdLogging; import org.hibernate.metamodel.mapping.NaturalIdLogging;
import org.hibernate.metamodel.mapping.NaturalIdMapping; import org.hibernate.metamodel.mapping.NaturalIdMapping;
@ -275,7 +275,7 @@ public class NaturalIdResolutionsImpl implements NaturalIdResolutions, Serializa
return; return;
} }
boolean put = false; boolean put = false;
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
try { try {
put = cacheAccess.putFromLoad( put = cacheAccess.putFromLoad(
s, s,
@ -307,7 +307,7 @@ public class NaturalIdResolutionsImpl implements NaturalIdResolutions, Serializa
} }
case INSERT: { case INSERT: {
boolean put = false; boolean put = false;
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
try { try {
put = cacheAccess.insert( s, cacheKey, id ); put = cacheAccess.insert( s, cacheKey, id );
@ -360,7 +360,7 @@ public class NaturalIdResolutionsImpl implements NaturalIdResolutions, Serializa
final SoftLock lock = cacheAccess.lockItem( s, cacheKey, null ); final SoftLock lock = cacheAccess.lockItem( s, cacheKey, null );
boolean put = false; boolean put = false;
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
try { try {
put = cacheAccess.update( s, cacheKey, id ); put = cacheAccess.update( s, cacheKey, id );
if ( put && statistics.isStatisticsEnabled() ) { if ( put && statistics.isStatisticsEnabled() ) {
@ -387,7 +387,7 @@ public class NaturalIdResolutionsImpl implements NaturalIdResolutions, Serializa
cacheAccess.unlockItem( s, previousCacheKey, removalLock ); cacheAccess.unlockItem( s, previousCacheKey, removalLock );
if (success) { if (success) {
boolean putAfterUpdate = false; boolean putAfterUpdate = false;
final HibernateEvent cachePutEventAfterUpdate = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEventAfterUpdate = eventManager.beginCachePutEvent();
try { try {
putAfterUpdate = cacheAccess.afterUpdate( putAfterUpdate = cacheAccess.afterUpdate(
s, s,

View File

@ -23,7 +23,7 @@ import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper; import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.engine.jdbc.spi.SqlStatementLogger; import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.resource.jdbc.spi.JdbcObserver; import org.hibernate.resource.jdbc.spi.JdbcObserver;
import org.hibernate.resource.jdbc.spi.JdbcSessionOwner; import org.hibernate.resource.jdbc.spi.JdbcSessionOwner;
@ -273,7 +273,7 @@ public class BatchImpl implements Batch {
if ( statementDetails.getMutatingTableDetails().isIdentifierTable() ) { if ( statementDetails.getMutatingTableDetails().isIdentifierTable() ) {
final int[] rowCounts; final int[] rowCounts;
final EventManager eventManager = jdbcSessionOwner.getEventManager(); final EventManager eventManager = jdbcSessionOwner.getEventManager();
final HibernateEvent jdbcBatchExecutionEvent = eventManager.beginJdbcBatchExecutionEvent(); final HibernateMonitoringEvent jdbcBatchExecutionEvent = eventManager.beginJdbcBatchExecutionEvent();
try { try {
observer.jdbcExecuteBatchStart(); observer.jdbcExecuteBatchStart();
rowCounts = statement.executeBatch(); rowCounts = statement.executeBatch();

View File

@ -15,7 +15,7 @@ import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.jdbc.spi.MutationStatementPreparer; import org.hibernate.engine.jdbc.spi.MutationStatementPreparer;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper; import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.resource.jdbc.spi.JdbcObserver; import org.hibernate.resource.jdbc.spi.JdbcObserver;
import org.hibernate.resource.jdbc.spi.JdbcSessionContext; import org.hibernate.resource.jdbc.spi.JdbcSessionContext;
import org.hibernate.resource.jdbc.spi.JdbcSessionOwner; import org.hibernate.resource.jdbc.spi.JdbcSessionOwner;
@ -100,7 +100,7 @@ public class MutationStatementPreparerImpl implements MutationStatementPreparer
.getJdbcSessionContext() .getJdbcSessionContext()
.getObserver(); .getObserver();
final EventManager eventManager = jdbcSessionOwner.getEventManager(); final EventManager eventManager = jdbcSessionOwner.getEventManager();
final HibernateEvent jdbcPreparedStatementCreation = eventManager.beginJdbcPreparedStatementCreationEvent(); final HibernateMonitoringEvent jdbcPreparedStatementCreation = eventManager.beginJdbcPreparedStatementCreationEvent();
try { try {
observer.jdbcPrepareStatementStart(); observer.jdbcPrepareStatementStart();
preparedStatement = doPrepare(); preparedStatement = doPrepare();

View File

@ -18,7 +18,7 @@ import org.hibernate.engine.jdbc.spi.ResultSetReturn;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper; import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.engine.jdbc.spi.SqlStatementLogger; import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.resource.jdbc.spi.JdbcSessionContext; import org.hibernate.resource.jdbc.spi.JdbcSessionContext;
/** /**
@ -55,7 +55,7 @@ public class ResultSetReturnImpl implements ResultSetReturn {
try { try {
final ResultSet rs; final ResultSet rs;
final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager(); final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
jdbcExecuteStatementStart(); jdbcExecuteStatementStart();
rs = statement.executeQuery(); rs = statement.executeQuery();
@ -95,7 +95,7 @@ public class ResultSetReturnImpl implements ResultSetReturn {
try { try {
final ResultSet rs; final ResultSet rs;
final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager(); final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
jdbcExecuteStatementStart(); jdbcExecuteStatementStart();
rs = statement.executeQuery( sql ); rs = statement.executeQuery( sql );
@ -123,7 +123,7 @@ public class ResultSetReturnImpl implements ResultSetReturn {
try { try {
final ResultSet rs; final ResultSet rs;
final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager(); final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
jdbcExecuteStatementStart(); jdbcExecuteStatementStart();
if ( !statement.execute() ) { if ( !statement.execute() ) {
@ -156,7 +156,7 @@ public class ResultSetReturnImpl implements ResultSetReturn {
try { try {
final ResultSet rs; final ResultSet rs;
final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager(); final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
jdbcExecuteStatementStart(); jdbcExecuteStatementStart();
if ( !statement.execute( sql ) ) { if ( !statement.execute( sql ) ) {
@ -188,7 +188,7 @@ public class ResultSetReturnImpl implements ResultSetReturn {
executeStartNanos = System.nanoTime(); executeStartNanos = System.nanoTime();
} }
final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager(); final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
jdbcExecuteStatementStart(); jdbcExecuteStatementStart();
return statement.executeUpdate(); return statement.executeUpdate();
@ -211,7 +211,7 @@ public class ResultSetReturnImpl implements ResultSetReturn {
executeStartNanos = System.nanoTime(); executeStartNanos = System.nanoTime();
} }
final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager(); final EventManager eventManager = jdbcCoordinator.getJdbcSessionOwner().getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
jdbcExecuteStatementStart(); jdbcExecuteStatementStart();
return statement.executeUpdate( sql ); return statement.executeUpdate( sql );

View File

@ -18,7 +18,7 @@ import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.jdbc.spi.SqlExceptionHelper; import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.engine.jdbc.spi.StatementPreparer; import org.hibernate.engine.jdbc.spi.StatementPreparer;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.resource.jdbc.spi.JdbcObserver; import org.hibernate.resource.jdbc.spi.JdbcObserver;
import org.hibernate.resource.jdbc.spi.JdbcSessionContext; import org.hibernate.resource.jdbc.spi.JdbcSessionContext;
import org.hibernate.resource.jdbc.spi.JdbcSessionOwner; import org.hibernate.resource.jdbc.spi.JdbcSessionOwner;
@ -177,7 +177,7 @@ class StatementPreparerImpl implements StatementPreparer {
final JdbcSessionOwner jdbcSessionOwner = jdbcCoordinator.getJdbcSessionOwner(); final JdbcSessionOwner jdbcSessionOwner = jdbcCoordinator.getJdbcSessionOwner();
final JdbcObserver observer = jdbcSessionOwner.getJdbcSessionContext().getObserver(); final JdbcObserver observer = jdbcSessionOwner.getJdbcSessionContext().getObserver();
final EventManager eventManager = jdbcSessionOwner.getEventManager(); final EventManager eventManager = jdbcSessionOwner.getEventManager();
final HibernateEvent jdbcPreparedStatementCreation = eventManager.beginJdbcPreparedStatementCreationEvent(); final HibernateMonitoringEvent jdbcPreparedStatementCreation = eventManager.beginJdbcPreparedStatementCreationEvent();
try { try {
observer.jdbcPrepareStatementStart(); observer.jdbcPrepareStatementStart();
preparedStatement = doPrepare(); preparedStatement = doPrepare();

View File

@ -14,7 +14,7 @@ import org.hibernate.engine.spi.SessionEventListenerManager;
import org.hibernate.event.spi.AutoFlushEvent; import org.hibernate.event.spi.AutoFlushEvent;
import org.hibernate.event.spi.AutoFlushEventListener; import org.hibernate.event.spi.AutoFlushEventListener;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.event.spi.EventSource; import org.hibernate.event.spi.EventSource;
import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.stat.spi.StatisticsImplementor; import org.hibernate.stat.spi.StatisticsImplementor;
@ -40,7 +40,7 @@ public class DefaultAutoFlushEventListener extends AbstractFlushingEventListener
final EventSource source = event.getSession(); final EventSource source = event.getSession();
final SessionEventListenerManager eventListenerManager = source.getEventListenerManager(); final SessionEventListenerManager eventListenerManager = source.getEventListenerManager();
final EventManager eventManager = source.getEventManager(); final EventManager eventManager = source.getEventManager();
final HibernateEvent partialFlushEvent = eventManager.beginPartialFlushEvent(); final HibernateMonitoringEvent partialFlushEvent = eventManager.beginPartialFlushEvent();
try { try {
eventListenerManager.partialFlushStart(); eventListenerManager.partialFlushStart();
@ -56,7 +56,7 @@ public class DefaultAutoFlushEventListener extends AbstractFlushingEventListener
// note: performExecutions() clears all collectionXxxxtion // note: performExecutions() clears all collectionXxxxtion
// collections (the collection actions) in the session // collections (the collection actions) in the session
final HibernateEvent flushEvent = eventManager.beginFlushEvent(); final HibernateMonitoringEvent flushEvent = eventManager.beginFlushEvent();
try { try {
performExecutions( source ); performExecutions( source );
postFlush( source ); postFlush( source );

View File

@ -25,7 +25,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SessionImplementor; import org.hibernate.engine.spi.SessionImplementor;
import org.hibernate.engine.spi.Status; import org.hibernate.engine.spi.Status;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.event.spi.EventSource; import org.hibernate.event.spi.EventSource;
import org.hibernate.event.spi.FlushEntityEvent; import org.hibernate.event.spi.FlushEntityEvent;
import org.hibernate.event.spi.FlushEntityEventListener; import org.hibernate.event.spi.FlushEntityEventListener;
@ -485,7 +485,7 @@ public class DefaultFlushEntityEventListener implements FlushEntityEventListener
boolean dirtyCheckPossible; boolean dirtyCheckPossible;
int[] dirtyProperties = null; int[] dirtyProperties = null;
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent dirtyCalculationEvent = eventManager.beginDirtyCalculationEvent(); final HibernateMonitoringEvent dirtyCalculationEvent = eventManager.beginDirtyCalculationEvent();
final EntityEntry entry = event.getEntityEntry(); final EntityEntry entry = event.getEntityEntry();
final EntityPersister persister = entry.getPersister(); final EntityPersister persister = entry.getPersister();
try { try {

View File

@ -9,7 +9,7 @@ package org.hibernate.event.internal;
import org.hibernate.HibernateException; import org.hibernate.HibernateException;
import org.hibernate.engine.spi.PersistenceContext; import org.hibernate.engine.spi.PersistenceContext;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.event.spi.EventSource; import org.hibernate.event.spi.EventSource;
import org.hibernate.event.spi.FlushEvent; import org.hibernate.event.spi.FlushEvent;
import org.hibernate.event.spi.FlushEventListener; import org.hibernate.event.spi.FlushEventListener;
@ -33,7 +33,7 @@ public class DefaultFlushEventListener extends AbstractFlushingEventListener imp
final EventManager eventManager = source.getEventManager(); final EventManager eventManager = source.getEventManager();
if ( persistenceContext.getNumberOfManagedEntities() > 0 if ( persistenceContext.getNumberOfManagedEntities() > 0
|| persistenceContext.getCollectionEntriesSize() > 0 ) { || persistenceContext.getCollectionEntriesSize() > 0 ) {
final HibernateEvent flushEvent = eventManager.beginFlushEvent(); final HibernateMonitoringEvent flushEvent = eventManager.beginFlushEvent();
try { try {
source.getEventListenerManager().flushStart(); source.getEventListenerManager().flushStart();

View File

@ -12,7 +12,7 @@ import org.hibernate.engine.spi.EntityEntry;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.AutoFlushEvent; import org.hibernate.event.spi.AutoFlushEvent;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.event.spi.FlushEvent; import org.hibernate.event.spi.FlushEvent;
import org.hibernate.persister.collection.CollectionPersister; import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
@ -20,95 +20,95 @@ import org.hibernate.persister.entity.EntityPersister;
public final class EmptyEventManager implements EventManager { public final class EmptyEventManager implements EventManager {
@Override @Override
public HibernateEvent beginSessionOpenEvent() { public HibernateMonitoringEvent beginSessionOpenEvent() {
return null; return null;
} }
@Override @Override
public void completeSessionOpenEvent(HibernateEvent sessionOpenEvent, SharedSessionContractImplementor session) { public void completeSessionOpenEvent(HibernateMonitoringEvent sessionOpenEvent, SharedSessionContractImplementor session) {
} }
@Override @Override
public HibernateEvent beginSessionClosedEvent() { public HibernateMonitoringEvent beginSessionClosedEvent() {
return null; return null;
} }
@Override @Override
public void completeSessionClosedEvent( public void completeSessionClosedEvent(
HibernateEvent sessionClosedEvent, HibernateMonitoringEvent sessionClosedEvent,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
} }
@Override @Override
public HibernateEvent beginJdbcConnectionAcquisitionEvent() { public HibernateMonitoringEvent beginJdbcConnectionAcquisitionEvent() {
return null; return null;
} }
@Override @Override
public void completeJdbcConnectionAcquisitionEvent( public void completeJdbcConnectionAcquisitionEvent(
HibernateEvent jdbcConnectionAcquisitionEvent, HibernateMonitoringEvent jdbcConnectionAcquisitionEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Object tenantId) { Object tenantId) {
} }
@Override @Override
public HibernateEvent beginJdbcConnectionReleaseEvent() { public HibernateMonitoringEvent beginJdbcConnectionReleaseEvent() {
return null; return null;
} }
@Override @Override
public void completeJdbcConnectionReleaseEvent( public void completeJdbcConnectionReleaseEvent(
HibernateEvent jdbcConnectionReleaseEvent, HibernateMonitoringEvent jdbcConnectionReleaseEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Object tenantId) { Object tenantId) {
} }
@Override @Override
public HibernateEvent beginJdbcPreparedStatementCreationEvent() { public HibernateMonitoringEvent beginJdbcPreparedStatementCreationEvent() {
return null; return null;
} }
@Override @Override
public void completeJdbcPreparedStatementCreationEvent( public void completeJdbcPreparedStatementCreationEvent(
HibernateEvent jdbcPreparedStatementCreation, HibernateMonitoringEvent jdbcPreparedStatementCreation,
String preparedStatementSql) { String preparedStatementSql) {
} }
@Override @Override
public HibernateEvent beginJdbcPreparedStatementExecutionEvent() { public HibernateMonitoringEvent beginJdbcPreparedStatementExecutionEvent() {
return null; return null;
} }
@Override @Override
public void completeJdbcPreparedStatementExecutionEvent( public void completeJdbcPreparedStatementExecutionEvent(
HibernateEvent jdbcPreparedStatementExecutionEvent, HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent,
String preparedStatementSql) { String preparedStatementSql) {
} }
@Override @Override
public HibernateEvent beginJdbcBatchExecutionEvent() { public HibernateMonitoringEvent beginJdbcBatchExecutionEvent() {
return null; return null;
} }
@Override @Override
public void completeJdbcBatchExecutionEvent(HibernateEvent jdbcBatchExecutionEvent, String statementSql) { public void completeJdbcBatchExecutionEvent(HibernateMonitoringEvent jdbcBatchExecutionEvent, String statementSql) {
} }
@Override @Override
public HibernateEvent beginCachePutEvent() { public HibernateMonitoringEvent beginCachePutEvent() {
return null; return null;
} }
@Override @Override
public void completeCachePutEvent( public void completeCachePutEvent(
HibernateEvent cachePutEvent, HibernateMonitoringEvent cachePutEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
boolean cacheContentChanged, boolean cacheContentChanged,
@ -118,7 +118,7 @@ public final class EmptyEventManager implements EventManager {
@Override @Override
public void completeCachePutEvent( public void completeCachePutEvent(
HibernateEvent cachePutEvent, HibernateMonitoringEvent cachePutEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
CachedDomainDataAccess cachedDomainDataAccess, CachedDomainDataAccess cachedDomainDataAccess,
EntityPersister persister, EntityPersister persister,
@ -129,7 +129,7 @@ public final class EmptyEventManager implements EventManager {
@Override @Override
public void completeCachePutEvent( public void completeCachePutEvent(
HibernateEvent cachePutEvent, HibernateMonitoringEvent cachePutEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
CachedDomainDataAccess cachedDomainDataAccess, CachedDomainDataAccess cachedDomainDataAccess,
EntityPersister persister, EntityPersister persister,
@ -141,7 +141,7 @@ public final class EmptyEventManager implements EventManager {
@Override @Override
public void completeCachePutEvent( public void completeCachePutEvent(
HibernateEvent cachePutEvent, HibernateMonitoringEvent cachePutEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
CachedDomainDataAccess cachedDomainDataAccess, CachedDomainDataAccess cachedDomainDataAccess,
CollectionPersister persister, CollectionPersister persister,
@ -151,13 +151,13 @@ public final class EmptyEventManager implements EventManager {
} }
@Override @Override
public HibernateEvent beginCacheGetEvent() { public HibernateMonitoringEvent beginCacheGetEvent() {
return null; return null;
} }
@Override @Override
public void completeCacheGetEvent( public void completeCacheGetEvent(
HibernateEvent cacheGetEvent, HibernateMonitoringEvent cacheGetEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
boolean hit) { boolean hit) {
@ -166,7 +166,7 @@ public final class EmptyEventManager implements EventManager {
@Override @Override
public void completeCacheGetEvent( public void completeCacheGetEvent(
HibernateEvent cacheGetEvent, HibernateMonitoringEvent cacheGetEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
EntityPersister persister, EntityPersister persister,
@ -177,7 +177,7 @@ public final class EmptyEventManager implements EventManager {
@Override @Override
public void completeCacheGetEvent( public void completeCacheGetEvent(
HibernateEvent cacheGetEvent, HibernateMonitoringEvent cacheGetEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
CollectionPersister persister, CollectionPersister persister,
@ -186,38 +186,38 @@ public final class EmptyEventManager implements EventManager {
} }
@Override @Override
public HibernateEvent beginFlushEvent() { public HibernateMonitoringEvent beginFlushEvent() {
return null; return null;
} }
@Override @Override
public void completeFlushEvent(HibernateEvent flushEvent, FlushEvent event) { public void completeFlushEvent(HibernateMonitoringEvent flushEvent, FlushEvent event) {
} }
@Override @Override
public void completeFlushEvent(HibernateEvent flushEvent, FlushEvent event, boolean autoFlush) { public void completeFlushEvent(HibernateMonitoringEvent flushEvent, FlushEvent event, boolean autoFlush) {
} }
@Override @Override
public HibernateEvent beginPartialFlushEvent() { public HibernateMonitoringEvent beginPartialFlushEvent() {
return null; return null;
} }
@Override @Override
public void completePartialFlushEvent(HibernateEvent flushEvent, AutoFlushEvent event) { public void completePartialFlushEvent(HibernateMonitoringEvent flushEvent, AutoFlushEvent event) {
} }
@Override @Override
public HibernateEvent beginDirtyCalculationEvent() { public HibernateMonitoringEvent beginDirtyCalculationEvent() {
return null; return null;
} }
@Override @Override
public void completeDirtyCalculationEvent( public void completeDirtyCalculationEvent(
HibernateEvent dirtyCalculationEvent, HibernateMonitoringEvent dirtyCalculationEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
EntityPersister persister, EntityPersister persister,
EntityEntry entry, EntityEntry entry,

View File

@ -17,62 +17,72 @@ import org.hibernate.service.JavaServiceLoadable;
@JavaServiceLoadable @JavaServiceLoadable
@Incubating @Incubating
/**
* Defines the contract for monitoring low-level events
* involving interactions between the {@link Session} and the database
* or second-level cache.
*
* <p>
* <em>This an incubating API, subject to change.</em>
*
*
*/
public interface EventManager { public interface EventManager {
HibernateEvent beginSessionOpenEvent(); HibernateMonitoringEvent beginSessionOpenEvent();
void completeSessionOpenEvent( void completeSessionOpenEvent(
HibernateEvent sessionOpenEvent, HibernateMonitoringEvent sessionOpenEvent,
SharedSessionContractImplementor session); SharedSessionContractImplementor session);
HibernateEvent beginSessionClosedEvent(); HibernateMonitoringEvent beginSessionClosedEvent();
void completeSessionClosedEvent( void completeSessionClosedEvent(
HibernateEvent sessionClosedEvent, HibernateMonitoringEvent sessionClosedEvent,
SharedSessionContractImplementor session); SharedSessionContractImplementor session);
HibernateEvent beginJdbcConnectionAcquisitionEvent(); HibernateMonitoringEvent beginJdbcConnectionAcquisitionEvent();
void completeJdbcConnectionAcquisitionEvent( void completeJdbcConnectionAcquisitionEvent(
HibernateEvent jdbcConnectionAcquisitionEvent, HibernateMonitoringEvent jdbcConnectionAcquisitionEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Object tenantId); Object tenantId);
HibernateEvent beginJdbcConnectionReleaseEvent(); HibernateMonitoringEvent beginJdbcConnectionReleaseEvent();
void completeJdbcConnectionReleaseEvent( void completeJdbcConnectionReleaseEvent(
HibernateEvent jdbcConnectionReleaseEvent, HibernateMonitoringEvent jdbcConnectionReleaseEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Object tenantId); Object tenantId);
HibernateEvent beginJdbcPreparedStatementCreationEvent(); HibernateMonitoringEvent beginJdbcPreparedStatementCreationEvent();
void completeJdbcPreparedStatementCreationEvent( void completeJdbcPreparedStatementCreationEvent(
HibernateEvent jdbcPreparedStatementCreation, HibernateMonitoringEvent jdbcPreparedStatementCreation,
String preparedStatementSql); String preparedStatementSql);
HibernateEvent beginJdbcPreparedStatementExecutionEvent(); HibernateMonitoringEvent beginJdbcPreparedStatementExecutionEvent();
void completeJdbcPreparedStatementExecutionEvent( void completeJdbcPreparedStatementExecutionEvent(
HibernateEvent jdbcPreparedStatementExecutionEvent, HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent,
String preparedStatementSql); String preparedStatementSql);
HibernateEvent beginJdbcBatchExecutionEvent(); HibernateMonitoringEvent beginJdbcBatchExecutionEvent();
void completeJdbcBatchExecutionEvent( void completeJdbcBatchExecutionEvent(
HibernateEvent jdbcBatchExecutionEvent, HibernateMonitoringEvent jdbcBatchExecutionEvent,
String statementSql); String statementSql);
HibernateEvent beginCachePutEvent(); HibernateMonitoringEvent beginCachePutEvent();
void completeCachePutEvent( void completeCachePutEvent(
HibernateEvent cachePutEvent, HibernateMonitoringEvent cachePutEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
boolean cacheContentChanged, boolean cacheContentChanged,
CacheActionDescription description); CacheActionDescription description);
void completeCachePutEvent( void completeCachePutEvent(
HibernateEvent cachePutEvent, HibernateMonitoringEvent cachePutEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
CachedDomainDataAccess cachedDomainDataAccess, CachedDomainDataAccess cachedDomainDataAccess,
EntityPersister persister, EntityPersister persister,
@ -80,7 +90,7 @@ public interface EventManager {
CacheActionDescription description); CacheActionDescription description);
void completeCachePutEvent( void completeCachePutEvent(
HibernateEvent cachePutEvent, HibernateMonitoringEvent cachePutEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
CachedDomainDataAccess cachedDomainDataAccess, CachedDomainDataAccess cachedDomainDataAccess,
EntityPersister persister, EntityPersister persister,
@ -89,23 +99,23 @@ public interface EventManager {
CacheActionDescription description); CacheActionDescription description);
void completeCachePutEvent( void completeCachePutEvent(
HibernateEvent cachePutEvent, HibernateMonitoringEvent cachePutEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
CachedDomainDataAccess cachedDomainDataAccess, CachedDomainDataAccess cachedDomainDataAccess,
CollectionPersister persister, CollectionPersister persister,
boolean cacheContentChanged, boolean cacheContentChanged,
CacheActionDescription description); CacheActionDescription description);
HibernateEvent beginCacheGetEvent(); HibernateMonitoringEvent beginCacheGetEvent();
void completeCacheGetEvent( void completeCacheGetEvent(
HibernateEvent cacheGetEvent, HibernateMonitoringEvent cacheGetEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
boolean hit); boolean hit);
void completeCacheGetEvent( void completeCacheGetEvent(
HibernateEvent cacheGetEvent, HibernateMonitoringEvent cacheGetEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
EntityPersister persister, EntityPersister persister,
@ -113,33 +123,33 @@ public interface EventManager {
boolean hit); boolean hit);
void completeCacheGetEvent( void completeCacheGetEvent(
HibernateEvent cacheGetEvent, HibernateMonitoringEvent cacheGetEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
CollectionPersister persister, CollectionPersister persister,
boolean hit); boolean hit);
HibernateEvent beginFlushEvent(); HibernateMonitoringEvent beginFlushEvent();
void completeFlushEvent( void completeFlushEvent(
HibernateEvent flushEvent, HibernateMonitoringEvent flushEvent,
org.hibernate.event.spi.FlushEvent event); org.hibernate.event.spi.FlushEvent event);
void completeFlushEvent( void completeFlushEvent(
HibernateEvent flushEvent, HibernateMonitoringEvent flushEvent,
org.hibernate.event.spi.FlushEvent event, org.hibernate.event.spi.FlushEvent event,
boolean autoFlush); boolean autoFlush);
HibernateEvent beginPartialFlushEvent(); HibernateMonitoringEvent beginPartialFlushEvent();
void completePartialFlushEvent( void completePartialFlushEvent(
HibernateEvent flushEvent, HibernateMonitoringEvent flushEvent,
AutoFlushEvent event); AutoFlushEvent event);
HibernateEvent beginDirtyCalculationEvent(); HibernateMonitoringEvent beginDirtyCalculationEvent();
void completeDirtyCalculationEvent( void completeDirtyCalculationEvent(
HibernateEvent dirtyCalculationEvent, HibernateMonitoringEvent dirtyCalculationEvent,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
EntityPersister persister, EntityPersister persister,
EntityEntry entry, EntityEntry entry,

View File

@ -9,5 +9,5 @@ package org.hibernate.event.spi;
import org.hibernate.Incubating; import org.hibernate.Incubating;
@Incubating @Incubating
public interface HibernateEvent { public interface HibernateMonitoringEvent {
} }

View File

@ -35,7 +35,7 @@ import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
import org.hibernate.engine.spi.SessionEventListenerManager; import org.hibernate.engine.spi.SessionEventListenerManager;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.id.ExportableColumn; import org.hibernate.id.ExportableColumn;
import org.hibernate.id.IdentifierGeneratorHelper; import org.hibernate.id.IdentifierGeneratorHelper;
import org.hibernate.id.IntegralDataTypeHolder; import org.hibernate.id.IntegralDataTypeHolder;
@ -669,7 +669,7 @@ public class TableGenerator implements PersistentIdentifierGenerator {
SharedSessionContractImplementor session) throws SQLException { SharedSessionContractImplementor session) throws SQLException {
logger.logStatement( sql, FormatStyle.BASIC.getFormatter() ); logger.logStatement( sql, FormatStyle.BASIC.getFormatter() );
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcPreparedStatementCreation = eventManager.beginJdbcPreparedStatementCreationEvent(); final HibernateMonitoringEvent jdbcPreparedStatementCreation = eventManager.beginJdbcPreparedStatementCreationEvent();
try { try {
listener.jdbcPrepareStatementStart(); listener.jdbcPrepareStatementStart();
return connection.prepareStatement( sql ); return connection.prepareStatement( sql );
@ -686,7 +686,7 @@ public class TableGenerator implements PersistentIdentifierGenerator {
String sql, String sql,
SharedSessionContractImplementor session) throws SQLException { SharedSessionContractImplementor session) throws SQLException {
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
listener.jdbcExecuteStatementStart(); listener.jdbcExecuteStatementStart();
return ps.executeUpdate(); return ps.executeUpdate();
@ -703,7 +703,7 @@ public class TableGenerator implements PersistentIdentifierGenerator {
String sql, String sql,
SharedSessionContractImplementor session) throws SQLException { SharedSessionContractImplementor session) throws SQLException {
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
listener.jdbcExecuteStatementStart(); listener.jdbcExecuteStatementStart();
return ps.executeQuery(); return ps.executeQuery();

View File

@ -27,7 +27,7 @@ import org.hibernate.engine.jdbc.spi.SqlStatementLogger;
import org.hibernate.engine.spi.SessionEventListenerManager; import org.hibernate.engine.spi.SessionEventListenerManager;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.id.ExportableColumn; import org.hibernate.id.ExportableColumn;
import org.hibernate.id.IdentifierGenerationException; import org.hibernate.id.IdentifierGenerationException;
import org.hibernate.id.IdentifierGeneratorHelper; import org.hibernate.id.IdentifierGeneratorHelper;
@ -209,7 +209,7 @@ public class TableStructure implements DatabaseStructure {
SharedSessionContractImplementor session) throws SQLException { SharedSessionContractImplementor session) throws SQLException {
statementLogger.logStatement( sql, FormatStyle.BASIC.getFormatter() ); statementLogger.logStatement( sql, FormatStyle.BASIC.getFormatter() );
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcPreparedStatementCreation = eventManager.beginJdbcPreparedStatementCreationEvent(); final HibernateMonitoringEvent jdbcPreparedStatementCreation = eventManager.beginJdbcPreparedStatementCreationEvent();
try { try {
statsCollector.jdbcPrepareStatementStart(); statsCollector.jdbcPrepareStatementStart();
return connection.prepareStatement( sql ); return connection.prepareStatement( sql );
@ -226,7 +226,7 @@ public class TableStructure implements DatabaseStructure {
String sql, String sql,
SharedSessionContractImplementor session) throws SQLException { SharedSessionContractImplementor session) throws SQLException {
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
statsCollector.jdbcExecuteStatementStart(); statsCollector.jdbcExecuteStatementStart();
return ps.executeUpdate(); return ps.executeUpdate();
@ -244,7 +244,7 @@ public class TableStructure implements DatabaseStructure {
String sql, String sql,
SharedSessionContractImplementor session) throws SQLException { SharedSessionContractImplementor session) throws SQLException {
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
statsCollector.jdbcExecuteStatementStart(); statsCollector.jdbcExecuteStatementStart();
return ps.executeQuery(); return ps.executeQuery();

View File

@ -16,7 +16,7 @@ import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess;
import org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider; import org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
@ -46,7 +46,7 @@ public class ContextualJdbcConnectionAccess implements JdbcConnectionAccess, Ser
} }
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcConnectionAcquisitionEvent = eventManager.beginJdbcConnectionAcquisitionEvent(); final HibernateMonitoringEvent jdbcConnectionAcquisitionEvent = eventManager.beginJdbcConnectionAcquisitionEvent();
try { try {
listener.jdbcConnectionAcquisitionStart(); listener.jdbcConnectionAcquisitionStart();
return connectionProvider.getConnection( tenantIdentifier ); return connectionProvider.getConnection( tenantIdentifier );
@ -68,7 +68,7 @@ public class ContextualJdbcConnectionAccess implements JdbcConnectionAccess, Ser
} }
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcConnectionReleaseEvent = eventManager.beginJdbcConnectionReleaseEvent(); final HibernateMonitoringEvent jdbcConnectionReleaseEvent = eventManager.beginJdbcConnectionReleaseEvent();
try { try {
listener.jdbcConnectionReleaseStart(); listener.jdbcConnectionReleaseStart();
connectionProvider.releaseConnection( tenantIdentifier, connection ); connectionProvider.releaseConnection( tenantIdentifier, connection );

View File

@ -16,7 +16,7 @@ import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;
import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess; import org.hibernate.engine.jdbc.connections.spi.JdbcConnectionAccess;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
@ -40,7 +40,7 @@ public class NonContextualJdbcConnectionAccess implements JdbcConnectionAccess,
@Override @Override
public Connection obtainConnection() throws SQLException { public Connection obtainConnection() throws SQLException {
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcConnectionAcquisitionEvent = eventManager.beginJdbcConnectionAcquisitionEvent(); final HibernateMonitoringEvent jdbcConnectionAcquisitionEvent = eventManager.beginJdbcConnectionAcquisitionEvent();
try { try {
listener.jdbcConnectionAcquisitionStart(); listener.jdbcConnectionAcquisitionStart();
return connectionProvider.getConnection(); return connectionProvider.getConnection();
@ -58,7 +58,7 @@ public class NonContextualJdbcConnectionAccess implements JdbcConnectionAccess,
@Override @Override
public void releaseConnection(Connection connection) throws SQLException { public void releaseConnection(Connection connection) throws SQLException {
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcConnectionReleaseEvent = eventManager.beginJdbcConnectionReleaseEvent(); final HibernateMonitoringEvent jdbcConnectionReleaseEvent = eventManager.beginJdbcConnectionReleaseEvent();
try { try {
listener.jdbcConnectionReleaseStart(); listener.jdbcConnectionReleaseStart();
connectionProvider.closeConnection( connection ); connectionProvider.closeConnection( connection );

View File

@ -69,7 +69,7 @@ import org.hibernate.engine.spi.Status;
import org.hibernate.engine.transaction.spi.TransactionImplementor; import org.hibernate.engine.transaction.spi.TransactionImplementor;
import org.hibernate.engine.transaction.spi.TransactionObserver; import org.hibernate.engine.transaction.spi.TransactionObserver;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.event.spi.AutoFlushEvent; import org.hibernate.event.spi.AutoFlushEvent;
import org.hibernate.event.spi.AutoFlushEventListener; import org.hibernate.event.spi.AutoFlushEventListener;
import org.hibernate.event.spi.ClearEvent; import org.hibernate.event.spi.ClearEvent;
@ -227,7 +227,7 @@ public class SessionImpl
public SessionImpl(SessionFactoryImpl factory, SessionCreationOptions options) { public SessionImpl(SessionFactoryImpl factory, SessionCreationOptions options) {
super( factory, options ); super( factory, options );
final HibernateEvent sessionOpenEvent = getEventManager().beginSessionOpenEvent(); final HibernateMonitoringEvent sessionOpenEvent = getEventManager().beginSessionOpenEvent();
persistenceContext = createPersistenceContext(); persistenceContext = createPersistenceContext();
actionQueue = createActionQueue(); actionQueue = createActionQueue();
@ -417,7 +417,7 @@ public class SessionImpl
} }
final EventManager eventManager = getEventManager(); final EventManager eventManager = getEventManager();
final HibernateEvent sessionClosedEvent = eventManager.beginSessionClosedEvent(); final HibernateMonitoringEvent sessionClosedEvent = eventManager.beginSessionClosedEvent();
// todo : we want this check if usage is JPA, but not native Hibernate usage // todo : we want this check if usage is JPA, but not native Hibernate usage
final SessionFactoryImplementor sessionFactory = getSessionFactory(); final SessionFactoryImplementor sessionFactory = getSessionFactory();

View File

@ -14,7 +14,7 @@ import java.util.function.Function;
import org.hibernate.engine.jdbc.spi.JdbcServices; import org.hibernate.engine.jdbc.spi.JdbcServices;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.query.spi.QueryOptions; import org.hibernate.query.spi.QueryOptions;
import org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor; import org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor;
import org.hibernate.sql.exec.spi.ExecutionContext; import org.hibernate.sql.exec.spi.ExecutionContext;
@ -82,7 +82,7 @@ public class StandardJdbcMutationExecutor implements JdbcMutationExecutor {
session.getEventListenerManager().jdbcExecuteStatementStart(); session.getEventListenerManager().jdbcExecuteStatementStart();
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
int rows = preparedStatement.executeUpdate(); int rows = preparedStatement.executeUpdate();
expectationCheck.accept( rows, preparedStatement ); expectationCheck.accept( rows, preparedStatement );

View File

@ -29,7 +29,7 @@ import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.engine.spi.Status; import org.hibernate.engine.spi.Status;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.event.spi.PreLoadEvent; import org.hibernate.event.spi.PreLoadEvent;
import org.hibernate.event.spi.PreLoadEventListener; import org.hibernate.event.spi.PreLoadEventListener;
import org.hibernate.internal.util.StringHelper; import org.hibernate.internal.util.StringHelper;
@ -988,7 +988,7 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
if ( persistenceContext.wasInsertedDuringTransaction( concreteDescriptor, entityIdentifier) ) { if ( persistenceContext.wasInsertedDuringTransaction( concreteDescriptor, entityIdentifier) ) {
boolean update = false; boolean update = false;
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
try { try {
update = cacheAccess.update( update = cacheAccess.update(
session, session,
@ -1012,7 +1012,7 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
else { else {
final SessionEventListenerManager eventListenerManager = session.getEventListenerManager(); final SessionEventListenerManager eventListenerManager = session.getEventListenerManager();
boolean put = false; boolean put = false;
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
try { try {
eventListenerManager.cachePutStart(); eventListenerManager.cachePutStart();
put = cacheAccess.putFromLoad( put = cacheAccess.putFromLoad(

View File

@ -23,7 +23,7 @@ import org.hibernate.engine.spi.SessionEventListenerManager;
import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.CoreLogging; import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.metamodel.mapping.ModelPart; import org.hibernate.metamodel.mapping.ModelPart;
@ -289,7 +289,7 @@ public class ResultsHelper {
if ( isPutFromLoad ) { if ( isPutFromLoad ) {
final SessionEventListenerManager eventListenerManager = session.getEventListenerManager(); final SessionEventListenerManager eventListenerManager = session.getEventListenerManager();
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent cachePutEvent = eventManager.beginCachePutEvent(); final HibernateMonitoringEvent cachePutEvent = eventManager.beginCachePutEvent();
boolean put = false; boolean put = false;
try { try {
eventListenerManager.cachePutStart(); eventListenerManager.cachePutStart();

View File

@ -22,7 +22,7 @@ import org.hibernate.engine.spi.SessionEventListenerManager;
import org.hibernate.engine.spi.SessionFactoryImplementor; import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SharedSessionContractImplementor; import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.CoreLogging; import org.hibernate.internal.CoreLogging;
import org.hibernate.internal.CoreMessageLogger; import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.query.spi.Limit; import org.hibernate.query.spi.Limit;
@ -240,7 +240,7 @@ public class DeferredResultSetAccess extends AbstractResultSetAccess {
executeStartNanos = System.nanoTime(); executeStartNanos = System.nanoTime();
} }
final EventManager eventManager = session.getEventManager(); final EventManager eventManager = session.getEventManager();
final HibernateEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent(); final HibernateMonitoringEvent jdbcPreparedStatementExecutionEvent = eventManager.beginJdbcPreparedStatementExecutionEvent();
try { try {
eventListenerManager.jdbcExecuteStatementStart(); eventListenerManager.jdbcExecuteStatementStart();
resultSet = wrapResultSet( preparedStatement.executeQuery() ); resultSet = wrapResultSet( preparedStatement.executeQuery() );

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -22,7 +22,7 @@ import jdk.jfr.StackTrace;
@Description( "Cache Get Executed" ) @Description( "Cache Get Executed" )
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class CacheGetEvent extends Event implements HibernateEvent { public class CacheGetEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.CacheGet"; public static final String NAME = "org.hibernate.orm.CacheGet";
@Label( "Session Identifier" ) @Label( "Session Identifier" )

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -22,7 +22,7 @@ import jdk.jfr.StackTrace;
@Description( "Cache Put Executed" ) @Description( "Cache Put Executed" )
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class CachePutEvent extends Event implements HibernateEvent { public class CachePutEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.CachePut"; public static final String NAME = "org.hibernate.orm.CachePut";
@Label( "Session Identifier" ) @Label( "Session Identifier" )

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -22,7 +22,7 @@ import jdk.jfr.StackTrace;
@Description("DirtyCalculationEvent Execution") @Description("DirtyCalculationEvent Execution")
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class DirtyCalculationEvent extends Event implements HibernateEvent { public class DirtyCalculationEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.DirtyCalculationEvent"; public static final String NAME = "org.hibernate.orm.DirtyCalculationEvent";
@Label("Session Identifier") @Label("Session Identifier")

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -22,7 +22,7 @@ import jdk.jfr.StackTrace;
@Description("Flush Execution") @Description("Flush Execution")
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class FlushEvent extends Event implements HibernateEvent { public class FlushEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.FlushEvent"; public static final String NAME = "org.hibernate.orm.FlushEvent";
@Label("Session Identifier") @Label("Session Identifier")

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -22,7 +22,7 @@ import jdk.jfr.StackTrace;
@Description("JDBC Batch Execution") @Description("JDBC Batch Execution")
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class JdbcBatchExecutionEvent extends Event implements HibernateEvent { public class JdbcBatchExecutionEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.JdbcBatchExecution"; public static final String NAME = "org.hibernate.orm.JdbcBatchExecution";
@Label("PreparedStatement SQL") @Label("PreparedStatement SQL")

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -22,7 +22,7 @@ import jdk.jfr.StackTrace;
@Description("JDBC Connection Obtained") @Description("JDBC Connection Obtained")
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class JdbcConnectionAcquisitionEvent extends Event implements HibernateEvent { public class JdbcConnectionAcquisitionEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.JdbcConnectionAcquisition"; public static final String NAME = "org.hibernate.orm.JdbcConnectionAcquisition";
@Label("Session Identifier") @Label("Session Identifier")

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -22,7 +22,7 @@ import jdk.jfr.StackTrace;
@Description("JDBC Connection Released") @Description("JDBC Connection Released")
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class JdbcConnectionReleaseEvent extends Event implements HibernateEvent { public class JdbcConnectionReleaseEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.JdbcConnectionRelease"; public static final String NAME = "org.hibernate.orm.JdbcConnectionRelease";
@Label("Session Identifier") @Label("Session Identifier")

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -22,7 +22,7 @@ import jdk.jfr.StackTrace;
@Description("JDBC PreparedStatement Created") @Description("JDBC PreparedStatement Created")
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class JdbcPreparedStatementCreationEvent extends Event implements HibernateEvent { public class JdbcPreparedStatementCreationEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.JdbcPreparedStatementCreation"; public static final String NAME = "org.hibernate.orm.JdbcPreparedStatementCreation";
@Label("PreparedStatement SQL") @Label("PreparedStatement SQL")

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -22,7 +22,7 @@ import jdk.jfr.StackTrace;
@Description( "JDBC PreparedStatement Executed" ) @Description( "JDBC PreparedStatement Executed" )
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class JdbcPreparedStatementExecutionEvent extends Event implements HibernateEvent { public class JdbcPreparedStatementExecutionEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.JdbcPreparedStatementExecution"; public static final String NAME = "org.hibernate.orm.JdbcPreparedStatementExecution";
@Label( "PreparedStatement SQL" ) @Label( "PreparedStatement SQL" )

View File

@ -13,7 +13,7 @@ import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.event.spi.AutoFlushEvent; import org.hibernate.event.spi.AutoFlushEvent;
import org.hibernate.event.spi.EventManager; import org.hibernate.event.spi.EventManager;
import org.hibernate.event.spi.EventSource; import org.hibernate.event.spi.EventSource;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import org.hibernate.persister.collection.CollectionPersister; import org.hibernate.persister.collection.CollectionPersister;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
@ -58,7 +58,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeSessionOpenEvent( public void completeSessionOpenEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
if ( event != null ) { if ( event != null ) {
final SessionOpenEvent sessionOpenEvent = (SessionOpenEvent) event; final SessionOpenEvent sessionOpenEvent = (SessionOpenEvent) event;
@ -84,7 +84,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeSessionClosedEvent( public void completeSessionClosedEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session) { SharedSessionContractImplementor session) {
if ( event != null ) { if ( event != null ) {
final SessionClosedEvent sessionClosedEvent = (SessionClosedEvent) event; final SessionClosedEvent sessionClosedEvent = (SessionClosedEvent) event;
@ -111,7 +111,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeJdbcConnectionAcquisitionEvent( public void completeJdbcConnectionAcquisitionEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Object tenantId) { Object tenantId) {
if ( event != null ) { if ( event != null ) {
@ -143,7 +143,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeJdbcConnectionReleaseEvent( public void completeJdbcConnectionReleaseEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Object tenantId) { Object tenantId) {
if ( event != null ) { if ( event != null ) {
@ -175,7 +175,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeJdbcPreparedStatementCreationEvent( public void completeJdbcPreparedStatementCreationEvent(
HibernateEvent event, HibernateMonitoringEvent event,
String preparedStatementSql) { String preparedStatementSql) {
if ( event != null ) { if ( event != null ) {
final JdbcPreparedStatementCreationEvent jdbcPreparedStatementCreation = (JdbcPreparedStatementCreationEvent) event; final JdbcPreparedStatementCreationEvent jdbcPreparedStatementCreation = (JdbcPreparedStatementCreationEvent) event;
@ -203,7 +203,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeJdbcPreparedStatementExecutionEvent( public void completeJdbcPreparedStatementExecutionEvent(
HibernateEvent event, HibernateMonitoringEvent event,
String preparedStatementSql) { String preparedStatementSql) {
if ( event != null ) { if ( event != null ) {
final JdbcPreparedStatementExecutionEvent jdbcPreparedStatementExecutionEvent = (JdbcPreparedStatementExecutionEvent) event; final JdbcPreparedStatementExecutionEvent jdbcPreparedStatementExecutionEvent = (JdbcPreparedStatementExecutionEvent) event;
@ -232,7 +232,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeJdbcBatchExecutionEvent( public void completeJdbcBatchExecutionEvent(
HibernateEvent event, HibernateMonitoringEvent event,
String statementSql) { String statementSql) {
if ( event != null ) { if ( event != null ) {
final JdbcBatchExecutionEvent jdbcBatchExecutionEvent = (JdbcBatchExecutionEvent) event; final JdbcBatchExecutionEvent jdbcBatchExecutionEvent = (JdbcBatchExecutionEvent) event;
@ -246,7 +246,7 @@ public class JfrEventManager implements EventManager {
} }
@Override @Override
public HibernateEvent beginCachePutEvent() { public HibernateMonitoringEvent beginCachePutEvent() {
if ( cachePutEventType.isEnabled() ) { if ( cachePutEventType.isEnabled() ) {
final CachePutEvent cachePutEvent = new CachePutEvent(); final CachePutEvent cachePutEvent = new CachePutEvent();
cachePutEvent.begin(); cachePutEvent.begin();
@ -260,7 +260,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeCachePutEvent( public void completeCachePutEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
boolean cacheContentChanged, boolean cacheContentChanged,
@ -281,7 +281,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeCachePutEvent( public void completeCachePutEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
CachedDomainDataAccess cachedDomainDataAccess, CachedDomainDataAccess cachedDomainDataAccess,
EntityPersister persister, EntityPersister persister,
@ -300,7 +300,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeCachePutEvent( public void completeCachePutEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
CachedDomainDataAccess cachedDomainDataAccess, CachedDomainDataAccess cachedDomainDataAccess,
EntityPersister persister, EntityPersister persister,
@ -325,7 +325,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeCachePutEvent( public void completeCachePutEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
CachedDomainDataAccess cachedDomainDataAccess, CachedDomainDataAccess cachedDomainDataAccess,
CollectionPersister persister, CollectionPersister persister,
@ -347,7 +347,7 @@ public class JfrEventManager implements EventManager {
} }
@Override @Override
public HibernateEvent beginCacheGetEvent() { public HibernateMonitoringEvent beginCacheGetEvent() {
if ( cacheGetEventType.isEnabled() ) { if ( cacheGetEventType.isEnabled() ) {
final CacheGetEvent cacheGetEvent = new CacheGetEvent(); final CacheGetEvent cacheGetEvent = new CacheGetEvent();
cacheGetEvent.begin(); cacheGetEvent.begin();
@ -361,7 +361,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeCacheGetEvent( public void completeCacheGetEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
boolean hit) { boolean hit) {
@ -380,7 +380,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeCacheGetEvent( public void completeCacheGetEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
EntityPersister persister, EntityPersister persister,
@ -403,7 +403,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeCacheGetEvent( public void completeCacheGetEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
Region region, Region region,
CollectionPersister persister, CollectionPersister persister,
@ -437,18 +437,18 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeFlushEvent( public void completeFlushEvent(
HibernateEvent flushEvent, HibernateMonitoringEvent flushEvent,
org.hibernate.event.spi.FlushEvent event) { org.hibernate.event.spi.FlushEvent event) {
completeFlushEvent( flushEvent, event, false ); completeFlushEvent( flushEvent, event, false );
} }
@Override @Override
public void completeFlushEvent( public void completeFlushEvent(
HibernateEvent hibernateEvent, HibernateMonitoringEvent hibernateMonitoringEvent,
org.hibernate.event.spi.FlushEvent event, org.hibernate.event.spi.FlushEvent event,
boolean autoFlush) { boolean autoFlush) {
if ( hibernateEvent != null ) { if ( hibernateMonitoringEvent != null ) {
final FlushEvent flushEvent = (FlushEvent) hibernateEvent; final FlushEvent flushEvent = (FlushEvent) hibernateMonitoringEvent;
flushEvent.end(); flushEvent.end();
if ( flushEvent.shouldCommit() ) { if ( flushEvent.shouldCommit() ) {
flushEvent.executionTime = getExecutionTime( flushEvent.startedAt ); flushEvent.executionTime = getExecutionTime( flushEvent.startedAt );
@ -477,10 +477,10 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completePartialFlushEvent( public void completePartialFlushEvent(
HibernateEvent hibernateEvent, HibernateMonitoringEvent hibernateMonitoringEvent,
AutoFlushEvent event) { AutoFlushEvent event) {
if ( event != null ) { if ( event != null ) {
final PartialFlushEvent flushEvent = (PartialFlushEvent) hibernateEvent; final PartialFlushEvent flushEvent = (PartialFlushEvent) hibernateMonitoringEvent;
flushEvent.end(); flushEvent.end();
if ( flushEvent.shouldCommit() ) { if ( flushEvent.shouldCommit() ) {
flushEvent.executionTime = getExecutionTime( flushEvent.startedAt ); flushEvent.executionTime = getExecutionTime( flushEvent.startedAt );
@ -509,7 +509,7 @@ public class JfrEventManager implements EventManager {
@Override @Override
public void completeDirtyCalculationEvent( public void completeDirtyCalculationEvent(
HibernateEvent event, HibernateMonitoringEvent event,
SharedSessionContractImplementor session, SharedSessionContractImplementor session,
EntityPersister persister, EntityPersister persister,
EntityEntry entry, EntityEntry entry,

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -22,7 +22,7 @@ import jdk.jfr.StackTrace;
@Description( "PartialFlushEvent Execution" ) @Description( "PartialFlushEvent Execution" )
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class PartialFlushEvent extends Event implements HibernateEvent { public class PartialFlushEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.PartialFlushEvent"; public static final String NAME = "org.hibernate.orm.PartialFlushEvent";
@Label( "Session Identifier" ) @Label( "Session Identifier" )

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -25,7 +25,7 @@ import jdk.jfr.StackTrace;
@Description("Hibernate Session closed") @Description("Hibernate Session closed")
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class SessionClosedEvent extends Event implements HibernateEvent { public class SessionClosedEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.SessionClosed"; public static final String NAME = "org.hibernate.orm.SessionClosed";
@Label("Session Identifier" ) @Label("Session Identifier" )

View File

@ -6,7 +6,7 @@
*/ */
package org.hibernate.event.jfr.internal; package org.hibernate.event.jfr.internal;
import org.hibernate.event.spi.HibernateEvent; import org.hibernate.event.spi.HibernateMonitoringEvent;
import org.hibernate.internal.build.AllowNonPortable; import org.hibernate.internal.build.AllowNonPortable;
import jdk.jfr.Category; import jdk.jfr.Category;
@ -25,7 +25,7 @@ import jdk.jfr.StackTrace;
@Description("Hibernate Session opened") @Description("Hibernate Session opened")
@StackTrace(false) @StackTrace(false)
@AllowNonPortable @AllowNonPortable
public class SessionOpenEvent extends Event implements HibernateEvent { public class SessionOpenEvent extends Event implements HibernateMonitoringEvent {
public static final String NAME = "org.hibernate.orm.SessionOpen"; public static final String NAME = "org.hibernate.orm.SessionOpen";
@Label("Session Identifier" ) @Label("Session Identifier" )