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)新しいクラスをロードしようとします。voidredefine(ExecutionControl.ClassBytecodes[] cbcs)以前にロードされたクラスを再定義しようとします。voidstop()実行中の呼び出しを中断します。protected Stringユーザー・コードの受信例外をExecutionControl.ExecutionControlExceptionのサブ型のインスタンスに変換し、変換された例外をスローします。protected Stringエージェント・コード内の受信例外をExecutionControl.ExecutionControlExceptionのサブ型のインスタンスに変換し、変換された例外をスローします。protected static StringvalueString(Object value)Objectの値をExecutionControl.invoke(String, String)またはExecutionControl.varValue(String, String)からStringに変換します。変数の値を返します。
- 
コンストラクタの詳細- 
DirectExecutionControlpublic DirectExecutionControl(LoaderDelegate loaderDelegate)指定されたデリゲートにローダー操作を委譲するインスタンスを作成します。- パラメータ:
- loaderDelegate- デリゲートがロード・クラスを処理
 
- 
DirectExecutionControlpublic DirectExecutionControl()デフォルトのクラス・ローディングを使用してインスタンスを作成します。
 
- 
- 
メソッドの詳細- 
loadpublic void load(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationExceptionインタフェースからコピーされた説明:ExecutionControl新しいクラスをロードしようとします。- 定義:
- インタフェースExecutionControl内のload
- パラメータ:
- cbcs- ロードするクラス名とバイトコード
- 例外:
- ExecutionControl.ClassInstallException- クラスのロード中に例外が発生しました。一部またはすべてがロードされませんでした
- ExecutionControl.NotImplementedException- 実装されていない場合
- ExecutionControl.EngineTerminationException- 実行エンジンが終了しました
 
- 
redefinepublic void redefine(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.ClassInstallException, ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationExceptionインタフェースからコピーされた説明:ExecutionControl以前にロードされたクラスを再定義しようとします。- 定義:
- インタフェースExecutionControl内のredefine
- パラメータ:
- cbcs- 再定義するクラス名とバイトコード
- 例外:
- ExecutionControl.ClassInstallException- クラスを再定義する際に例外が発生しました。一部またはすべてが再定義されませんでした
- ExecutionControl.NotImplementedException- 実装されていない場合
- ExecutionControl.EngineTerminationException- 実行エンジンが終了しました
 
- 
classesRedefinedprotected void classesRedefined(ExecutionControl.ClassBytecodes[] cbcs) throws ExecutionControl.NotImplementedException, ExecutionControl.EngineTerminationExceptionクラスが再定義されたことを通知します。- パラメータ:
- cbcs- 再定義するクラス名とバイトコード
- 例外:
- ExecutionControl.NotImplementedException- 実装されていない場合
- ExecutionControl.EngineTerminationException- 実行エンジンが終了しました
 
- 
invokepublic 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
 
- 
varValuepublic 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
 
- 
addToClasspathpublic void addToClasspath(String cp) throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalExceptionインタフェースからコピーされた説明:ExecutionControl実行クラスパスにパスを追加します。- 定義:
- インタフェースExecutionControl内のaddToClasspath
- パラメータ:
- cp- 追加するパス
- 例外:
- ExecutionControl.EngineTerminationException- 実行エンジンが終了しました
- ExecutionControl.InternalException- 内部問題が発生しました
 
- 
stoppublic void stop() throws ExecutionControl.EngineTerminationException, ExecutionControl.InternalException実行中の呼び出しを中断します。サポートされていません。 - 定義:
- インタフェースExecutionControl内のstop
- 例外:
- ExecutionControl.EngineTerminationException- 実行エンジンが終了しました
- ExecutionControl.InternalException- 内部問題が発生しました
 
- 
extensionCommandpublic 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
 
- 
closepublic void close()インタフェースからコピーされた説明:ExecutionControlこの実行エンジンをシャットダウンします。 実装では、この実行エンジンが保持するすべてのリソースを解放する必要があります。このインタフェース上のメソッドへの呼び出しは、終了後に行う必要がありません。 - 定義:
- close、インタフェース:- AutoCloseable
- 定義:
- インタフェースExecutionControl内のclose
 
- 
findClassprotected 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によってパススルーにスローされた例外。
 
- 
valueStringObjectの値をExecutionControl.invoke(String, String)またはExecutionControl.varValue(String, String)からStringに変換します。- パラメータ:
- value- 変換する値
- 戻り値:
- String表現
 
- 
throwConvertedInvocationExceptionprotected String throwConvertedInvocationException(Throwable cause) throws ExecutionControl.RunException, ExecutionControl.InternalExceptionユーザー・コードの受信例外をExecutionControl.ExecutionControlExceptionのサブ型のインスタンスに変換し、変換された例外をスローします。- パラメータ:
- cause- 変換する例外
- 戻り値:
- いつも通りに戻ることはありません
- 例外:
- ExecutionControl.RunException- 通常の例外発生の場合
- ExecutionControl.InternalException- 内部問題
 
- 
throwConvertedOtherExceptionprotected String throwConvertedOtherException(Throwable ex) throws ExecutionControl.RunException, ExecutionControl.InternalExceptionエージェント・コード内の受信例外をExecutionControl.ExecutionControlExceptionのサブ型のインスタンスに変換し、変換された例外をスローします。- パラメータ:
- ex- 変換する例外
- 戻り値:
- いつも通りに戻ることはありません
- 例外:
- ExecutionControl.RunException- 通常の例外発生の場合
- ExecutionControl.InternalException- 内部問題
 
- 
clientCodeEnterprotected void clientCodeEnter() throws ExecutionControl.InternalExceptionユーザー・コードへのエントリをマークします。- 例外:
- ExecutionControl.InternalException- 予期しない失敗事例で
 
- 
clientCodeLeaveprotected void clientCodeLeave() throws ExecutionControl.InternalExceptionユーザー・コードから出発します。- 例外:
- ExecutionControl.InternalException- 予期しない失敗事例で
 
 
-