public abstract class Filter extends Object
チェーン内の各フィルタは、それぞれ独自の doFilter() 実装内で次のフィルタを呼び出します。チェーン内の最後のフィルタは、アプリケーション交換ハンドラを呼び出します。
修飾子と型 | クラスと説明 |
---|---|
static class |
Filter.Chain
HttpServer に関連付けられたフィルタのチェーンです。
|
修飾子 | コンストラクタと説明 |
---|---|
protected |
Filter() |
修飾子と型 | メソッドと説明 |
---|---|
abstract String |
description()
このフィルタの短い記述を返します。
|
abstract void |
doFilter(HttpExchange exchange, Filter.Chain chain)
このフィルタに対し、指定された交換の事前処理または事後処理を要求します。
|
public abstract void doFilter(HttpExchange exchange, Filter.Chain chain) throws IOException
HttpExchange.setStreams(InputStream,OutputStream)
を呼び出すことで、要求本体または応答本体にフィルタを適用するFilter.Chain.doFilter(HttpExchange)
を呼び出すことで、チェーン内の次のフィルタを呼び出すFilter.Chain.doFilter(HttpExchange)
を呼び出さないことで、呼び出しのチェーンを終了するexchange
- フィルタ処理される HttpExchange
。chain
- 次のフィルタで呼び出し可能なチェーン。IOException
- どのフィルタモジュールでもスローされる可能性があり、キャッチされた場合、再度スローする必要がある。NullPointerException
- 交換とチェーンのいずれかが null
の場合public abstract String description()
Copyright © 2005, 2013, Oracle and/or its affiliates. All rights reserved.