Package io.grpc
Class ClientTransportFilter
java.lang.Object
io.grpc.ClientTransportFilter
@ExperimentalApi("https://gitub.com/grpc/grpc-java/issues/10652")
public abstract class ClientTransportFilter
extends Object
Listens on the client transport life-cycle events. These filters do not have the capability
to modify the channels or transport life-cycle event behavior, but they can be useful hooks
for transport observability. Multiple filters may be registered to the client.
- Since:
- 1.62.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiontransportReady
(Attributes transportAttrs) Called when a transport is ready to accept traffic (when a connection has been established).void
transportTerminated
(Attributes transportAttrs) Called when a transport completed shutting down.
-
Constructor Details
-
ClientTransportFilter
public ClientTransportFilter()
-
-
Method Details
-
transportReady
Called when a transport is ready to accept traffic (when a connection has been established). The default implementation is a no-op.- Parameters:
transportAttrs
- current transport attributes- Returns:
- new transport attributes. Default implementation returns the passed-in attributes intact.
-
transportTerminated
Called when a transport completed shutting down. All resources have been released. All streams have either been closed or transferred off this transport. Default implementation is a no-op- Parameters:
transportAttrs
- the effective transport attributes, which is what is returned bytransportReady(io.grpc.Attributes)
of the last executed filter.
-