クラス PortInUseException
java.lang.ObjectSE
java.lang.ThrowableSE
java.lang.ExceptionSE
java.lang.RuntimeExceptionSE
org.springframework.boot.web.server.WebServerException
org.springframework.boot.web.server.PortInUseException
- 実装されたすべてのインターフェース:
SerializableSE
PortInUseException
は、ポートがすでに使用されているために Web サーバーの起動に失敗した場合にスローされます。- 導入:
- 2.0.0
- 作成者:
- Andy Wilkinson, Phillip Webb
- 関連事項:
コンストラクターの概要
コンストラクターコンストラクター説明PortInUseException
(int port) 指定されたport
の新しい使用中ポートの例外を作成します。PortInUseException
(int port, ThrowableSE cause) 指定されたport
の新しい使用中ポートの例外を作成します。メソッドのサマリー
修飾子と型メソッド説明int
getPort()
使用されていたポートを返します。static <E extends ExceptionSE>
voidifCausedBy
(ExceptionSE ex, ClassSE<E> causedBy, ConsumerSE<E> action) 特定の例外が特定の例外型によって引き起こされた場合、アクションを実行します。static void
ifPortBindingException
(ExceptionSE ex, ConsumerSE<BindExceptionSE> action) 指定された例外が「使用中のポート」BindException
SE によって引き起こされた場合は、アクションを実行します。static void
指定された例外が「使用中のポート」BindException
SE によって引き起こされた場合は、PortInUseException
をスローします。クラス java.lang.ThrowableSE から継承されたメソッド
addSuppressedSE, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCauseSE, printStackTrace, printStackTraceSE, printStackTraceSE, setStackTraceSE, toString
コンストラクターの詳細
PortInUseException
public PortInUseException(int port) 指定されたport
の新しい使用中ポートの例外を作成します。- パラメーター:
port
- 使用されていたポート
PortInUseException
指定されたport
の新しい使用中ポートの例外を作成します。- パラメーター:
port
- 使用されていたポートcause
- 例外の原因
メソッドの詳細
getPort
public int getPort()使用されていたポートを返します。- 戻り値:
- 港
throwIfPortBindingException
指定された例外が「使用中のポート」BindException
SE によって引き起こされた場合は、PortInUseException
をスローします。- パラメーター:
ex
- ソース例外port
- ポートを提供するために使用されるサプラー- 導入:
- 2.2.7
ifPortBindingException
指定された例外が「使用中のポート」BindException
SE によって引き起こされた場合は、アクションを実行します。- パラメーター:
ex
- ソース例外action
- 実行するアクション- 導入:
- 2.2.7
ifCausedBy
public static <E extends ExceptionSE> void ifCausedBy(ExceptionSE ex, ClassSE<E> causedBy, ConsumerSE<E> action) 特定の例外が特定の例外型によって引き起こされた場合、アクションを実行します。- 型パラメーター:
E
- 原因例外型- パラメーター:
ex
- ソース例外causedBy
- 必要な原因型action
- 実行するアクション- 導入:
- 2.2.7