Java 类org.hibernate.SessionEventListener 实例源码

项目:lams    文件:BaselineSessionEventsListenerBuilder.java   
public List<SessionEventListener> buildBaselineList() {
    List<SessionEventListener> list = new ArrayList<SessionEventListener>();
    if ( logSessionMetrics && StatisticalLoggingSessionEventListener.isLoggingEnabled() ) {
        list.add( new StatisticalLoggingSessionEventListener() );
    }
    if ( autoListener != null ) {
        try {
            list.add( autoListener.newInstance() );
        }
        catch (Exception e) {
            throw new HibernateException(
                    "Unable to instantiate specified auto SessionEventListener : " + autoListener.getName(),
                    e
            );
        }
    }
    return list;
}
项目:lams    文件:SessionFactoryImpl.java   
@Override
public Session openSession() {
    log.tracef( "Opening Hibernate Session.  tenant=%s, owner=%s", tenantIdentifier, sessionOwner );
    final SessionImpl session = new SessionImpl(
            connection,
            sessionFactory,
            sessionOwner,
            getTransactionCoordinator(),
            getTransactionCompletionProcesses(),
            autoJoinTransactions,
            sessionFactory.settings.getRegionFactory().nextTimestamp(),
            interceptor,
            flushBeforeCompletion,
            autoClose,
            connectionReleaseMode,
            tenantIdentifier
    );

    for ( SessionEventListener listener : listeners ) {
        session.getEventListenerManager().addListener( listener );
    }

    return session;
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
public void addListener(SessionEventListener... listeners) {
    if ( listenerList == null ) {
        listenerList = new ArrayList<SessionEventListener>();
    }

    java.util.Collections.addAll( listenerList, listeners );
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void transactionCompletion(boolean successful) {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.transactionCompletion( successful );
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void jdbcConnectionAcquisitionStart() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.jdbcConnectionAcquisitionStart();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void jdbcConnectionAcquisitionEnd() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.jdbcConnectionAcquisitionEnd();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void jdbcConnectionReleaseStart() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.jdbcConnectionReleaseStart();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void jdbcConnectionReleaseEnd() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.jdbcConnectionReleaseEnd();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void jdbcPrepareStatementStart() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.jdbcPrepareStatementStart();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void jdbcPrepareStatementEnd() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.jdbcPrepareStatementEnd();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void jdbcExecuteStatementStart() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.jdbcExecuteStatementStart();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void jdbcExecuteStatementEnd() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.jdbcExecuteStatementEnd();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void jdbcExecuteBatchStart() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.jdbcExecuteBatchStart();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void jdbcExecuteBatchEnd() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.jdbcExecuteBatchEnd();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void cachePutStart() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.cachePutStart();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void cachePutEnd() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.cachePutEnd();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void cacheGetStart() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.cacheGetStart();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void cacheGetEnd(boolean hit) {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.cacheGetEnd( hit );
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void flushStart() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.flushStart();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void flushEnd(int numberOfEntities, int numberOfCollections) {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.flushEnd( numberOfEntities, numberOfCollections );
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void partialFlushStart() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.partialFlushStart();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void partialFlushEnd(int numberOfEntities, int numberOfCollections) {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.partialFlushEnd( numberOfEntities, numberOfCollections );
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void dirtyCalculationStart() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.dirtyCalculationStart();
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void dirtyCalculationEnd(boolean dirty) {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.dirtyCalculationEnd( dirty );
    }
}
项目:lams    文件:SessionEventListenerManagerImpl.java   
@Override
public void end() {
    if ( listenerList == null ) {
        return;
    }

    for ( SessionEventListener listener : listenerList ) {
        listener.end();
    }
}
项目:stdlib    文件:TransactionHelper.java   
void addAction(SessionEventListener... listeners) throws HibernateException
{
    final Session session = sessionProvider.get();

    if (session.getTransaction().getStatus() != TransactionStatus.ACTIVE)
        throw new IllegalStateException("Cannot add transaction action with no active transaction!");

    session.addEventListeners(listeners);
}
项目:lams    文件:BaselineSessionEventsListenerBuilder.java   
public BaselineSessionEventsListenerBuilder(
        boolean logSessionMetrics,
        Class<? extends SessionEventListener> autoListener) {
    this.logSessionMetrics = logSessionMetrics;
    this.autoListener = autoListener;
}
项目:lams    文件:BaselineSessionEventsListenerBuilder.java   
@SuppressWarnings("UnusedDeclaration")
public Class<? extends SessionEventListener> getAutoListener() {
    return autoListener;
}
项目:lams    文件:BaselineSessionEventsListenerBuilder.java   
@SuppressWarnings("UnusedDeclaration")
public void setAutoListener(Class<? extends SessionEventListener> autoListener) {
    this.autoListener = autoListener;
}
项目:lams    文件:SessionDelegatorBaseImpl.java   
@Override
public void addEventListeners(SessionEventListener... listeners) {
    session.addEventListeners( listeners );
}
项目:lams    文件:SessionImpl.java   
@Override
public void addEventListeners(SessionEventListener... listeners) {
    getEventListenerManager().addListener( listeners );
}
项目:lams    文件:SessionImpl.java   
@Override
public SharedSessionBuilder eventListeners(SessionEventListener... listeners) {
    super.eventListeners( listeners );
    return this;
}
项目:lams    文件:AbstractSessionImpl.java   
private NonContextualJdbcConnectionAccess(
        SessionEventListener listener,
        ConnectionProvider connectionProvider) {
    this.listener = listener;
    this.connectionProvider = connectionProvider;
}
项目:lams    文件:AbstractSessionImpl.java   
private ContextualJdbcConnectionAccess(
        SessionEventListener listener,
        MultiTenantConnectionProvider connectionProvider) {
    this.listener = listener;
    this.connectionProvider = connectionProvider;
}
项目:lams    文件:SessionFactoryImpl.java   
@Override
public SessionBuilder eventListeners(SessionEventListener... listeners) {
    Collections.addAll( this.listeners, listeners );
    return this;
}