クラス ChannelBuilderOptions
java.lang.ObjectSE
org.springframework.grpc.client.ChannelBuilderOptions
GrpcChannelFactory がチャンネル構築時に使用するオプション。 ネイティブチャネルビルダー (例: shutdownGracePeriod) で利用できる機能を超える機能を提供し、ネイティブチャネルビルダーの動作 (例: interceptors) の一部をオーバーライドします。
- 作成者:
- Chris Bono
方法の概要
修飾子と型メソッド説明<T extends io.grpc.ManagedChannelBuilder<T>>
GrpcChannelBuilderCustomizer<T> チャンネルの作成に使用されたビルダーにカスタマイザーを適用します。static ChannelBuilderOptionsdefaults()デフォルト値が設定された、変更不可能な新しいオプションインスタンスを取得します。ListSE<io.grpc.ClientInterceptor> クライアントインターセプターをチャネルに適用します。boolean指定されたインターセプターをグローバルインターセプターとブレンドするかどうかを取得します。チャネルが正常にシャットダウンするまで待機する時間を確保します。<T extends io.grpc.ManagedChannelBuilder<T>>
ChannelBuilderOptionswithCustomizer(GrpcChannelBuilderCustomizer<T> customizer) チャンネル作成に使用したビルダーにカスタマイザーを適用するように設定します。withInterceptors(ListSE<io.grpc.ClientInterceptor> interceptors) クライアントインターセプターをチャネルに適用するように設定します。withInterceptorsMerge(boolean mergeWithGlobalInterceptors) 指定されたインターセプターをグローバルインターセプターとブレンドするかどうかを設定します。withShutdownGracePeriod(DurationSE shutdownGracePeriod) チャンネルが正常にシャットダウンするまでの待機時間を設定します。
方法の詳細
interceptors
クライアントインターセプターをチャネルに適用します。- 戻り値:
- チャネルに適用するクライアントインターセプター
mergeWithGlobalInterceptors
public boolean mergeWithGlobalInterceptors()指定されたインターセプターをグローバルインターセプターとブレンドするかどうかを取得します。- 戻り値:
- 提供されたインターセプターをグローバルインターセプターとブレンドするかどうか (デフォルトは false)
shutdownGracePeriod
チャネルが正常にシャットダウンするまで待機する時間を確保します。- 戻り値:
- チャンネルが正常にシャットダウンするまで待つ時間 (default of 30s)
customizer
チャンネルの作成に使用されたビルダーにカスタマイザーを適用します。- 型パラメーター:
T- カスタマイザーが動作するビルダーの種類- 戻り値:
- 適用するカスタマイザー (default of
GrpcChannelBuilderCustomizer.defaults())
defaults
デフォルト値が設定された、変更不可能な新しいオプションインスタンスを取得します。- 戻り値:
- a new immutable options instance populated with default values.
withInterceptors
クライアントインターセプターをチャネルに適用するように設定します。- パラメーター:
interceptors- list of client interceptors to apply to the channel or empty list to clear out any previously set interceptors- 戻り値:
- a new immutable options instance populated with the specified interceptors and the settings of this current options instance.
withInterceptorsMerge
指定されたインターセプターをグローバルインターセプターとブレンドするかどうかを設定します。- パラメーター:
mergeWithGlobalInterceptors- whether the provided interceptors should be- 戻り値:
- a new immutable options instance populated with the specified merge setting and the settings of this current options instance.
withShutdownGracePeriod
チャンネルが正常にシャットダウンするまでの待機時間を設定します。- パラメーター:
shutdownGracePeriod- チャンネルが正常にシャットダウンするまで待つ時間- 戻り値:
- a new immutable options instance populated with the specified
shutdownGracePeriodand the settings of this current options instance.
withCustomizer
public <T extends io.grpc.ManagedChannelBuilder<T>> ChannelBuilderOptions withCustomizer(GrpcChannelBuilderCustomizer<T> customizer) チャンネル作成に使用したビルダーにカスタマイザーを適用するように設定します。- 型パラメーター:
T- type of builder the customizer operates on- パラメーター:
customizer- the customizer to apply to the builder used to create the channel- 戻り値:
- a new immutable options instance populated with the specified
customizerand the settings of this current options instance.