@Test public void testProvide() { PooledDataSourceFactory factory = new PooledDataSourceFactory(getSessionFactory()); PooledDataSource ds = factory.get(); assertNotNull(ds); assertTrue(ds instanceof PoolBackedDataSource); }
@Override public PooledDataSource get() { logger.trace("Extracting PooledDataSource from hibernate session " + "factory."); SessionFactoryServiceRegistryImpl src = (SessionFactoryServiceRegistryImpl) sessionFactory.getServiceRegistry(); ConnectionProvider cp = src.getService(ConnectionProvider.class); return cp.unwrap(PooledDataSource.class); }
PooledDataSourceFactory implements Supplier<PooledDataSource> { @Override public PooledDataSource get() { logger.trace("Extracting PooledDataSource from hibernate session " + "factory."); SessionFactoryServiceRegistryImpl src = (SessionFactoryServiceRegistryImpl) sessionFactory.getServiceRegistry(); ConnectionProvider cp = src.getService(ConnectionProvider.class); return cp.unwrap(PooledDataSource.class); } }
PooledDataSourceFactory implements Supplier<PooledDataSource> { @Override public PooledDataSource get() { logger.trace("Extracting PooledDataSource from hibernate session " + "factory."); SessionFactoryServiceRegistryImpl src = (SessionFactoryServiceRegistryImpl) sessionFactory.getServiceRegistry(); ConnectionProvider cp = src.getService(ConnectionProvider.class); return cp.unwrap(PooledDataSource.class); } @Inject  PooledDataSourceFactory(final SessionFactory sessionFactory); }
PooledDataSourceFactory implements Supplier<PooledDataSource> { @Override public PooledDataSource get() { logger.trace("Extracting PooledDataSource from hibernate session " + "factory."); SessionFactoryServiceRegistryImpl src = (SessionFactoryServiceRegistryImpl) sessionFactory.getServiceRegistry(); ConnectionProvider cp = src.getService(ConnectionProvider.class); return cp.unwrap(PooledDataSource.class); } @Inject  PooledDataSourceFactory(final SessionFactory sessionFactory); @Override PooledDataSource get(); }
PooledDataSourceFactory implements Supplier<PooledDataSource> { @Override public PooledDataSource get() { logger.trace("Extracting PooledDataSource from hibernate session " + "factory."); SessionFactoryServiceRegistryImpl src = (SessionFactoryServiceRegistryImpl) sessionFactory.getServiceRegistry(); ConnectionProvider cp = src.getService(ConnectionProvider.class); return cp.unwrap(PooledDataSource.class); } @Inject  PooledDataSourceFactory(final SessionFactory sessionFactory); @Override PooledDataSource get();  }