public abstract static class ClientPool.ClientPoolImpl<C,E extends Exception> extends Object implements Closeable, ClientPool<C,E>
ClientPool
.ClientPool.Action<R,C,E extends Exception>, ClientPool.ClientPoolImpl<C,E extends Exception>, ClientPool.ExecuteAction<C,E extends Exception>
Constructor and Description |
---|
ClientPoolImpl(int poolSize,
Class<? extends E> reconnectExc,
boolean retryByDefault) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected abstract void |
close(C client) |
void |
execute(ClientPool.ExecuteAction<C,E> action) |
void |
execute(ClientPool.ExecuteAction<C,E> action,
boolean retry) |
boolean |
isClosed() |
protected boolean |
isConnectionException(Exception exc) |
protected abstract C |
newClient() |
int |
poolSize() |
protected abstract C |
reconnect(C client) |
<R> R |
run(ClientPool.Action<R,C,E> action) |
<R> R |
run(ClientPool.Action<R,C,E> action,
boolean retry) |
public <R> R run(ClientPool.Action<R,C,E> action) throws E extends Exception, InterruptedException
run
in interface ClientPool<C,E extends Exception>
E extends Exception
InterruptedException
public <R> R run(ClientPool.Action<R,C,E> action, boolean retry) throws E extends Exception, InterruptedException
run
in interface ClientPool<C,E extends Exception>
E extends Exception
InterruptedException
public void execute(ClientPool.ExecuteAction<C,E> action) throws E extends Exception, InterruptedException
execute
in interface ClientPool<C,E extends Exception>
E extends Exception
InterruptedException
public void execute(ClientPool.ExecuteAction<C,E> action, boolean retry) throws E extends Exception, InterruptedException
execute
in interface ClientPool<C,E extends Exception>
E extends Exception
InterruptedException
protected abstract C newClient()
protected boolean isConnectionException(Exception exc)
protected abstract void close(C client)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public int poolSize()
public boolean isClosed()
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.