Package com.linecorp.armeria.client
Interface ConnectionPoolListener
- All Superinterfaces:
Unwrappable
- All Known Implementing Classes:
ConnectionPoolListenerAdapter
,ConnectionPoolListenerWrapper
public interface ConnectionPoolListener extends Unwrappable
Listens to the client connection pool events.
-
Method Summary
Modifier and Type Method Description void
connectionClosed(SessionProtocol protocol, InetSocketAddress remoteAddr, InetSocketAddress localAddr, AttributeMap attrs)
Invoked when a connection in the connection pool has been closed.void
connectionOpen(SessionProtocol protocol, InetSocketAddress remoteAddr, InetSocketAddress localAddr, AttributeMap attrs)
Invoked when a new connection is open and ready to send a request.static ConnectionPoolListener
logging()
Returns aConnectionPoolListener
that logs the connection pool events.static ConnectionPoolListener
logging(Ticker ticker)
Returns aConnectionPoolListener
that logs the connection pool events with an alternativeTicker
.static ConnectionPoolListener
noop()
Returns an instance that does nothing.default ConnectionPoolListener
unwrap()
Unwraps this object and returns the object being decorated.Methods inherited from interface com.linecorp.armeria.common.util.Unwrappable
as
-
Method Details
-
noop
Returns an instance that does nothing. -
logging
Returns aConnectionPoolListener
that logs the connection pool events. -
logging
Returns aConnectionPoolListener
that logs the connection pool events with an alternativeTicker
. -
connectionOpen
void connectionOpen(SessionProtocol protocol, InetSocketAddress remoteAddr, InetSocketAddress localAddr, AttributeMap attrs) throws ExceptionInvoked when a new connection is open and ready to send a request.- Throws:
Exception
-
connectionClosed
void connectionClosed(SessionProtocol protocol, InetSocketAddress remoteAddr, InetSocketAddress localAddr, AttributeMap attrs) throws ExceptionInvoked when a connection in the connection pool has been closed.- Throws:
Exception
-
unwrap
Description copied from interface:Unwrappable
Unwraps this object and returns the object being decorated. If thisUnwrappable
is the innermost object, this method returns itself. For example:class Foo implements Unwrappable {} class Bar<T extends Unwrappable> extends AbstractUnwrappable<T> { Bar(T delegate) { super(delegate); } } class Qux<T extends Unwrappable> extends AbstractUnwrappable<T> { Qux(T delegate) { super(delegate); } } Foo foo = new Foo(); assert foo.unwrap() == foo; Bar<Foo> bar = new Bar<>(foo); assert bar.unwrap() == foo; Qux<Bar<Foo>> qux = new Qux<>(bar); assert qux.unwrap() == bar; assert qux.unwrap().unwrap() == foo;
- Specified by:
unwrap
in interfaceUnwrappable
-