public class PropertiesLauncher extends Launcher
Launcher。多くの場合、このモデルは、実行可能 jar に基づくモデルよりも柔軟で、適切に動作する OS レベルのサービスを作成できます。 ローダー設定を抽出するためのプロパティファイルをさまざまな場所で検索します。デフォルトは、現在のクラスパスまたは現在の作業ディレクトリの loader.properties です。プロパティファイルの名前は、システムプロパティ loader.config.name を設定することで変更できます(たとえば、-Dloader.config.name=foo は foo.properties を探します。そのファイルが存在しない場合は、loader.config.location (許可されたプレフィックス classpath: および file: または有効な URL)を試します。located はそれを Properties に変換し、オプションの値を抽出します(ファイルが存在しない場合は、システムプロパティとしてオーバーライドすることもできます)。
loader.path: ディレクトリのコンマ区切りリスト(*.jar または *.zip のファイルリソースやネストされたアーカイブ、またはアーカイブを含む)またはクラスパスに追加するアーカイブ。アプリケーションアーカイブの BOOT-INF/classes,BOOT-INF/lib が常に使用されます loader.main: クラスローダーのセットアップ後に実行を委譲するメインメソッド。デフォルトはありませんが、${loader.home}/META-INF に Start-Class が存在する場合、MANIFEST.MF で Start-Class を検索することにフォールバックします。| 修飾子と型 | フィールドと説明 |
|---|---|
static StringSE | ARGS デフォルトのコマンドライン引数のプロパティキー。 |
static StringSE | CONFIG_LOCATION 構成ファイルの場所のプロパティキー(オプションの classpath:、file :、または URL プレフィックスを含む)。 |
static StringSE | CONFIG_NAME 外部構成ファイルの名前のプロパティキー(サフィックスを除く)。 |
static StringSE | HOME ホームディレクトリのプロパティキー。 |
static StringSE | MAIN メインクラスのプロパティキー。 |
static StringSE | PATH クラスパスエントリのプロパティキー(jar または jar を含む可能性のあるディレクトリ)。 |
static StringSE | SET_SYSTEM_PROPERTIES ブールフラグのプロパティキー(デフォルトは false)。設定すると、外部構成プロパティがシステムプロパティにコピーされます(Java セキュリティで許可されている場合)。 |
| コンストラクターと説明 |
|---|
PropertiesLauncher() |
| 修飾子と型 | メソッドと説明 |
|---|---|
protected ClassLoaderSE | createClassLoader(ListSE<Archive> archives) 指定されたアーカイブのクラスローダーを作成します。 |
protected StringSE[] | getArgs(StringSE... args) |
protected ListSE<Archive> | getClassPathArchives() クラスパスの構築に使用されるアーカイブを返します。 |
protected FileSE | getHomeDirectory() |
protected StringSE | getMainClass() 起動するメインクラスを返します。 |
static void | main(StringSE[] args) |
static StringSE | toCamelCase(CharSequenceSE string) |
createArchive, createClassLoader, createMainMethodRunner, launch, launchcloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEpublic static final StringSE MAIN
Start-Class として指定することもできます。public static final StringSE PATH
BOOT-INF/classes,BOOT-INF/lib は常に使用されます。public static final StringSE HOME
loader path 内の相対パスのベースパスでもあります。デフォルトは現在の作業ディレクトリ(${user.dir})です。public static final StringSE ARGS
public static final StringSE CONFIG_NAME
loader config location が提供される場合は無視されます。public static final StringSE CONFIG_LOCATION
protected FileSE getHomeDirectory()
protected StringSE[] getArgs(StringSE... args) throws ExceptionSE
ExceptionSEprotected StringSE getMainClass() throws ExceptionSE
LauncherLauncher の getMainClass ExceptionSE - メインクラスを取得できない場合 protected ClassLoaderSE createClassLoader(ListSE<Archive> archives) throws ExceptionSE
LauncherLauncher の createClassLoader archives - アーカイブ ExceptionSE - クラスローダーを作成できない場合 protected ListSE<Archive> getClassPathArchives() throws ExceptionSE
LauncherLauncher の getClassPathArchives ExceptionSE - クラスパスアーカイブを取得できない場合 public static void main(StringSE[] args) throws ExceptionSE
ExceptionSEpublic static StringSE toCamelCase(CharSequenceSE string)
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.