protected Channel borrowObject() throws Exception { Channel nettyChannel = (Channel) pool.borrowObject(); if (nettyChannel != null && nettyChannel.isAvailable()) { return nettyChannel; } invalidateObject(nettyChannel); String errorMsg = this.getClass().getSimpleName() + " borrowObject Error: url=" + url.getUri(); LoggerUtil.error(errorMsg); throw new MotanServiceException(errorMsg); }
public Object acquirePoolable() throws Exception { return this.pool.borrowObject(); }
if (transactional) { LOGGER.finest("Borrowing session from pool for transactional access"); connection = (Session) pool.borrowObject(); } else { synchronized (openSessionsNonTransactional) { + Thread.currentThread().getName()); connection = (Session) pool.borrowObject(); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer(
preload[i] = (ISession) pool.borrowObject(); if (i == 0) { SeRelease seRelease = preload[i].getRelease();
/** * Gives a Unbound LdapConnection fetched from the pool. * * @return an LdapConnection object from pool * @throws Exception if an error occurs while obtaining a connection from the factory */ public LdapConnection getConnection() throws Exception { return super.borrowObject(); }
/** * gives a LdapConnection fetched from the pool * * @return an LdapConnection object from pool * @throws Exception */ public LdapConnection getConnection() throws Exception { return ( LdapConnection ) super.borrowObject(); }
private Socket getSocket() throws Exception { return (Socket) _socketPool.borrowObject(); }
/** * @return object from the pool. */ public T getObject() { try { return objectPool.borrowObject(); } catch (final Exception e) { // should never happen throw new RuntimeException("Cannot get object from the pool", e); } }
private Integer borrowObject() { try { return _connectionPool.borrowObject(); } catch (final Exception e) { throw new IllegalStateException("Could not borrow pool object", e); } }
private Integer borrowObject() { try { return _connectionPool.borrowObject(); } catch (Exception e) { throw new IllegalStateException("Could not borrow pool object", e); } }
/** * @return object from the pool. */ public T getObject() { try { return objectPool.borrowObject(); } catch (final Exception e) { // should never happen throw new RuntimeException("Cannot get object from the pool", e); } }
public Parser get() { try { return (Parser) pool.borrowObject(); } catch (Exception e) { throw new RuntimeException("Error borrowing a parser from the pool", e); } }
@Override public Object makeObject() throws Exception { TargetChannel targetChannel = (TargetChannel) this.genericObjectPool.borrowObject(); log.debug("Created channel: {}", targetChannel); return targetChannel; }
protected TimerTaskHandle borrowTimerTaskHandle() { try { TimerTaskHandle timerTaskHandle = (TimerTaskHandle) pool.borrowObject(); return timerTaskHandle; } catch (Exception e) { logger.error("", e); } return null; }
/** * 从对象池获取一个可用对象 * * @return */ @SuppressWarnings("unchecked") public T getResource() { try { return (T) internalPool.borrowObject(); } catch (Exception e) { throw new PbrpcConnectionException("Could not get a resource from the pool", e); } }
public Object borrowObject() throws Exception { if (pool != null) { return pool.borrowObject(); } else { throw new InitialisationException( MessageFactory.createStaticMessage("Object pool has not been initialized."), this); } }
public Object borrowDirectDecompressor(){ Preconditions.checkArgument(supportDirectDecompressor, "Tried to get a direct Decompressor from a non-direct codec."); try { return directDecompressorPool.borrowObject(); } catch (Exception e) { throw new ParquetCompressionCodecException(e); } }
public JdbcCompiledQueryLease borrowLease() { if (logger.isDebugEnabled()) { logger.debug("Borrowing lease. Leases (before): Active={}, Idle={}", getActiveLeases(), getIdleLeases()); } try { return _pool.borrowObject(); } catch (Exception e) { throw handleError(e, "borrow lease"); } }
public Object borrowDirectDecompressor(){ Preconditions.checkArgument(supportDirectDecompressor, "Tried to get a direct Decompressor from a non-direct codec."); try { return directDecompressorPool.borrowObject(); } catch (Exception e) { throw new ParquetCompressionCodecException(e); } }
private EntitlementServiceStub getEntitlementStub(String serverUrl) throws Exception { if (configurationContext == null) { throw new EntitlementProxyException("Cannot initialize EntitlementServiceStub with null Axis2 " + "configuration context."); } if (serviceStubPool == null) { serviceStubPool = new GenericObjectPool(new EntitlementServiceStubFactory( configurationContext, serverUrl + ENTITLEMENT_SERVICE_NAME, authenticator)); } return (EntitlementServiceStub) serviceStubPool.borrowObject(); }