|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||
java.lang.Objectorg.seasar.jms.server.Main
public class Main
S2JMS-Containerを利用したアプリケーションをサーバプロセスとして起動するブートストラップを提供するクラスです。
このクラスはS2JMS-Serverの提供する実行可能JarにおいてMain-Classに設定されることにより、 S2JMSサーバプロセスのエントリポイントとなります。
S2JMS-Serverはこのクラス自身を含むS2JMS-ServerのJarファイルと同じ位置にあるJarファイルをクラスパスに追加します。
S2JMS-Serverを起動する際にコマンドライン引数として以下の指定を行うことができます。
--classpath classpathsclasspathsはプラットフォームのパス区切り文字を使って複数のパスを指定することができます。
追加されたクラスパスは標準のクラスパスより前に設定されます。--dicon diconfileapp.diconになります。
| フィールドの概要 | |
|---|---|
protected static String |
BOOTSTRAP_CLASS_FILE_NAME
このクラスのクラスファイル名 |
protected static String |
DEFAULT_DICON_FILE
ルートdiconファイルのデフォルト名 |
protected static String |
JMS_CONTAINER_INITIALIZER
S2JMS-Containerの初期化クラス名 |
protected static CountDownLatch |
latch
シャットダウンフックと同期を取るためのラッチ |
protected Object |
s2container
S2コンテナ |
| コンストラクタの概要 | |
|---|---|
Main()
|
|
| メソッドの概要 | |
|---|---|
protected void |
addPath(List<URL> urls,
File path)
クラスパスを表すURLの配列にパスを追加します。 |
protected Object |
createS2Container(String dicon)
S2コンテナを構築します。 |
protected void |
destoryS2Container()
S2コンテナを破棄します。 |
protected String |
getArg(String name,
String[] args)
コマンドライン引数から指定されたキーに対応する値を返します。 |
protected File |
getBootstrapJarFile()
このクラスを含んでいるS2JMS-ServerのJarファイルを返します。 |
protected String |
getClasspath(String[] args)
コマンドライン引数で指定された追加のクラスパスを返します。 |
protected String |
getDicon(String[] args)
コマンドライン引数で指定されたdiconファイルのパス名を返します。 |
protected File[] |
getJarFiles(File dir)
指定されたディレクトリ直下にあるJarファイルの配列を返します。 |
protected boolean |
isJar(File pathname)
ファイルがJarなら trueを返します。 |
static boolean |
isWaiting()
S2JMS-Serverプロセスのメインスレッドが待機中の場合は trueを返します。 |
static void |
main(String[] args)
S2JMS-Serverプロセスを開始します。 |
protected void |
run(String[] args)
S2JMS-Serverプロセスを開始し、シャットダウンまで待機します。 |
protected void |
setupClasspath(String[] pathStrings)
クラスパスを構築します。 |
static void |
stop()
S2JMS-Serverプロセスを停止します。 |
| クラス java.lang.Object から継承されたメソッド |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
|---|
protected static final String DEFAULT_DICON_FILE
protected static final String JMS_CONTAINER_INITIALIZER
protected static final String BOOTSTRAP_CLASS_FILE_NAME
protected static CountDownLatch latch
protected Object s2container
| コンストラクタの詳細 |
|---|
public Main()
| メソッドの詳細 |
|---|
public static void main(String[] args)
args - コマンドライン引数public static void stop()
public static boolean isWaiting()
trueを返します。
true
protected void run(String[] args)
throws Exception
args - コマンドライン引数
Exception - S2JMS-Serverプロセスの初期化中に例外が発生した場合にスローされます
protected Object createS2Container(String dicon)
throws Exception
dicon - ルートとなるdiconファイルのパス名
Exception - S2コンテナの作成中に例外が発生した場合にスローされますprotected void destoryS2Container()
protected String getDicon(String[] args)
throws IllegalArgumentException
コマンドライン引数でパスが指定されなかった場合はデフォルトのapp.diconを返します。
args - コマンドライン引数
IllegalArgumentException - コマンドライン引数が不正の場合にスローされます
protected String getClasspath(String[] args)
throws IllegalArgumentException
コマンドライン引数で追加のクラスパスが指定されなかった場合はデフォルトの.を返します。
args - コマンドライン引数
IllegalArgumentException - コマンドライン引数が不正の場合にスローされます
protected String getArg(String name,
String[] args)
name - コマンドライン引数の名前args - コマンドライン引数
protected void setupClasspath(String[] pathStrings)
throws IOException
pathStrings - クラスパス文字列
IOException - IO処理中に例外が発生した場合にスローされますprotected File getBootstrapJarFile()
protected void addPath(List<URL> urls,
File path)
throws IOException
パスがディレクトリの場合で、そのディレクトリ直下にJarファイルが存在する場合はそれらJarファイル全てがクラスパスに追加されます。 パスがディレクトリの場合で、そのディレクトリ直下にJarファイルが存在しない場合はそのディレクトリ自身が暮らすパスに追加されます。 パスがファイルの場合はそのファイルがクラスパスに追加されます。
urls - クラスパスを表すURLの配列path - ディレクトリまたはファイルを表すパス
IOException - IO処理中に例外が発生した場合にスローされますprotected File[] getJarFiles(File dir)
dir - ディレクトリ
protected boolean isJar(File pathname)
trueを返します。
pathname - ファイル
true
|
|||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||