Interstage Application Server J2EE ユーザーズガイド |
目次
索引
![]() ![]() |
第5部 JMS編 | > 第41章 JMSアプリケーションの開発 | > 41.4 サンプルアプリケーション |
サンプルSender/MsgSelectionReceiverSについて説明します。
サンプルSender/MsgSelectionReceiverSは、画面から入力されたプロパティ情報(色)と文字列をテキストメッセージとして送信するアプリケーションSenderと、メッセージセレクタ機能を使用してプロパティ情報(色)が“red”のメッセージのみを受信し、受信したテキストメッセージを画面に表示するアプリケーションMsgSelectionReceiverSで通信を行います。
サンプルプログラムの構成を以下に示します。
<samples> *<J2EE> *<ApplicationClient> *<Queue> *<MessageSelector> * * Sender.java … ソースコード * * Sender.bat … サンプル起動バッチファイル * * MsgSelectionReceiverS.java … ソースコード * * MsgSelectionReceiverS.bat … サンプル起動バッチファイル * queue.xml … サンプル用deployment descriptorファイル |
<samples> *<J2EE> *<ApplicationClient> *<Queue> *<MessageSelector> * * Sender.java … ソースコード * * Sender … サンプル起動シェルスクリプト * * MsgSelectionReceiverS.java … ソースコード * * MsgSelectionReceiverS … サンプル起動シェルスクリプト * queue.xml … サンプル用deployment descriptorファイル |
サンプルSender/MsgSelectionReceiverSの起動方法について説明します。
次のプロパティおよび引数を指定します。
java -Dcom.fujitsu.interstage.j2ee.DeploymentDescriptorClient=ファイル名 Sender ConnectionFactory定義登録名 Destination定義登録名 |
java -Dcom.fujitsu.interstage.j2ee.DeploymentDescriptorClient=ファイル名 MsgSelectionReceiverS ConnectionFactory定義登録名 Destination定義登録名 |
例:C:\INTERSTAGE\jms\samples\J2EE\ApplicationClient\Queueにqueue.xmlがある場合
java -Dcom.fujitsu.interstage.j2ee.DeploymentDescriptorClient=C:\INTERSTAGE\jms\samples\J2EE\ApplicationClient\Queue\queue.xml Sender TestQueueConnectionFactory TestQueue |
例:/opt/FJSVjms/samples/J2EE/ApplicationClient/Queueにqueue.xmlがある場合
java -Dcom.fujitsu.interstage.j2ee.DeploymentDescriptorClient=/opt/FJSVjms/samples/J2EE/ApplicationClient/Queue/queue.xml Sender TestQueueConnectionFactory TestQueue |
サンプル用deployment descriptorファイルをそのまま使用する場合は、ConnectionFactory定義のJNDI名を“TestQueueConnectionFactory” 、Destination定義のJNDI名を“TestQueue”として登録する必要があります。
文字列 “x”または“X”を入力するとアプリケーションSenderが終了します。
文字列 “x”または“X”を受信するとアプリケーションMsgSelectionReceiverSが終了します。(プロパティ情報(色)“red”)
目次
索引
![]() ![]() |