@Override public Host getHost() { return pool.getHost(); }
@Override public String apply(HostConnectionPool<CL> host) { return host.getHost().getHostName(); } }), ","))
/** * @return {@link Host} */ final public Host getCurrentHost() { HostConnectionPool<CL> pool = getCurrentHostConnectionPool(); if (pool != null) return pool.getHost(); else return Host.NO_HOST; }
@Override public String apply(HostConnectionPool<CL> host) { return host.getHost().getHostName(); } }), ","))
@Override public String apply(HostConnectionPool<?> host) { return host.getHost().getName(); } }), ",");
@Override public String apply(HostConnectionPool<?> host) { return host.getHost().getName(); } }), ",");
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { if (counter.incrementAndGet() > new Random().nextInt(1000)) { counter.set(0); throw new TransportException("TransportException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { think(100); if (counter.incrementAndGet() > 10) { counter.set(0); throw new TransportException("TransportException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), think(5)); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), think(500)); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { think(100); if (counter.incrementAndGet() > 10) { counter.set(0); throw new TransportException("TransportException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), think(500)); }
@Override public Connection<CL> borrowConnection(Operation<CL, R> operation) throws ConnectionException { pool = null; connection = BagOfConnectionsConnectionPoolImpl.this.borrowConnection(operation); pool = connection.getHostConnectionPool(); return connection; }
@Override public <R> OperationResult<R> execute( HostConnectionPool<TestClient> pool, Operation<TestClient, R> op) throws ConnectionException { if (aborted) { aborted = false; throw new ConnectionAbortedException( "ConnectionAbortedException"); } return new OperationResultImpl<R>(pool.getHost(), op.execute(null, null), 0); }