java.lang.Object
jdk.jshell.execution.DirectExecutionControl
- すべての実装されたインタフェース:
AutoCloseable,ExecutionControl
- 直系の既知のサブクラス:
LocalExecutionControl,RemoteExecutionControl
public class DirectExecutionControl extends Object implements ExecutionControl
現在のプロセスで実行される
ExecutionControl実装。 Util.forwardExecutionControl(ExecutionControl, java.io.ObjectInput, java.io.ObjectOutput)を使用して直接、またはチャネルで使用できます。 - 導入されたバージョン:
- 9
-
ネストされたクラスのサマリー
インタフェース jdk.jshell.spi.ExecutionControlで宣言されたネストされたクラス/インタフェース
ExecutionControl.ClassBytecodes, ExecutionControl.ClassInstallException, ExecutionControl.EngineTerminationException, ExecutionControl.ExecutionControlException, ExecutionControl.InternalException, ExecutionControl.NotImplementedException, ExecutionControl.ResolutionException, ExecutionControl.RunException, ExecutionControl.StoppedException, ExecutionControl.UserException -
コンストラクタのサマリー
コンストラクタコンストラクタ説明デフォルトのクラス・ローディングを使用してインスタンスを作成します。DirectExecutionControl(LoaderDelegate loaderDelegate) 指定されたデリゲートにローダー操作を委譲するインスタンスを作成します。 -
メソッドのサマリー
修飾子と型メソッド説明voidaddToClasspath(String cp) 実行クラスパスにパスを追加します。protected voidクラスが再定義されたことを通知します。protected voidユーザー・コードへのエントリをマークします。protected voidユーザー・コードから出発します。voidclose()この実行エンジンをシャットダウンします。extensionCommand(String command, Object arg) 非標準コマンド(新しいバージョンの標準コマンド)を実行します。protected Class<?>指定されたバイナリ名を持つクラスを探します。protected Stringパラメータを指定しない静的メソッド"doit-method"を呼び出します。指定されたラッパー・クラスのメソッドを呼び出すことにより、実行可能スニペットを呼び出します。voidload(ExecutionControl.ClassBytecodes[] cbcs) 新しいクラスをロードしようとします。void以前にロードされたクラスを再定義しようとします。voidstop()実行中の呼び出しを中断します。protected Stringユーザー・コードの受信例外をExecutionControl.ExecutionControlExceptionのサブ型のインスタンスに変換し、変換された例外をスローします。protected Stringエージェント・コード内の受信例外をExecutionControl.ExecutionControlExceptionのサブ型のインスタンスに変換し、変換された例外をスローします。protected static StringvalueString(Object value) Objectの値をExecutionControl.invoke(String, String)またはExecutionControl.varValue(String, String)からStringに変換します。変数の値を返します。
-
コンストラクタの詳細
-
DirectExecutionControl
public DirectExecutionControl(LoaderDelegate loaderDelegate) 指定されたデリゲートにローダー操作を委譲するインスタンスを作成します。- パラメータ:
loaderDelegate- デリゲートがロード・クラスを処理
-
DirectExecutionControl
public DirectExecutionControl()デフォルトのクラス・ローディングを使用してインスタンスを作成します。
-
-
メソッドの詳細
-
load
public void load(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationException インタフェースからコピーされた説明:ExecutionControl新しいクラスをロードしようとします。- 定義:
- インタフェース
ExecutionControl内のload - パラメータ:
cbcs- ロードするクラス名とバイトコード- 例外:
ExecutionControl.ClassInstallException- クラスのロード中に例外が発生しました。一部またはすべてがロードされませんでしたExecutionControl.NotImplementedException- 実装されていない場合ExecutionControl.EngineTerminationException- 実行エンジンが終了しました
-
redefine
public void redefine(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationException インタフェースからコピーされた説明:ExecutionControl以前にロードされたクラスを再定義しようとします。- 定義:
- インタフェース
ExecutionControl内のredefine - パラメータ:
cbcs- 再定義するクラス名とバイトコード- 例外:
ExecutionControl.ClassInstallException- クラスを再定義する際に例外が発生しました。一部またはすべてが再定義されませんでしたExecutionControl.NotImplementedException- 実装されていない場合ExecutionControl.EngineTerminationException- 実行エンジンが終了しました
-
classesRedefined
protected void classesRedefined(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationException クラスが再定義されたことを通知します。- パラメータ:
cbcs- 再定義するクラス名とバイトコード- 例外:
ExecutionControl.NotImplementedException- 実装されていない場合ExecutionControl.EngineTerminationException- 実行エンジンが終了しました
-
invoke
public String invoke(String className, String methodName) throws ExecutionControl.RunException, ExecutionControl.InternalException, ExecutionControl.EngineTerminationException インタフェースからコピーされた説明:ExecutionControl指定されたラッパー・クラスのメソッドを呼び出すことにより、実行可能スニペットを呼び出します。 このメソッドは引数を持たず、Stringを返さなければなりません。- 定義:
- インタフェース
ExecutionControl内のinvoke - パラメータ:
className- メソッドを呼び出すべきクラスmethodName- 呼び出すメソッドの名前- 戻り値:
- 実行の結果。結果がない場合はnull
- 例外:
ExecutionControl.UserException- 呼び出しによってユーザー例外が発生しましたExecutionControl.ResolutionException- 呼び出しは、直接または間接的に未解決のスニペットを呼び出そうとしましたExecutionControl.StoppedException-invoke()がExecutionControl.stop()によって取り消された場合ExecutionControl.InternalException- 内部問題が発生しましたExecutionControl.EngineTerminationException- 実行エンジンが終了しましたExecutionControl.RunException
-
varValue
public String varValue(String className, String varName) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException インタフェースからコピーされた説明:ExecutionControl変数の値を返します。- 定義:
- インタフェース
ExecutionControl内のvarValue - パラメータ:
className- 変数のラッパー・クラスの名前varName- 変数の名前- 戻り値:
- 変数の値
- 例外:
ExecutionControl.UserException- 値の書式設定によってユーザー例外が発生しましたExecutionControl.ResolutionException- 値をフォーマットすると、未解決のスニペットを直接的または間接的に呼び出そうとしましたExecutionControl.StoppedException- 値の書式設定がExecutionControl.stop()によって取消された場合ExecutionControl.EngineTerminationException- 実行エンジンが終了しましたExecutionControl.InternalException- 内部問題が発生しましたExecutionControl.RunException
-
addToClasspath
public void addToClasspath(String cp) throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalException インタフェースからコピーされた説明:ExecutionControl実行クラスパスにパスを追加します。- 定義:
- インタフェース
ExecutionControl内のaddToClasspath - パラメータ:
cp- 追加するパス- 例外:
ExecutionControl.EngineTerminationException- 実行エンジンが終了しましたExecutionControl.InternalException- 内部問題が発生しました
-
stop
public void stop() throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalException実行中の呼び出しを中断します。サポートされていません。
- 定義:
- インタフェース
ExecutionControl内のstop - 例外:
ExecutionControl.EngineTerminationException- 実行エンジンが終了しましたExecutionControl.InternalException- 内部問題が発生しました
-
extensionCommand
public Object extensionCommand(String command, Object arg) throws ExecutionControl.RunException, ExecutionControl.EngineTerminationException, ExecutionControl.InternalException インタフェースからコピーされた説明:ExecutionControl非標準コマンド(新しいバージョンの標準コマンド)を実行します。- 定義:
- インタフェース
ExecutionControl内のextensionCommand - パラメータ:
command- 非標準コマンドarg- コマンドの引数- 戻り値:
- コマンドは値を返します
- 例外:
ExecutionControl.UserException- コマンドはユーザー例外を発生させましたExecutionControl.ResolutionException- コマンドは、直接または間接的に未解決のスニペットを呼び出そうとしましたExecutionControl.StoppedException- コマンドがExecutionControl.stop()によって取り消された場合ExecutionControl.EngineTerminationException- 実行エンジンが終了しましたExecutionControl.NotImplementedException- 実装されていない場合ExecutionControl.InternalException- 内部問題が発生しましたExecutionControl.RunException
-
close
public void close()インタフェースからコピーされた説明:ExecutionControlこの実行エンジンをシャットダウンします。 実装では、この実行エンジンが保持するすべてのリソースを解放する必要があります。このインタフェース上のメソッドへの呼び出しは、終了後に行う必要がありません。
- 定義:
close、インタフェースAutoCloseable- 定義:
- インタフェース
ExecutionControl内のclose
-
findClass
protected Class<?> findClass(String name) throws ClassNotFoundException 指定されたバイナリ名を持つクラスを探します。- パラメータ:
name- クラスのバイナリ名- 戻り値:
- クラス・オブジェクト
- 例外:
ClassNotFoundException- クラスが見つからなかった場合
-
invoke
パラメータを指定しない静的メソッド"doit-method"を呼び出します。 このクラスのinvoke(java.lang.String, java.lang.String)はこれを呼び出して呼び出します。- パラメータ:
doitMethod- 呼び出すメソッド- 戻り値:
- 値またはnull
- 例外:
Exception-Method.invoke(Object, Object...)または任意のExecutionControl.ExecutionControlExceptionによってパススルーにスローされた例外。
-
valueString
Objectの値をExecutionControl.invoke(String, String)またはExecutionControl.varValue(String, String)からStringに変換します。- パラメータ:
value- 変換する値- 戻り値:
String表現
-
throwConvertedInvocationException
protected String throwConvertedInvocationException(Throwable cause) throws ExecutionControl.RunException, ExecutionControl.InternalException ユーザー・コードの受信例外をExecutionControl.ExecutionControlExceptionのサブ型のインスタンスに変換し、変換された例外をスローします。- パラメータ:
cause- 変換する例外- 戻り値:
- いつも通りに戻ることはありません
- 例外:
ExecutionControl.RunException- 通常の例外発生の場合ExecutionControl.InternalException- 内部問題
-
throwConvertedOtherException
protected String throwConvertedOtherException(Throwable ex) throws ExecutionControl.RunException, ExecutionControl.InternalException エージェント・コード内の受信例外をExecutionControl.ExecutionControlExceptionのサブ型のインスタンスに変換し、変換された例外をスローします。- パラメータ:
ex- 変換する例外- 戻り値:
- いつも通りに戻ることはありません
- 例外:
ExecutionControl.RunException- 通常の例外発生の場合ExecutionControl.InternalException- 内部問題
-
clientCodeEnter
protected void clientCodeEnter() throws ExecutionControl.InternalExceptionユーザー・コードへのエントリをマークします。- 例外:
ExecutionControl.InternalException- 予期しない失敗事例で
-
clientCodeLeave
protected void clientCodeLeave() throws ExecutionControl.InternalExceptionユーザー・コードから出発します。- 例外:
ExecutionControl.InternalException- 予期しない失敗事例で
-