/** * {@inheritDoc} */ public T borrowObject() throws Exception, NoSuchElementException, IllegalStateException { return pool.borrowObject(); }
/** * Borrow and object from the pool, ignoring the key * * @param key ignored * @return newly created object instance */ public V borrowObject(final K key) throws Exception, NoSuchElementException, IllegalStateException { return pool.borrowObject(); }
/** * {@inheritDoc} */ public T borrowObject() throws Exception, NoSuchElementException, IllegalStateException { synchronized (lock) { return pool.borrowObject(); } }
/** * Borrow an object from the pool, checking its type. * * @return a type-checked object from the pool * @throws ClassCastException if the object returned by the pool is not of the expected type */ public T borrowObject() throws Exception, NoSuchElementException, IllegalStateException { final T obj = pool.borrowObject(); if (type.isInstance(obj)) { return obj; } else { throw new ClassCastException("Borrowed object is not of type: " + type.getName() + " was: " + obj); } }
public String getBackingStoreDescription() throws FactoryException { AbstractCachedAuthorityFactory worker = null; try { worker = (AbstractCachedAuthorityFactory) getPool().borrowObject(); return worker.getBackingStoreDescription(); } catch (FactoryException e) { throw e; } catch (Exception e) { throw new FactoryException(e); } finally { try { getPool().returnObject(worker); } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to return worker " + e, e); } } } /**
/** * {@inheritDoc} */ public T borrowObject() throws Exception, NoSuchElementException, IllegalStateException { synchronized (lock) { return pool.borrowObject(); } }
public Object borrowObject() throws Exception, NoSuchElementException, IllegalStateException { synchronized (lock) { return pool.borrowObject(); } }
/** * {@inheritDoc} */ public T borrowObject() throws Exception, NoSuchElementException, IllegalStateException { return pool.borrowObject(); }
/** * {@inheritDoc} */ public T borrowObject() throws Exception, NoSuchElementException, IllegalStateException { return pool.borrowObject(); }
public FeaturesClient borrowObject() throws Exception, NoSuchElementException, IllegalStateException { return instance.borrowObject(); }
public AbstractSyslogWriter borrowSyslogWriter() throws Exception { AbstractSyslogWriter syslogWriter = (AbstractSyslogWriter) this.pool.borrowObject(); return syslogWriter; }
/** * Borrow an object from the <code>ObjectPool</code>. */ public Object getTarget() throws Exception { return this.pool.borrowObject(); }
/** * Borrow and object from the pool, ignoring the key * * @param key ignored * @return newly created object instance */ public V borrowObject(final K key) throws Exception, NoSuchElementException, IllegalStateException { return pool.borrowObject(); }
public Set getAuthorityCodes(Class type) throws FactoryException { Set codes = (Set) cache.get(type); if (codes == null) { try { cache.writeLock(type); codes = (Set) cache.peek(type); if (codes == null) { AbstractCachedAuthorityFactory worker = null; try { worker = (AbstractCachedAuthorityFactory) getPool().borrowObject(); codes = worker.getAuthorityCodes(type); cache.put(type, codes); } catch (FactoryException e) { throw e; } catch (Exception e) { throw new FactoryException(e); } finally { try { getPool().returnObject(worker); } catch (Exception e) { LOGGER.log(Level.WARNING, "Unable to return worker " + e, e); } } } } finally { cache.writeUnLock(type); } } return codes; }
AbstractCachedAuthorityFactory worker = null; try { worker = (AbstractCachedAuthorityFactory) getPool().borrowObject(); crs = worker.createCompoundCRS(code); cache.put(key, crs);
AbstractCachedAuthorityFactory worker = null; try { worker = (AbstractCachedAuthorityFactory) getPool().borrowObject(); obj = worker.createDerivedCRS(code); cache.put(key, obj);
AbstractCachedAuthorityFactory worker = null; try { worker = (AbstractCachedAuthorityFactory) getPool().borrowObject(); value = (T) runner.run(worker); } catch (FactoryException e) {
public Object borrowObject() throws Exception, NoSuchElementException, IllegalStateException { final Object obj = pool.borrowObject(); if (type.isInstance(obj)) { return obj; } else { throw new ClassCastException("Borrowed object is not of type: " + type.getName() + " was: " + obj); } }
AbstractCachedAuthorityFactory worker = null; try { worker = (AbstractCachedAuthorityFactory) getPool().borrowObject(); worker.cache = ObjectCaches.chain(ObjectCaches.create("weak", 3000), cache); worker.findCache = findCache;
private C borrowConnection() throws Exception { C connection = pool.borrowObject(); try { poolingListener.onBorrow(connection); } catch (Exception e) { pool.invalidateObject(connection); throw e; } return connection; }