Java 类org.hibernate.SessionFactoryObserver 实例源码

项目:openeos    文件:ObserverConfigurator.java   
@Override
public void init(ConfigurationProvider configurationProvider) {
    LOG.debug("Initializing observer configuration");
    tracker = new ServiceTracker<SessionFactoryObserver, SessionFactoryObserver>(bundleContext, SessionFactoryObserver.class,
            null);
    tracker.open();
    bundleContext.addBundleListener(new SynchronousBundleListener() {

        @Override
        public void bundleChanged(BundleEvent event) {
            if (event.getBundle().equals(bundleContext.getBundle()) && event.getType() == BundleEvent.STOPPING) {
                tracker.close();
                tracker = null;
            }
        }
    });
    configurationProvider.getConfiguration().setSessionFactoryObserver(this);
    configurationProvider.invalidate();
}
项目:lams    文件:SessionFactoryObserverChain.java   
@Override
public void sessionFactoryCreated(SessionFactory factory) {
    if ( observers == null ) {
        return;
    }

    for ( SessionFactoryObserver observer : observers ) {
        observer.sessionFactoryCreated( factory );
    }
}
项目:openeos    文件:ObserverConfigurator.java   
@Override
public void sessionFactoryCreated(SessionFactory factory) {
    LOG.debug("Session factory has been created, calling all SessionFactoryObserver services");
    for (SessionFactoryObserver observer : tracker.getTracked().values()) {
        observer.sessionFactoryCreated(factory);
    }
}
项目:openeos    文件:ObserverConfigurator.java   
@Override
public void sessionFactoryClosed(SessionFactory factory) {
    LOG.debug("Session factory has been closed, calling all SessionFactoryObserver services");
    for (SessionFactoryObserver observer : tracker.getTracked().values()) {
        observer.sessionFactoryClosed(factory);
    }

}
项目:openeos    文件:Activator.java   
private void registerObserverServices() {
    LOG.debug("Registering observer services");
    dialectPublisherObserver = new DialectPublisherObserver(context);
    listenerObserver = new ListenerObserver(context);
    listenerObserver.init();

    serviceRegistrationStack.push(context.registerService(SessionFactoryObserver.class, dialectPublisherObserver, null));
    LOG.debug("DialectPublisherObserver registered");
    serviceRegistrationStack.push(context.registerService(SessionFactoryObserver.class, listenerObserver, null));
    LOG.debug("ListenerObserver registered");
}
项目:lemon    文件:SessionFactoryWrapper.java   
public void addObserver(SessionFactoryObserver observer) {
    sessionFactoryImplementor.addObserver(observer);
}
项目:lams    文件:Configuration.java   
public SessionFactoryObserver getSessionFactoryObserver() {
    return sessionFactoryObserver;
}
项目:lams    文件:Configuration.java   
public void setSessionFactoryObserver(SessionFactoryObserver sessionFactoryObserver) {
    this.sessionFactoryObserver = sessionFactoryObserver;
}
项目:lams    文件:SessionFactoryObserverChain.java   
public void addObserver(SessionFactoryObserver observer) {
    if ( observers == null ) {
        observers = new ArrayList<SessionFactoryObserver>();
    }
    observers.add( observer );
}
项目:lams    文件:SessionFactoryImpl.java   
@Override
public void addObserver(SessionFactoryObserver observer) {
    this.observer.addObserver( observer );
}
项目:hibernate-dynamic-dialects    文件:SessionFactoryImpl.java   
@Override
public void addObserver(SessionFactoryObserver observer) {
    this.observer.addObserver(observer);
}
项目:lams    文件:SessionFactoryImplementor.java   
public void addObserver(SessionFactoryObserver observer);