JP2006251974A - Information processor and processing method - Google Patents
Information processor and processing method Download PDFInfo
- Publication number
- JP2006251974A JP2006251974A JP2005065133A JP2005065133A JP2006251974A JP 2006251974 A JP2006251974 A JP 2006251974A JP 2005065133 A JP2005065133 A JP 2005065133A JP 2005065133 A JP2005065133 A JP 2005065133A JP 2006251974 A JP2006251974 A JP 2006251974A
- Authority
- JP
- Japan
- Prior art keywords
- bean
- ejb
- processing
- sub
- flow
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
本発明は、情報処理技術に関し、具体的には、例えば、EJB(Enterprise JavaBeans)を利用した情報処理技術に関する。 The present invention relates to information processing technology, and specifically, to information processing technology using, for example, EJB (Enterprise JavaBeans).
例えば、クライアントマシンとサーバシステムとを備えたシステムがある。サーバシステムは、例えば、プレゼンテーション層、ビジネスロジック層及びデータストア層から成る三階層で構築することができる。プレゼンテーション層は、ユーザから入力を受付けたりユーザに情報を出力したりするためのユーザインターフェースを提供できる層であり、例えば、WEBサーバにより実現することができる。ビジネスロジック層は、情報処理を行うための層であり、例えば、EJBサーバにより実現することができる。データストア層は、情報を保存するための層であり、例えば、データベースにより実現することができる。 For example, there is a system including a client machine and a server system. For example, the server system can be constructed in three layers including a presentation layer, a business logic layer, and a data store layer. The presentation layer is a layer that can provide a user interface for receiving input from the user and outputting information to the user, and can be realized by, for example, a WEB server. The business logic layer is a layer for performing information processing, and can be realized by an EJB server, for example. The data store layer is a layer for storing information, and can be realized by a database, for example.
EJB(Enterprise JavaBeans)を利用した情報処理技術としては、例えば特許文献1乃至特許文献5に開示の技術が知られている。
As information processing technology using EJB (Enterprise JavaBeans), for example, technologies disclosed in
上記のシステムでは、EJBサーバは、処理を実行することの要求をWEBサーバから受け、その要求に応答して、その要求に従う処理を実行することができる。ここで、EJBサーバに、その処理に加えて、それとは別のサブ処理(例えば、第一の処理を実行するときの時刻のログをとる、障害が発生した場合に障害のログをとる等の付加的な処理)を行ってもらいたい場合がある。その際、実行される処理がどんなものかに応じて、実行されるサブ処理を違えることができれば利便性が高まると考えられる。 In the above system, the EJB server can receive a request to execute processing from the WEB server, and can execute processing according to the request in response to the request. Here, in addition to the processing, the EJB server has a different sub-process (for example, logs the time when executing the first process, logs the failure when a failure occurs, etc.) In some cases, you may want to perform additional processing. At that time, if the executed sub-process can be changed depending on what is executed, the convenience is expected to increase.
これは、EJBサーバに限らず、他種のサーバについても同様であると考えられる。 This is considered to be the same not only for the EJB server but also for other types of servers.
従って、本発明の目的の一つは、要求元からの要求に従って実行される処理がどんなものかに応じて、実行されるサブ処理を違えることを可能にすることにある。 Accordingly, one of the objects of the present invention is to make it possible to change the sub-process to be executed depending on what is executed according to the request from the request source.
本発明の一つの側面に従う情報処理システムは、要求元からの要求に従う処理を実行する処理実行手段と、前記処理に対応する一以上のサブ処理を前記要求に基づいて複数のサブ処理の中から選択するサブ処理選択手段と、前記選択されたサブ処理を前記処理の実行前及び実行後のうちの少なくとも一方で実行するサブ処理実行手段とを備える。 An information processing system according to one aspect of the present invention includes: a process execution unit that executes a process according to a request from a request source; and one or more sub-processes corresponding to the process from a plurality of sub-processes based on the request Sub-process selection means for selecting, and sub-process execution means for executing the selected sub-process at least one of before and after execution of the process.
ここで、「情報処理システム」は、一台のコンピュータマシンで構成されても良いし、複数台のコンピュータマシンで構成されても良い。 Here, the “information processing system” may be configured by a single computer machine or may be configured by a plurality of computer machines.
一つの実施態様では、情報処理システムは、複数のサブ処理にそれぞれ対応した複数のサブ処理ID及び複数のサブ処理選択条件を記憶した記憶手段を備えることができる。前記サブ処理選択手段は、前記要求に適合する一以上のサブ処理選択条件を前記複数のサブ処理選択条件の中から特定し、特定された一以上のサブ処理選択条件に対応する一以上のサブ処理IDから識別される一以上のサブ処理を選択することができる。 In one embodiment, the information processing system can include a storage unit that stores a plurality of sub-process IDs and a plurality of sub-process selection conditions respectively corresponding to a plurality of sub-processes. The sub-process selection unit specifies one or more sub-process selection conditions that meet the request from the plurality of sub-process selection conditions, and one or more sub-process selection conditions corresponding to the specified one or more sub-process selection conditions. One or more sub-processes identified from the process ID can be selected.
一つの実施態様では、前記サブ処理選択条件は、キーワードを含んでもよい。前記サブ処理選択手段は、前記要求に含まれている特定の文字列と、サブ処理選択条件を構成するキーワードとに基づいて、前記要求に適合する一以上のサブ処理選択条件を特定することができる。 In one embodiment, the sub-process selection condition may include a keyword. The sub-process selection unit may specify one or more sub-process selection conditions that match the request based on a specific character string included in the request and a keyword constituting the sub-process selection condition. it can.
一つの実施態様では、前記サブ処理選択条件は、キーワードと正規表現との組み合わせで構成されていてもよい。前記サブ処理選択手段は、前記要求に含まれている特定の文字列と、サブ処理選択条件を構成するキーワード及び正規表現とに基づいて、前記要求に適合する一以上のサブ処理選択条件を特定することができる。 In one embodiment, the sub-process selection condition may be composed of a combination of a keyword and a regular expression. The sub-process selection unit specifies one or more sub-process selection conditions that match the request based on a specific character string included in the request, and a keyword and a regular expression constituting the sub-process selection condition. can do.
一つの実施態様では、前記処理には、一つの本名と一以上の別名とがあってもよい。前記要求には特定の文字列が含まれており、前記特定の文字列は、要求対象となる処理の本名と別名とのいずれか一方を表していてもよい。 In one embodiment, the process may have one real name and one or more aliases. The request includes a specific character string, and the specific character string may represent either a real name or an alias of a process to be requested.
なお、情報処理システムは、複数のコンピュータプログラムを記憶する記憶資源と、前記記憶資源に記憶された複数のコンピュータプログラムのうちの少なくとも一つを実行する少なくとも一つのコンピュータとを備えてもよい。前記複数のコンピュータプログラムには、要求元からの処理要求を受付ける受付けプログラムと、所定の処理を実行する一以上の処理プログラムとが含まれていてもよい。前記処理要求には、実行すべき複数の処理対象と前記複数の処理対象の実行順序とが定義されていてもよい。前記受付けプログラムが、前記処理要求を受け(例えば、前記要求元からの前記処理要求の内容に関わらず前記処理要求を受け)、前記受けた処理要求を解析し、前記処理要求で定義されている前記実行順序で、前記処理要求で定義されている複数の処理対象の各々の処理を、前記一以上の処理プログラムのうちの少なくとも一つに依頼してもよい。前記受付けプログラムから処理の依頼を受けた処理プログラムが、依頼された処理対象の処理を行ってもよい。 The information processing system may include a storage resource that stores a plurality of computer programs and at least one computer that executes at least one of the plurality of computer programs stored in the storage resource. The plurality of computer programs may include an acceptance program that accepts a processing request from a request source, and one or more processing programs that execute predetermined processing. In the processing request, a plurality of processing targets to be executed and an execution order of the plurality of processing targets may be defined. The receiving program receives the processing request (for example, receives the processing request regardless of the content of the processing request from the request source), analyzes the received processing request, and is defined in the processing request In the execution order, each of a plurality of processing targets defined in the processing request may be requested to at least one of the one or more processing programs. The processing program that has received the processing request from the receiving program may perform the requested processing target processing.
ここで、「情報処理システム」は、一台のコンピュータマシンで構成されても良いし、複数台のコンピュータマシンで構成されても良い。また、「コンピュータ」は、コンピュータマシンであっても良いし、コンピュータマシンに搭載されるプロセッサ(例えばCPU)であっても良い。また、「記憶資源」は、複数の記憶装置(例えば、ハードディスク又はメモリ)のうちの少なくとも一つによって構成されてもよい。 Here, the “information processing system” may be configured by a single computer machine or may be configured by a plurality of computer machines. Further, the “computer” may be a computer machine or a processor (for example, CPU) mounted on the computer machine. Further, the “storage resource” may be configured by at least one of a plurality of storage devices (for example, a hard disk or a memory).
一つの実施態様では、前記処理要求には、少なくとも一つのトランザクション分離範囲と、そのトランザクション分離範囲に属する処理対象とを定義することができる。前記受付けプログラムが、トランザクション分離範囲に属する処理対象については、トランザクション分離範囲に属さない処理対象に関するトランザクションから独立した処理が行われるように前記一以上の処理プログラムに処理を依頼することができる。 In one embodiment, the processing request may define at least one transaction isolation range and a processing target belonging to the transaction isolation range. For the processing target belonging to the transaction isolation range, the accepting program can request the one or more processing programs to perform processing independent of the transaction related to the processing target not belonging to the transaction isolation range.
一つの実施態様では、前記一以上の処理プログラムには、第一の処理を実行する第一の処理プログラムと、前記第一の処理とは別の第二の処理を実行する第二の処理プログラムとを含めることができる。前記受付けプログラムが、前記受けた処理要求を解析することにより、トランザクション分離範囲が検出された場合には、前記第一の処理プログラムに処理を依頼し、処理対象が検出された場合には、前記第二の処理プログラムに処理を依頼することができる。 In one embodiment, the one or more processing programs include a first processing program for executing a first processing and a second processing program for executing a second processing different from the first processing. And can be included. When the acceptance program detects the transaction separation range by analyzing the received processing request, the processing is requested to the first processing program, and when the processing target is detected, Processing can be requested to the second processing program.
一つの実施態様では、前記受付けプログラム及び前記第二の処理プログラムは、呼出し元に返ってコミットする性質を有することができる(例えば、Requiredという属性のEJBであるとすることができる)。前記第一の処理プログラムは、新たにトランザクションを作成し、呼び出し元のトランザクションに参加せずにトランザクションを完結させる性質を有することができる(例えば、Requires Newという属性のEJBであるとすることができる)。前記受付けプログラムから処理の依頼を受けた前記第一の処理プログラムが、前記トランザクション分離範囲に属する処理対象の処理を前記第二の処理プログラムに依頼することができる。前記受付けプログラム又は前記第一の処理プログラムから処理の依頼を受けた前記第二の処理プログラムが、依頼された処理対象の処理を実行し、実行の結果を依頼元に返すことができる。前記第一の処理プログラムは、前記第二の処理プログラムから実行の結果を受けた場合、処理の依頼元である受付けプログラムのトランザクションに参加することなく、依頼した処理に関わるトランザクションをコミットすることができる。前記受付けプログラムは、前記第二の処理プログラムから実行の結果を受けた場合、依頼した処理に関わるトランザクションをコミットすることができる。 In one embodiment, the accepting program and the second processing program may have the property of returning to the caller and committing (for example, it may be an EJB with a required attribute). The first processing program can have a property of creating a new transaction and completing the transaction without participating in the caller transaction (for example, it can be assumed that the EJB has an attribute of “Requires New”. ). The first processing program that has received a processing request from the accepting program can request the second processing program for processing to be processed belonging to the transaction isolation range. The second processing program that has received a processing request from the accepting program or the first processing program can execute the requested processing target process and return the execution result to the request source. When the first processing program receives the execution result from the second processing program, the first processing program may commit the transaction related to the requested processing without participating in the transaction of the receiving program that is the processing request source. it can. When receiving the execution result from the second processing program, the receiving program can commit the transaction related to the requested processing.
一つの実施態様では、前記処理要求には、トランザクション分離範囲に含まれる更なるトランザクション分離範囲を定義することができる。前記第一の処理プログラムは、前記更なるトランザクション分離範囲が検出された場合には、自分に対して前記更なるトランザクション分離範囲の処理を依頼することができる。 In one embodiment, the processing request may define a further transaction isolation range included in the transaction isolation range. When the further transaction isolation range is detected, the first processing program can request the processing of the further transaction isolation range from itself.
一つの実施態様では、前記一以上の処理プログラムには、依頼された処理対象の処理を実行する実行プログラムを含めることができる。前記受付けプログラム及び前記実行プログラムは、呼出し元に返ってコミットする性質を有することができる(例えば、Requiredという属性のEJBであるとすることができる)。前記受付けプログラムから処理の依頼を受けた前記実行プログラムが、依頼された処理対象の処理を実行することができる。 In one embodiment, the one or more processing programs may include an execution program that executes a requested processing target process. The accepting program and the execution program may have a property of returning to the caller and committing (for example, it may be an EJB with an attribute of Required). The execution program that has received a processing request from the receiving program can execute the requested processing target process.
情報処理システムは、複数のコンピュータプログラムを記憶する記憶資源と、前記記憶資源に記憶された多数のコンピュータプログラムのうちの少なくとも一つを実行する少なくとも一つのコンピュータとを備えてもよい。前記多数のコンピュータプログラムには、複数の処理要素実行プログラムと、処理要素実行プログラムの数よりも少ない数の処理プログラムとが含まれていてもよい。前記複数の処理要素実行プログラムの各々は、所定の処理対象の処理を構成する一以上の処理要素のうちの所定の処理要素を実行してもよい。前記処理プログラムは、前記所定の処理対象の処理を構成する一以上の処理要素をそれぞれ実行する一以上の処理要素実行プログラムを実行することにより、前記所定の処理対象の処理を実行してもよい。 The information processing system may include a storage resource that stores a plurality of computer programs and at least one computer that executes at least one of a large number of computer programs stored in the storage resource. The multiple computer programs may include a plurality of processing element execution programs and a number of processing programs smaller than the number of processing element execution programs. Each of the plurality of processing element execution programs may execute a predetermined processing element among one or more processing elements constituting a predetermined processing target process. The processing program may execute the predetermined processing target process by executing one or more processing element execution programs that respectively execute one or more processing elements constituting the predetermined processing target process. .
一つの実施態様では、前記記憶資源には、各処理対象に対応した各処理定義データが記憶されていてもよい。各処理定義データには、各処理対象の処理を構成する一以上の処理要素の実行手順に関する定義を記述することができる。前記処理プログラムが、所定の処理対象に対応した処理定義データに基づいて、その所定の処理対象の処理を実行することができる。 In one embodiment, each processing definition data corresponding to each processing target may be stored in the storage resource. Each process definition data can describe a definition relating to an execution procedure of one or more process elements constituting each process target process. The processing program can execute the processing of the predetermined processing target based on the process definition data corresponding to the predetermined processing target.
一つの実施態様では、前記複数の処理要素実行プログラム以外の一以上のコンピュータプログラムのうちの少なくとも一つが、前記所定の処理対象に対応する処理定義データに基づいて、その処理定義データで定義された実行手順でその処理定義データで定義された一以上の処理要素を実行するための処理実行対象を生成することができる。前記処理プログラムが、前記処理実行対象を実行することにより、前記所定の処理対象の処理を実行することができる。 In one embodiment, at least one of one or more computer programs other than the plurality of processing element execution programs is defined by the process definition data based on the process definition data corresponding to the predetermined process target. A process execution target for executing one or more process elements defined by the process definition data in the execution procedure can be generated. When the processing program executes the process execution target, the predetermined process target process can be executed.
一つの実施態様では、前記処理定義データには、前記実行手順に関する定義として、第一の処理要素実行プログラムの出力を第二の処理要素実行プログラムに入力してその第二の処理要素実行プログラムがその出力を用いて処理することが記述されていてもよい。前記処理実行対象が、前記処理定義データに従って、前記第一の処理要素実行プログラムの出力を第二の処理要素実行プログラムに入力してその第二の処理要素実行プログラムにその出力を用いて処理を行わせることができる。 In one embodiment, the process definition data includes, as a definition relating to the execution procedure, an output of a first process element execution program that is input to a second process element execution program. Processing using the output may be described. In accordance with the process definition data, the process execution target inputs the output of the first process element execution program to a second process element execution program and performs processing using the output of the second process element execution program. Can be done.
一つの実施態様では、前記複数のコンピュータプログラムには、要求元からの処理要求を受付ける受付けプログラムが含まれていてもよい。前記受付けプログラムが、前記要求元からの処理要求を受け、前記受けた処理要求を解析し、前記処理要求で定義されている一以上の処理対象の各々の処理を、前記処理プログラムに依頼することができる。前記処理プログラムが、前記受付けプログラムから依頼された処理対象の処理を行うことができる。前記受付けプログラム及び前記処理プログラムは、ステートレスセッションビーンとしてのEJBとすることができる。 In one embodiment, the plurality of computer programs may include an acceptance program that accepts a processing request from a request source. The receiving program receives a processing request from the request source, analyzes the received processing request, and requests the processing program to process each of one or more processing targets defined in the processing request. Can do. The processing program can perform processing of a processing target requested by the receiving program. The acceptance program and the processing program may be an EJB as a stateless session bean.
一つの実施態様では、前記処理定義データには、その処理定義データに基づいて生成される処理実行対象が前記一以上の処理要素実行プログラムのために確保されたリソースを開放することが記述されていてもよい。前記処理実行対象が、前記前記一以上の処理要素実行プログラムのために確保されたリソースを開放することができる。 In one embodiment, the process definition data describes that a process execution target generated based on the process definition data releases resources reserved for the one or more process element execution programs. May be. The processing execution target can release resources reserved for the one or more processing element execution programs.
一つの実施態様では、前記複数のコンピュータプログラムには、要求元からの処理要求を受付ける受付けプログラムが含まれていてもよい。前記受付けプログラムが、前記要求元からの処理要求を受け、前記受けた処理要求を解析し、前記処理要求で定義されている一以上の処理対象の各々の処理を、前記処理プログラムに依頼することができる。前記処理プログラムが、前記受付けプログラムから依頼された処理対象の処理を行うことができる。 In one embodiment, the plurality of computer programs may include an acceptance program that accepts a processing request from a request source. The receiving program receives a processing request from the request source, analyzes the received processing request, and requests the processing program to process each of one or more processing targets defined in the processing request. Can do. The processing program can perform processing of a processing target requested by the receiving program.
一つの実施態様では、前記複数の処理要素実行プログラムとは異なる一以上のコンピュータプログラムのうちの前記実行される一以上の処理要素実行プログラムのために確保されたリソースを開放するリソース開放手段を備え、前記リソース開放手段が前記一以上の処理要素実行プログラムではないことを特徴とすることができる。 In one embodiment, resource release means for releasing resources reserved for the one or more processing element execution programs to be executed out of one or more computer programs different from the plurality of processing element execution programs is provided. The resource releasing means is not the one or more processing element execution programs.
以下、図面を参照して、本発明の一実施形態について説明する。 Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
図1は、本発明の一実施形態に係るシステムのハードウェア構成の概要を示すブロック図である。 FIG. 1 is a block diagram showing an outline of a hardware configuration of a system according to an embodiment of the present invention.
クライアントシステム3に、サーバシステム6が通信可能に(例えば、インターネット等の通信ネットワークを介して)接続されている。 A server system 6 is communicably connected to the client system 3 (for example, via a communication network such as the Internet).
クライアントシステム3は、例えば、一以上のCPU(Central Processing Unit)13や一以上の記憶資源(例えば一以上のメモリ15や一以上のハードディスク17)等のハードウェア資源を備えたコンピュータシステムである。クライアントシステム3は、例えば、パーソナルコンピュータ、ワークステーション、メインフレーム等として構成することができる。クライアントシステム3は、例えば、キーボードスイッチやポインティングデバイス、マイクロフォン等の情報入力装置(図示せず)と、例えば、モニタディスプレイやスピーカー等の情報出力装置(図示せず)とを備えることもできる。
The
サーバシステム6は、例えば、プレゼンテーション層、ビジネスロジック層及びデータストア層から成る三階層で構成することができる。この場合、例えば、プレゼンテーション層を、WEBサーバ5で構成し、ビジネスロジック層を、EJBサーバ7で構成し、データストア層を、データベース38で構成することができる。WEBサーバ5は、例えば、一以上のCPU23や一以上の記憶資源(例えば一以上のメモリ25や一以上のハードディスク27)等のハードウェア資源を備えたコンピュータシステムである。EJBサーバ7も、例えば、一以上のCPU33や一以上の記憶資源(例えば一以上のメモリ35や一以上のハードディスク37)等のハードウェア資源を備えたコンピュータシステムである。データベース38も、図示しないが、一以上のCPUや一以上の記憶資源等のハードウェア資源を備えたコンピュータシステムとすることができる。
The server system 6 can be configured in, for example, three layers including a presentation layer, a business logic layer, and a data store layer. In this case, for example, the presentation layer can be composed of the
なお、サーバシステム6の構成は、図示の構成に限らず、他の構成を採用することができる。また、クライアントシステム3、WEBサーバ5、EJBサーバ7及びデータベース38のうちの少なくとも一つは、一台のコンピュータシステムで構成されていても良いし、複数台のコンピュータシステムで構成されていても良い。
The configuration of the server system 6 is not limited to the illustrated configuration, and other configurations can be employed. In addition, at least one of the
図2は、図1に示したシステムのソフトウェア構成の概要を示すブロック図である。 FIG. 2 is a block diagram showing an outline of the software configuration of the system shown in FIG.
クライアントシステム3には、WEBブラウザ43が備えることができる。WEBブラウザ43は、WEBサーバ5に対して要求を発行したり、その要求に従う情報をWEBサーバ5から受信して表示したりすることができる。
The
WEBサーバ5には、ファサードバリュー記憶域49と、外部アプリケーション45とが備えられる。
The
ファサードバリュー記憶域49は、上述した記憶資源上に設けられるものであり、一又は複数のファサードバリューを記憶することができる。ファサードバリューは、本実施形態における一つの特徴であり、トランザクションをフローとして記述することができるコマンドパッケージである。ファサードバリューについては、後に詳細に説明する。
The facade
外部アプリケーション45は、EJBサーバ7の外部に存在するアプリケーションプログラムであり、メモリ25からCPU23に読み込まれることにより、EJBサーバ7から情報を取得したり、その取得した情報をWEBブラウザ43に提供したりすることができる。具体的には、例えば、外部アプリケーション45は、ファサードバリュー選択プログラム47を備え、そのプログラム47により、WEBブラウザ43からの要求(例えば、画面切替え要求)に対応したファサードバリューをファサードバリュー記憶域49の中から選択し、選択したファサードバリューをEJBサーバ7に送信する。それにより、外部アプリケーション45は、WEBブラウザ43からの要求に従う情報をEJBサーバ7から受信し、その受信した情報をWEBサーバ5に提供することができる。なお、この実施形態では、WEBサーバ5がEJBサーバ7に対して要求する処理別にファサードバリューがファサードバリュー記憶域49に記憶されているものとする。しかし、例えば、WEBサーバ5の管理者が、任意のタイミングで、キーボード等の情報入力装置を用いてファサードバリューを作成し、作成したファサードバリューをファサードバリュー記憶域49に記憶させたり、作成したファサードバリューをWEBサーバ5からEJBサーバ7に送信させたりすることもできる。
The
EJBサーバ7には、後述するビーンフロー定義ファイルが記憶されるビーンフロー定義ファイル記憶域57や、後述するビーンフローが記憶されるビーンフロー記憶域59や、複数のプログラムモジュールが記憶されるプログラムモジュール記憶域61や、後述するインターセプタ定義ファイルが記憶されるインターセプタ定義ファイル記憶域63や、複数のEJBがデプロイされたEJBコンテナ14が備えられる。各記憶域57、59、61及び63は、上述した記憶資源上に設けられるものである。プログラムモジュール記憶域61に記憶されるプログラムモジュールには、例えば、ビーンや、インターセプタ(これも、ビーンであってもよい)等がある。その記憶域61に記憶されるビーンは、後述する工夫により、EJBではなくPOJO(Plain Old Java Object)とすることができる。EJBコンテナ14にデプロイされた複数のEJBとして、例えば、ファサード層EJB51と、トランザクション分離層EJB53と、ビーンフロー実行層EJB55とがある。各EJB51、53及び55、後述するビーンやインターセプタ等の種々のコンピュータプログラムは、例えば、記憶資源からCPUに読み込まれることにより実行される。
The EJB server 7 has a bean flow definition
ファサード層EJB51は、呼び出し元(この実施形態ではWEBサーバ5)にとっての呼出し口となるものであり、呼び出し元から発行されるファサードバリューを受けて解釈するEJBである。ファサードバリューの記述内容に関わらず、同一のファサード層EJB51が呼び出される。換言すれば、ファサードバリューで定義されたフローがどんなものであっても、ファサードバリューの受付口は、この一つのファサード層EJB51で済む。こうすることができた理由については、後に詳細に説明する。
The
トランザクション層EJB53は、ファサードバリューで定義されているユニットオブワークを処理するEJBである。ユニットオブワークについては後に詳述する。
The
ビーンフロー実行層EJB55は、ファサードバリューで定義されているコマンドオブジェクトを処理するEJBである。コマンドオブジェクトについても後に詳述する。
The bean flow
上述した3つのEJB51、53及び55や、プログラムモジュール記憶域61に記憶されているビーンは、CPU33に読み込まれることにより動作することができる。また、EJBサーバ7が、複数台のコンピュータシステムにより構築された分散型システムの場合には、各コンピュータシステムの各CPUに読み込まれることにより、EJB51、53又は55や、プログラムモジュール記憶域61に記憶されているプログラムモジュールが動作することができる。
The three
EJBの種類は幾つかあるが、上述したEJB51、53及び55は、いずれも、ステートレスセッションビーン(つまり、状態値を保持しないタイプのEJB)である。
Although there are several types of EJBs, the above-described
EJB51、53及び55のうち、ファサード層EJB51及びビーンフロー実行層EJB55は、第一の属性として、例えば「Required」という属性を有し、トランザクション層EJB53は、第二の属性として、例えば「Requires New」という属性を有する。属性「Required」を有するEJBは、呼び出し元のトランザクションに参加する性質(具体的には、呼出し元に返って初めてコミットする性質)を持つ。属性「Requires New」を有するEJBは、呼び出し元のトランザクションには参加せずに、呼出しの範囲内で(すなわち、属性「Requires New」のEJBのメソッドを読んだ範囲内で)、新たに独立したトランザクションを作成する性質を持つ。例えば、属性「Requires New」を有するEJBは、第一のEJBから呼ばれて、第二のEJBを呼び出した場合、第一のEJBのトランザクションには参加せずに、第二のEJBのトランザクションを完結させる。これにより、例えば、第一のEJBの処理で障害が発生した場合、第一のEJBのトランザクションについてはロールバックが行われるが、第二のEJBのトランザクションは完結しているので、その第二のEJBのトランザクションまでロールバックされない。
Among the
以上が、この実施形態に係るシステムでのソフトウェア構成の概要である。以下、そのシステムで行われる処理の流れの概要について説明する。 The above is the outline of the software configuration in the system according to this embodiment. Hereinafter, an outline of the flow of processing performed in the system will be described.
図3は、図2に示したシステムで行われる処理の流れの概要を示す。 FIG. 3 shows an outline of the flow of processing performed in the system shown in FIG.
外部アプリケーション45は、WEBブラウザ43から何らかの指示を受ける(ステップS1)。外部アプリケーション45は、例えば、WEBブラウザ43に表示される画面の画面構成の変更の指示、或いは、ユーザが指定した銀行口座からの出金の指示など、様々な指示を受付けることができる。
The
外部アプリケーション45は、受けた指示を解析し、ファサードバリュー選択プログラム47により、その解析結果に対応するファサードバリュー46をファサードバリュー記憶域49(つまり、複数のファサードバリューの中)から検索する(S2)。そして、外部アプリケーション45は、検索ヒットしたファサードバリュー46をファサードバリュー記憶域49から取得し(S3)、ファサード層EJB51を呼び出して、取得したファサードバリュー46をファサード層EJB51に送信する(S4)。
The
ファサード層EJB51は、外部アプリケーション45から呼び出されてファサードバリュー46を受信し、受信したファサードバリュー46を解析し、その解析結果に応じて、トランザクション分離層EJB53及びビーンフロー実行層EJB55のうちのどちらを呼び出すかを選択し、選択したEJB53又は55を呼び出して処理を依頼する。具体的には、ファサード層EJB51は、上記解析の結果、後述するユニットオブワーク(トランザクション境界オブジェクト)を検出した場合には、トランザクション分離層EJB53を呼び出してユニットオブワークの処理を依頼し、そうではなく、後述するコマンドオブジェクトを検出した場合には、ビーンフロー実行層EJB55を呼び出してそのコマンドオブジェクトの処理を依頼する。トランザクション分離層EJB53は、ユニットオブワークの処理の際、そのユニットオブワーク内にある別のユニットオブワークを検出した場合には、自分を呼び出してその別のユニットオブワークの処理を行い(つまり再帰的に処理を行い)、そのユニットオブワーク内にあるコマンドオブジェクトを検出した場合には、ビーンフロー実行層EJB55を呼び出してそのコマンドオブジェクトの処理を依頼する。ビーンフロー実行層EJB55は、依頼されたコマンドオブジェクトの処理を実行する。以上のようにして、EJBサーバ7において、ファサード層EJB51が受信したファサードバリュー46の記述に応じた処理が行われる(S5)。
The
本実施形態では、上述したように、ファサードバリュー46で定義されたフローがどんなものであっても、ファサードバリュー46を解釈することができるファサード層EJB51が一つあれば、呼出し口はこの一つで済む。以下、ファサードバリュー46の構成、並びに、そのファサードバリュー46が処理される際に行われる処理流れ(つまり、上記S5の詳細の一例)について説明する。
In the present embodiment, as described above, if there is one
図4Aは、ファサードバリューの構成の一例を示す。 FIG. 4A shows an example of the configuration of the facade value.
ファサードバリュー46には、ユニットオブワークと、コマンドオブジェクトとの両方を記述することができる。
In the
ユニットオブワークは、トランザクションの境界(別の言い方をすれば「分離」)を表すオブジェクトである。一つのユニットオブワーク内には、別のユニットオブワークを記述することもできるし、一又は複数のコマンドオブジェクトを記述することもできる。 A unit of work is an object that represents a transaction boundary (in other words, “separation”). Another unit of work can be described in one unit of work, and one or a plurality of command objects can be described.
コマンドオブジェクトは、一つのコマンドに対応するオブジェクトであり、後述するビーンフローを特定するためのキー(例えばコマンド名)を含み、そのキーに対応するビーンフローの実行を指示するためのものである。コマンドオブジェクトは、例えば、図示のように、ビーンフローキー72、入力オブジェクト74、出力オブジェクト76及び例外オブジェクト78を含む。ビーンフローキー72は、ビーンフロー記憶域59から、ビーンフローを取得するためのキーである。ビーンフローキー72は、プログラムモジュール記憶域61からインターセプタを取得するキーとして使用することもできる。入力オブジェクト74は、このコマンドオブジェクトで指定されたコマンド(ビーンフロー)を実行するビーンに入力することができるオブジェクトである。出力オブジェクト76は、そのコマンドの実行結果を保持することができるオブジェクトである。例外オブジェクト78は、そのコマンドの実行中に発生した例外を保持することができるオブジェクトである。
The command object is an object corresponding to one command, and includes a key (for example, command name) for specifying a bean flow to be described later, and is for instructing execution of the bean flow corresponding to the key. The command object includes, for example, a
ファサードバリューに記述されたユニットオブワークやコマンドオブジェクトは、ファサードバリューの先頭から順に処理される。このため、ファサードバリュー上で、コマンドオブジェクトとユニットオブワークとをどのように配列するかや、そのユニットオブワーク内にコマンドオブジェクト(或いはユニットオブワーク)をどのように配列するかによって、トランザクションのフローを定義することができる。すなわち、ファサードバリューにより、呼び出し元(この実施形態ではWEBサーバ)からトランザクションのコントロールを行うことができる。以下、一つの具体例を説明する。 The unit object and command object described in the facade value are processed in order from the top of the facade value. Therefore, depending on how the command object and unit of work are arranged on the facade value, and how the command object (or unit of work) is arranged in the unit of work, the flow of the transaction Can be defined. That is, a transaction can be controlled from a caller (a WEB server in this embodiment) by using a facade value. Hereinafter, one specific example will be described.
例えば、呼出し元が、コマンド(ビーンフロー)A、B及びCを実行させたいとする。但し、コマンドAとコマンドCの実行は、呼出し元から独立したトランザクションとして実行させ、コマンドBの実行は、呼出し側のトランザクションに参加させたいとする。 For example, assume that the caller wants to execute commands (bean flow) A, B, and C. However, it is assumed that the execution of the command A and the command C is executed as a transaction independent from the caller, and the execution of the command B is desired to participate in the caller transaction.
トランザクションの分離は、トランザクションを分離するためのオブジェクトであるユニットオブワークを利用することで行う。すなわち、上記例のようなトランザクションコントロールを行うためには、図4Aに示すように、ファサードバリュー46におけるオブジェクト群の先頭に、コマンドAを実行するためのコマンドオブジェクトAを内包した第一のユニットオブワーク10Aを記述し、その第一のユニットオブワーク10Aの次に、ユニットオブワークに内包させずにコマンドBを実行するためのコマンドオブジェクトBを記述し、そのコマンドオブジェクトBの次に、コマンドCを実行するためのコマンドオブジェクトCを内包した第二のユニットオブワーク10Bを記述する必要がある。
Transaction separation is performed by using a unit of work which is an object for separating transactions. That is, in order to perform the transaction control as in the above example, as shown in FIG. 4A, the first unit object including the command object A for executing the command A at the head of the object group in the
図4Aに示したファサードバリュー46が外部アプリケーション(以下、外部AP)45からEJBサーバ7に送信されたならば、EJBサーバ7では、図4Bに示す流れで処理が行われる。
If the
図4Bは、図4Aに示したファサードバリュー46の処理流れを示す。
FIG. 4B shows a processing flow of the
外部AP45からファサード層EJB51が呼び出されてファサードバリュー46が送信された場合(図3及び図4BのS4)、ファサード層EJB51がそのファサードバリュー46を受信して、そのファサードバリュー46の記述に従う処理が行われる(図3のS5)。
When the
具体的には、ファサード層EJB51は、受信したファサードバリュー46を解析する。それにより、第一のユニットオブワーク10A、コマンドオブジェクトB及び第二のユニットオブワーク10Bの順でフローが構成されていることが検出される。
Specifically, the
第一のユニットオブワーク10Aが検出された場合、ファサード層EJB51は、トランザクション分離層EJB53を呼出し、その第一のユニットオブワーク10Aの処理を、トランザクション分離層EJB53に依頼する(S5A)。
When the first unit of
呼び出されたトランザクション分離層EJB53は、ファサード層EJB51からの依頼に従って、第一のユニットオブワーク10Aの処理を行う。具体的には、例えば、トランザクション分離層EJB53は、第一のユニットオブワーク10Aを解析する。第一のユニットオブワーク10Aには、コマンドオブジェクトAが含まれているので、そのコマンドオブジェクトAが検出される。コマンドオブジェクトAが検出された場合、トランザクション分離層EJB53は、ビーンフロー実行層EJB55を呼出し、そのコマンドオブジェクトAの処理をビーンフロー実行層EJB55に依頼する(S5B)。
The called transaction
呼び出されたビーンフロー実行層EJB55は、トランザクション分離層EJB53からの依頼に従って、コマンドオブジェクトAから特定されるコマンド(ビーンフロー)の処理を実行し(S5C)、応答(例えば処理結果)を、呼び出し元であるトランザクション分離層EJB53に返す(S5D)。
The called bean flow
トランザクション分離層EJB53は、呼び出し先のビーンフロー実行層EJB55から応答を受けた場合、S5Bで処理依頼したコマンドオブジェクトAについてコミットする(S5E−1〜S5E−3)。
When receiving a response from the callee bean flow
具体的には、トランザクション分離層EJB53は、呼び出し先のビーンフロー実行層EJB55から応答を受け、コミットの準備ができた場合、その旨を、自分の呼び出し元であるファサード層EJB51に通知する(S5E−1)。ファサード層EJB51は、コミットの準備ができた旨の通知を受けた場合、トランザクション分離層EJB53に所定の指令(例えば、コミットの実行指令)を送る(S5E−2)。トランザクション分離層EJB53は、ファサード層EJB51から所定の指令を受けたときに、コマンドオブジェクトAについてコミットする。そして、トランザクション分離層EJB53は、コミットが完了した旨の通知を、ファサード層EJB51に送る(S5E−3)。これにより、ファサード層EJB51は、コマンドオブジェクトAについての処理から抜けることができる。
Specifically, when the transaction
このように、ユニットオブワークがファサード層EJB51で検出された場合、ファサード層EJB51に依頼されたトランザクションの処理(つまり、そのユニットオブワークが表すトランザクションの処理)が、ファサード層EJB51からトランザクション分離層EJB53に新たに依頼される。そして、その新たな依頼先は、「Requires New」という属性を持つEJBであり、その「Requires New」のEJB53から、そのユニットオブワーク内のコマンドオブジェクトの処理依頼が、「Required」という属性を持ったビーンフロー実行層EJB55に発行される。このため、ファサード層EJB51は、「Required」という属性であるが、ユニットオブワークが表すトランザクションの処理では、呼出し元である外部AP45のトランザクションに参加しなくて済む。つまり、トランザクションが分離される。
As described above, when the unit of work is detected in the
次に、第一のユニットオブワーク10Aの次に記述されているコマンドオブジェクトBの処理が行われる。すなわち、ファサード層EJB51が、ビーンフロー実行層EJB55を呼出し、コマンドオブジェクトBの処理をビーンフロー実行層EJB55に依頼する(S5F)。呼び出されたビーンフロー実行層EJB55は、その依頼に従って、コマンドオブジェクトBを処理し(S5G)、応答(例えば処理結果)を、呼出し元であるファサード層EJB51に返す(S5H)。
Next, the command object B described next to the first unit of
次に、コマンドオブジェクトBの処理が成功したか否かに関わらず、コマンドオブジェクトBの次に記述されているオブジェクトについての処理が行われる。つまり、ここでは、第二のユニットオブワーク10Bの処理が行われる。第二のユニットオブワーク10Bについての処理流れは、前述した第一のユニットオブワーク10Aについての処理流れS5A〜S5E−3と同様である(S5I〜S5M−3)。
Next, regardless of whether the processing of the command object B is successful, the processing for the object described next to the command object B is performed. That is, here, the processing of the second unit of
ファサード層EJB51は、コマンドオブジェクトBのコミットの準備ができたならば、S5M−3の後(若しくは、S5H以降のファサード層EJB51の任意のタイミングで)、外部AP45に対して、その旨を通知する(S5N−1)。外部AP45は、コミットの準備ができた旨の通知をファサード層EJB51から受けた場合、所定の指令(例えばコミットの実行指令)をファサード層EJB51に送る(S5N−2)。ファサード層EJB51は、その指令を受けたときに、コマンドオブジェクトBについてコミットし、コミットが完了した場合に、所定の通知(例えばコミットの完了通知)を、外部AP45に送る(S5N−3)。
When the preparation of the command object B is ready, the
以上の流れで、図4Aに例示したファサードバリュー46が処理される。このように、トランザクションを分離することができるので、例えば、コマンドオブジェクトBの処理が失敗しロールバックが起こっても、コマンドオブジェクトAの処理までロールバックさせずに独立して処理を行わせることができる。つまり、呼び出し側のトランザクションから独立させたい処理は、ユニットオブワークで実行し、呼び出し側のトランザクションに参加させたい処理は、ユニットオブワークに包んでいないコマンドオブジェクトで実行する。
With the above flow, the
次に、EJB51、53及び55がそれぞれ行う処理の流れについて個々に説明する。
Next, the flow of processing performed by each of the
図5Aは、ファサード層EJB51が行う処理の流れを示す。 FIG. 5A shows the flow of processing performed by the facade layer EJB51.
ファサード層EJB51は、ファサードバリューを受信した場合(S11でYES)、そのファサードバリューを解析する(S12)。それにより、オブジェクトの実行順序がわかる。
When receiving the facade value (YES in S11), the
今回処理すべきオブジェクトがユニットオブワークであれば(S13でYES)、ファサード層EJB51は、トランザクション分離層EJB53を呼び出し、そのユニットオブワークの処理をトランザクション分離層EJB53に依頼する(S14)。ファサード層EJB51は、その依頼に対する応答を受けた場合(S15でYES)、特定の処理を行う(例えば上記S5E−2を行う)(S15A)。S11で受けたファサードバリュー内の全てのオブジェクトが処理されたならば(S17でYES)、ファサード層EJB51は、ファサードバリューの受信待ちとなり、そうではなく未処理のオブジェクトが残っていれば(S17でNO)、S13に戻る。
If the object to be processed this time is a unit of work (YES in S13), the
今回処理すべきオブジェクトがコマンドオブジェクトであれば(S13でNO)、ファサード層EJB51は、ビーンフロー実行層EJB55を呼び出し、そのコマンドオブジェクトの処理をビーンフロー実行層EJB55に依頼する(S16)。その後、特定の処理が行われた後(例えば、上記のS5H及びS5N−1〜S5N−3の処理が行われた後)(S16A)、S17の処理が行われる。
If the object to be processed this time is a command object (NO in S13), the
図5Bは、トランザクション分離層EJB53が行う処理の流れを示す。
FIG. 5B shows the flow of processing performed by the transaction
トランザクション分離層EJB53は、呼び出された場合(S20でYES)、処理依頼されたユニットオブワークを解析する(S21)。
When the transaction
S21の解析の結果、コマンドオブジェクトが検出されたならば(S22でNO)、トランザクション分離層EJB53は、ビーンフロー実行層EJB55を呼び出し、そのコマンドオブジェクトの処理をビーンフロー実行層EJB55に依頼する(S24)。その後、応答を受けたならば(S25でYES)、トランザクション分離層EJB53は、特定の処理を行う(例えば、上記S5E−1〜S5E−3の処理を行う)(S26)。
If a command object is detected as a result of the analysis in S21 (NO in S22), the transaction
S21の解析の結果、ユニットオブワークが検出されたならば(S22でYES)、トランザクション分離層EJB53は、自分を呼び出し(S23)、S21に戻る。つまり、ユニットオブワーク内にユニットオブワークが検出された場合には、再帰的に処理が行われる。
If the unit of work is detected as a result of the analysis in S21 (YES in S22), the transaction
図5Cは、ビーンフロー実行層EJB55が行う処理の流れを示す。 FIG. 5C shows the flow of processing performed by the bean flow execution layer EJB55.
ビーンフロー実行層EJB55は、呼び出された場合(S31でYES)、処理依頼されたコマンドオブジェクトの処理を行い(S22)、応答(例えば処理結果)を、自分の呼び出し元(ファサード層EJB51又はトランザクション分離層EJB53)に返す(S33)。なお、S22の処理で例外(例えばエラー)が発生した場合には、ビーンフロー実行層EJB55は、ファサードバリューの送信元であるWEBサーバに、応答(例えば例外オブジェクト)を返すことができる。
When the bean flow
以上の説明によれば、ユニットオブワーク内に何を記述するかや、コマンドオブジェクトやユニットオブワークの配列をどうするかによって、ファサードバリュー上で、トランザクションのフローを定義することができる。EJBサーバ7には、そのファサードバリューを受けて解析するファサード層EJB51と、ユニットオブワークを処理するトランザクション分離層EJB53と、コマンドオブジェクトを処理するビーンフロー実行層EJB55とが備えられる。ファサード層EJB51及びビーンフロー実行層EJB55の属性は「Required」であり、トランザクション分離層EJB53の属性は「Requires New」である。ユニットオブワークに包まれていないコマンドオブジェクトの処理の依頼は、ファサード層EJB51からトランザクション分離層EJB53を介することなくビーンフロー実行層EJB55にされるが、ユニットオブワークに包まれたコマンドオブジェクトの処理の依頼は、ファサード層EJB51からトランザクション分離層EJB53を介してビーンフロー実行層EJB55にされる。以上のことにより、EJBをたくさんつくらなくても、呼び出し側でのファサードバリューの構成の仕方で、複雑なEJBの規約に関係無く、呼び出し側からEJBサーバ7に対してトランザクションのフローをコントロールすることができる。例えば、図6Aに例示するようなファサードバリューを作成してEJBサーバ7に与えれば、図6Bに例示するようなトランザクションフローを実行させることができる(図6Bにおける点線は、トランザクション境界を示す)。
According to the above description, it is possible to define a transaction flow on the facade value depending on what is described in the unit of work and how the command object and unit of work are arranged. The EJB server 7 is provided with a
なお、上記の説明では、ファサード層EJB51が、ファサードバリューの送信の際に呼び出されるが、それに代えて、例えば、ファサードバリューを蓄積するためのキューをEJBサーバ7に設け、EJBサーバ7で受信されたファサードバリューはそのキューに蓄積され、ファサード層EJB51が、順次、そのキューからファサードバリューを読み出して処理することもできる。すなわち、ステートレスな処理において、同期・非同期を気にしなくて済む。
In the above description, the
さて、以下、上述したビーンフロー実行層EJB55が行うことのできる処理について詳細に説明する。
Now, processing that can be performed by the above-described bean flow
図7Aは、ビーンフロー実行層EJB55が行うことのできる一つの処理の流れを示す。 FIG. 7A shows the flow of one process that can be performed by the bean flow execution layer EJB55.
この図7Aに示すように、ビーンフロー実行層EJB55は、ビーンフロー定義ファイル記憶域57に記憶されている一以上のビーンフロー定義ファイルの中から一つのビーンフロー定義ファイル81を選択し、選択したビーンフロー定義ファイル81を読み出す(S41)。そして、ビーンフロー実行層EJB55は、読み出したビーンフロー定義ファイル81を解釈し、その解釈の結果に基づいて、ビーンフロー83を作成し、作成したビーンフロー83を、ビーンフロー記憶域59に格納する(S42)。
As shown in FIG. 7A, the bean flow
これにより、一又は複数のビーンフローがビーンフロー記憶域59に記憶される。
As a result, one or more bean flows are stored in the bean
図7Bは、ビーンフロー定義ファイル81の構成の概要を示す。
FIG. 7B shows an outline of the configuration of the bean
ビーンフロー定義ファイル81は、所定の形式のファイル、例えば、XML(eXtensible Markup Language)形式のファイルである。ビーンフロー定義ファイル81は、例えば、コマンドオブジェクトと一対一で用意される。ビーンフロー定義ファイル81には、ビーンフローの定義が記述されている。ビーンフロー定義ファイル81には、一又は複数のビーンフローを定義することができる。つまり、一つのコマンドオブジェクトで、一つのビーンフローだけでなく、複数のビーンフローを実行させるようにすることができる。
The bean
一つのビーンフローの定義90の中には、例えば、ビーンフローの名称である「フロー名」、ビーンフローの偽の名前である「エイリアス名」、ビーンフローの実行の際に確保されるべきリソースに関する「リソース情報」、及び、ビーンフローを構成するビーンの実行に関する「実行単位記述」が含まれる。
The
エイリアス名は、例えば、呼び出し側の管理者或いはEJBサーバ7の管理者が、登録することができる。エイリアス名は、一つのビーンフローに複数個登録することもできる。このため、呼び出し元は、EJBサーバ7に対してエイリアス名でビーンフローを指定すれば、異なるエイリアス名であっても同一のビーンフローを実行させることができる。 The alias name can be registered, for example, by the administrator on the call side or the administrator of the EJB server 7. Multiple alias names can be registered in one bean flow. For this reason, if the caller specifies a bean flow with an alias name for the EJB server 7, the same bean flow can be executed even with different alias names.
リソース情報には、例えば、リソースの名称である「リソース名」や、リソースを取得する際のキーとなる「リソースキー」が含まれる。また、リソース情報には、ビーンフローがリソースに対してフローコントロールを行うか否か(例えば、正常終了時にリソースに対してコミットを指示し、異常終了時にロールバックをリソースに対して指示するか否か)を表す情報や、確保されたリソースをビーンフローの終了時にクローズするか否かを表す情報等も含めることができる。 The resource information includes, for example, a “resource name” that is the name of the resource and a “resource key” that is a key for acquiring the resource. Also, in the resource information, whether or not the bean flow performs flow control on the resource (for example, whether to instruct the resource to commit at the normal end and whether to instruct the resource to roll back at the abnormal end) Or information indicating whether or not the reserved resources are closed at the end of the bean flow.
実行単位記述には、例えば、実行単位の名称である「実行単位名」や、実行するビーンの「クラス名」や、実行するビーンの「メソッド名」や、実行単位の出力オブジェクトを取得するゲッターの名称である「ゲッター名」や、実行単位の属性に関する「属性情報」が含まれる。一つのビーンフローにおいて複数の実行単位がある場合には、実行単位の実行順序に従って、それら複数の実行単位にそれぞれ対応した複数の実行単位記述が並ぶ。ここで、実行単位とは、クラス名で指定されたビーン(以下、指定ビーン)における、メソッド名で指定されたメソッド(以下、指定メソッド)のことである。また、属性情報には、例えば、指定ビーンのインスタンスを生成して指定メソッドを実行することを意味する第一の属性値と、ビーンフローへの入力オブジェクトを指定ビーンに渡して指定メソッドを実行することを意味する第二の属性値と、直前の実行単位のビーンを指定ビーンに渡して指定メソッドを実行することを意味する第三の属性値との少なくとも一つを含めることができる。 The execution unit description includes, for example, an “execution unit name” that is the name of the execution unit, a “class name” of the bean to be executed, a “method name” of the bean to be executed, and a getter that acquires an output object of the execution unit. The “getter name” that is the name of the name and “attribute information” regarding the attribute of the execution unit are included. When there are a plurality of execution units in one bean flow, a plurality of execution unit descriptions respectively corresponding to the plurality of execution units are arranged according to the execution order of the execution units. Here, the execution unit is a method (hereinafter, designated method) designated by a method name in a bean designated by a class name (hereinafter, designated bean). The attribute information includes, for example, a first attribute value that means that an instance of the specified bean is generated and the specified method is executed, and an input object to the bean flow is passed to the specified bean and the specified method is executed. At least one of the second attribute value meaning that the bean of the previous execution unit is passed to the designated bean and the designated method is executed can be included.
図8A、図8B及び図8Cは、ビーンフロー定義ファイル81における記述の具体例を示す。具体的には、図8Aは、一つのビーンフローが一つの実行単位を実行するための記述の一例である。図8Bは、一つのビーンフローが二つの実行単位を実行し、且つ、二つ目の実行単位で一つの実行単位におけるビーンから値を取得するための記述の一例である。図8Cは、一つのビーンフローが一つの実行単位を実行し、且つ、入力オブジェクトのメソッドを実行してその実行結果をそのビーンフローの出力オブジェクトとして返すための記述の一例である。
8A, 8B, and 8C show specific examples of descriptions in the bean
ビーンフロー定義ファイル81は、XML等の構造化タグ言語で表すことができる。ビーンフロー定義ファイル81を解釈するビーンフロー実行層EJB55は、どんなタグがあるかによって、生成すべきビーンフローを決定する。
The bean
以下、幾つかのタグについて説明する。 Hereinafter, some tags will be described.
タグ「flow」で設定された範囲には、一つのビーンフローの定義が表される。ここにおける「name」は、ビーンフローの名称(flow name)を表している。タグ「flow」で設定された範囲には、複数のリソース要素、エイリアス要素、ステップ要素(実行単位要素)を含む。 The range set by the tag “flow” represents one bean flow definition. Here, “name” represents the name of the bean flow (flow name). The range set by the tag “flow” includes a plurality of resource elements, alias elements, and step elements (execution unit elements).
タグ「resource」で設定された範囲には、リソース情報が表される。具体的には、リソースの取得や、リソースに対するコミット或いはロールバック等のフローコントロールをビーンフローが行う(換言すれば、ビーンそれ自体がリソースの取得やフローコントロールを行うことを排除する)ために、このリソース情報を使用して、リソースの取得とフローコントロールがビーンフローによって行われる。ここのタグで設定された範囲における「name」は、リソースの名前(resource name)を表し、「key」は、リソースを取得する際のキーを表す。「trancontrol」及び「tranclose」は、リソースに対して何を行うかをビーンフローに設定するための情報である。「trancontrol」は、属性値「true」の場合、ビーンフローがリソースに対してフローコントロールを行うことを意味する(すなわち、ビーンフローの全ての実行単位が正常に終了した場合、リソースに対してコミットを指示し、ビーンフローの実行中に例外が発生したならば、リソースに対してロールバックを指示することを意味する)。また、「trancontrol」は、属性値「false」の場合、ビーンフローがリソースに対してフローコントロールは行わないようにすることを意味する。「tranclose」は、属性値「true」の場合、ビーンフローの終了時に、ビーンフローがリソースに対してクローズを実行することを意味する。「tranclose」は、属性値「false」の場合、ビーンフローはリソースに対してクローズは実行しない。なお、「trancontrol」及び「tranclose」のうちの少なくとも一方は属性値の記述が省略可能であり、省略されている場合には、一方の属性値(例えばtrue)が設定されているものとして扱われる。 Resource information is represented in the range set by the tag “resource”. Specifically, in order to perform flow control such as resource acquisition, resource commit or rollback (in other words, the bean itself excludes resource acquisition and flow control), Using this resource information, resource acquisition and flow control are performed by bean flow. “Name” in the range set by the tag here represents the name of the resource (resource name), and “key” represents the key for acquiring the resource. “Trancontrol” and “tranclose” are information for setting in the bean flow what to do with the resource. "Trancontrol" means that if the attribute value is "true", the bean flow performs flow control on the resource (that is, if all the execution units of the bean flow are completed normally, commit to the resource) This means that if an exception occurs during the execution of the bean flow, the resource is instructed to roll back). “Trancontrol” means that when the attribute value is “false”, the bean flow does not perform flow control on the resource. “Tranclose”, when the attribute value is “true”, means that when the bean flow ends, the bean flow executes close on the resource. When “tranclose” has an attribute value “false”, the bean flow does not perform closing on the resource. Note that at least one of "trancontrol" and "tranclose" can be omitted, and if omitted, one attribute value (for example, true) is treated as being set. .
タグ「alias」で設定された範囲には、エイリアス名(alias name)が設定される。 An alias name (alias name) is set in the range set by the tag “alias”.
タグ「step」で設定された範囲には、任意のビーンの任意のメソッドを1つのビーンフロー中に関連付けて動作させることを定義することができる。また、ビーンフロー中の各実行単位(ステップ)は、名前を有し、他の実行単位(又はそこでのビーン)を名前で参照することができる。ここの範囲における「name」は、実行単位の名前を表し、「class Name」は、実行単位で実行するビーンのクラス名を表し、「method Name」は、実行単位で実行するビーンのメソッドの名前を表す。また、「getter Name」は、実行単位の出力オブジェクトを取得するゲッターの名称を表す。ここで、「this」を指定された場合、実行単位で実行したビーンそのものが出力オブジェクトとなることを意味する。また、「type」は、実行単位でのメソッドの実行に関する属性を表す。具体的には、例えば、属性値「new」の場合、「className」で指定されたビーンのインスタンスを生成し、「methodName」で指定されたメソッドを実行することを意味する。また、例えば、属性値「input」の場合、ビーンフローへの入力オブジェクトを「className」で指定されたビーンに渡し「methodName」で指定されたメソッドがその入力オブジェクトを用いて処理を実行することを意味する。また、例えば、属性値「step」の場合、直前の実行単位の出力値を「className」で指定されたビーンに渡し、「methodName」で指定されたメソッドがその出力値を用いて処理を実行することを意味する。 In the range set by the tag “step”, it is possible to define that any method of any bean is operated in association with one bean flow. Each execution unit (step) in the bean flow has a name, and other execution units (or beans therein) can be referred to by name. In this range, “name” represents the name of the execution unit, “class Name” represents the class name of the bean that is executed in the execution unit, and “method Name” is the name of the method of the bean that is executed in the execution unit. Represents. “Getter Name” represents the name of the getter that acquires the output object of the execution unit. Here, when “this” is specified, it means that the bean itself executed in the execution unit becomes the output object. “Type” represents an attribute related to the execution of a method in an execution unit. Specifically, for example, when the attribute value is “new”, it means that an instance of the bean specified by “className” is generated and the method specified by “methodName” is executed. Also, for example, in the case of the attribute value “input”, the input object to the bean flow is passed to the bean specified by “className”, and the method specified by “methodName” executes processing using the input object. means. Also, for example, in the case of the attribute value “step”, the output value of the previous execution unit is passed to the bean specified by “className”, and the method specified by “methodName” executes processing using the output value. Means that.
以上のようなタグや属性値をビーンフロー定義ファイルでどのように設定するかによって、例えば、後述する図11A〜図11Eに例示するような処理を実行できるビーンフローの作成が可能となる。 Depending on how the tags and attribute values as described above are set in the bean flow definition file, for example, it is possible to create a bean flow that can execute the processes illustrated in FIGS. 11A to 11E described later.
なお、ビーンフロー定義ファイルに複数のビーンフローが定義されている場合には、例えば、<flows>というタグが、複数のビーンフロー定義よりも前に記述される。ビーンフロー実行層EJB55は、このタグから、ビーンフローを生成するビーンフロー実行層EJB55が、ビーンフロー定義ファイル81に、一つのビーンフローが定義されているのか、或いは、複数のビーンフローが定義されているのかを判別することができる。
When a plurality of bean flows are defined in the bean flow definition file, for example, a tag <flows> is described before the plurality of bean flow definitions. From the tag, the bean flow
ビーンフロー実行層EJB55は、以上のようなビーンフロー定義ファイルを解釈し、そのビーンフロー定義ファイル上で定義されている通りのビーンフロー83を作成する。一つのビーンフロー定義ファイルに複数のビーンフロー定義があれば、それら複数のビーンフロー定義にそれぞれ対応した複数のビーンフローが作成される。
The bean flow
図9Aは、ビーンフローの構成例を示す。 FIG. 9A shows an example of a bean flow configuration.
ビーンフロー83は、一又は複数のビーンを実行させるためのオブジェクトである。一つのビーンフロー83は、ビーンフロー定義ファイル81の一つのビーンフロー定義90に対応する。ビーンフロー83には、対応するビーンフロー定義90で表されているビーンフロー名、エイリアス名及びリソース情報が設定される。また、ビーンフロー83には、対応するビーンフロー定義90で表されている複数(例えば3つ)の実行単位記述にそれぞれ対応した複数(例えば3つ)の実行単位設定86A、86B及び86Cがセットされる。複数の実行単位設定86A、86B及び86Cは、実行単位の実行順序に従って並べられる。各実行単位設定86A、86B、86Cには、その実行単位設定に対応した実行単位記述で表されている種々の設定要素(例えば、実行単位名、クラス名、メソッド名、属性情報)がセットされる。
The
ビーンフロー実行層EJB55は、コマンドオブジェクトの処理依頼を受けた場合、そのコマンドオブジェクトに対応するビーンフロー83がどれであるかを特定し、特定されたビーンフロー83を実行することができる。
When receiving the command object processing request, the bean flow
図9Bは、コマンドオブジェクトの処理依頼を受けた場合にビーンフロー実行層EJB55が行う処理の流れを示す。
FIG. 9B shows the flow of processing performed by the bean flow
ビーンフロー実行層EJB55は、コマンドオブジェクトの処理依頼を受けた場合、そのコマンドオブジェクト内のビーンフローキーを参照する(S50)。ビーンフローキーは、ビーンフロー名を表すキーであってもよいし、エイリアス名を表すキーであってもよい。ビーンフロー実行層EJB55は、参照したビーンフローキーがビーンフロー名とエイリアス名とのどちらを表しているかを、例えば、ビーンフローキーに所定のコードが含まれているか否かにより、判別することができる。この場合、例えば、ファサードバリューを作成する呼び出し元側で、コマンドオブジェクトを記述する際に、ビーンフローキーに所定のコードを含めるか否かにより、ビーンフロー名として特定させるか或いはエイリアス名として特定させるかをコントロールすることができる。
When receiving the command object processing request, the bean flow
ビーンフロー実行層EJB55は、参照したビーンフローキーに対応するビーンフロー及びインターセプタの検索を行う(S51)。具体的には、例えば、ビーンフロー実行層EJB55は、参照したビーンフローキーがビーンフロー名を表しているのか、或いは、エイリアス名を表しているのかを判別する。ビーンフロー名を表していると判別された場合、ビーンフロー実行層EJB55は、ビーンフローキーに適合するビーンフロー名を有するビーンフロー83をビーンフロー記憶域59から検索し、且つ、ビーンフローキーとインターセプタ定義ファイル80との比較を行い、その比較により特定されたインターセプタ95をプログラムモジュール記憶域61から取得する。一方、エイリアス名を表していると判別された場合、ビーンフロー実行層EJB55は、ビーンフローキーに適合するエイリアス名を有するビーンフロー83をビーンフロー記憶域59から検索し、且つ、ビーンフローキーとインターセプタ定義ファイル80との比較を行い、その比較により特定されたインターセプタ95をプログラムモジュール記憶域61から取得する。
The bean flow
ビーンフロー実行層EJB55は、S51で検索されたビーンフロー83及びインターセプタ95を実行する(S52)。ここでは、例えば、S51で複数のビーンフロー83が検索ヒットした場合(具体的には、ビーンフロー定義ファイル81に複数のビーンフロー定義90があったことにより複数のビーンフロー83が取得された場合)、ビーンフロー実行層EJB55は、それら複数のビーンフロー83を、ビーンフロー定義ファイル81で定義されている順番で実行することができる。どんな順番で実行するかは、例えば、ビーンフロー定義ファイル81を参照することで特定されてもよいし、ビーンフロー83に実行順序が書き込まれていれば、その実行順序から特定されてもよい。ビーンフロー83の実行では、そのビーンフロー83に設定された情報に基づいて、プログラムモジュール61からビーン85が検索され、そのビーン85のインスタンス化や、インスタンス化されたビーン85の実行等が行われる。
The bean flow
ビーンフロー実行層EJB55は、例えば、図10Aに例示する方法により、外部AP45に対してビーンフローの参照を提供することができる。
The bean flow
すなわち、ビーンフロー実行層EJB55は、例えば、各ビーンフロー定義ファイル81を参照することにより、ビーンフロー毎に、エイリアス名とビーンフロー名との対応付けを表した名称変換マップ201を生成する。
That is, the bean flow
ビーンフロー実行層EJB55は、エイリアス名であるビーンフローキーを含んだビーンフロー取得要求を外部AP45から受け、その要求に応答して、そのビーンフローキー(エイリアス名)に対応するビーンフローの参照(つまりビーンフロー名)を取得し、取得したビーンフロー名を外部AP45に返す。
The bean flow
これにより、外部AP45は、ビーンフローを、エイリアス名だけでなく、ビーンフロー名で指定することができるようになる(なお、格別図示しないが、ビーンフロー実行層EJB55と外部AP45とのやりとりは、ファサード層EJB51を介して行われる)。
As a result, the
エイリアス名或いはビーンフロー名で或るビーンフロー83が指定された場合、そのビーンフロー83は以下のような処理を行う。
When a
図10Bは、ビーンフロー83が行う処理の流れの一例を示す。
FIG. 10B shows an example of the flow of processing performed by the
(1)ビーンフロー83がビーンフロー実行層EJB55から実行指示を受ける。具体的には、例えば、ビーンフロー83で特定されているメソッドが、コマンドオブジェクトの処理依頼を受けたビーンフロー実行層EJB55から、そのコマンドオブジェクト内の入力オブジェクトを引数に、コールされる。
(1) The
(2)ビーンフロー83は、リソース情報に基づいて、リソース群(例えば、メモリ領域、JMS(Java Messaging System)セッション等)92から、リソース名から特定されるリソース94を、リソースキーを用いて取得し確保する。
(2) The
(3)ビーンフロー83は、ビーンフロー83の実行単位設定86A(図9A参照)に基づいて、実行単位88Aを構築する。具体的には、ビーンフロー83は、実行単位設定86A内のクラス名に適合するビーンをプログラムモジュール記憶域61から選択し、選択されたビーンをインスタンス化する(ビーンをロード可能な状態にする)。プログラムモジュール記憶域61に記憶されているビーンは、EJBの規約で作られたビーンではなく、POJOである。その記憶域61に格納されている複数のPOJOには、例えば、データベース38内の検索を行うためのPOJOや、データベース38の更新を行うためのPOJO等、データベース38の操作を行うためのPOJOが含まれている。
(3) The
(4)ビーンフロー83は、実行単位設定86A内の属性情報の全部又は一部を、インスタンス化されたビーン(POJO)に対して設定する。このような処理により、実行単位88Aが構築される。具体的には、例えば、実行単位88Aにおけるビーン(インスタンス化されたビーン)が動作可能な状態となる。
(4) The
(5)以後、ビーンフロー83で定義された処理順(換言すれば、ビーンフロー定義ファイル81で定義された処理順)で処理が行われる。ここでは、ビーン85Aにおける指定メソッドがビーンフロー83により実行される。
(5) Thereafter, processing is performed in the processing order defined in the bean flow 83 (in other words, processing order defined in the bean flow definition file 81). Here, the specified method in the
(6)全ての実行単位が行われた場合、或る実行単位(例えば最後の実行単位)におけるメソッドの処理結果(又は、処理を実行したビーンそれ自体)が、出力オブジェクトとして、ビーンフロー実行層EJB55に返される。 (6) When all execution units are performed, the processing result of the method (or the bean itself that executed the process itself) in a certain execution unit (for example, the last execution unit) is output as the bean flow execution layer. Returned to EJB55.
(7)ビーンフロー83の実行が正常に終了した場合、リソース情報に基づいて、ビーンフロー83が、確保されたリソース94をクローズする(つまり開放する)。また、ビーンフロー83は、例えば、例外(例えば障害)が発生した場合には、ビーンフローの正常終了でなくても、リソース94を開放する。
(7) When the execution of the
前述したように、ビーンフロー定義ファイル81には、複数の実行単位を登録することができる。この場合、例えば、上記(3)〜(5)の処理が、実行単位の数、繰り返される。
As described above, a plurality of execution units can be registered in the bean
ビーンフロー定義ファイル81の記述によって、以下のことも可能である。すなわち、例えば、ビーンフロー定義ファイル81における各実行単位記述で、「第一のビーンによる第一の処理結果が第二のビーンに渡され、その第一の処理結果を受けた第二のビーンがその第一の処理結果を保持し、その第二のビーンの処理結果による第二の処理結果が処理依頼元に返される」というような定義がされていたとする。この場合は、その定義に従って、ビーンフロー83が各ビーンを実行させる。それにより、第一のビーンによる第一の処理結果が第二のビーンに渡され、その第一の処理結果を受けた第二のビーンがその第一の処理結果を保持し、その第二のビーンの処理結果による第二の処理結果が処理依頼元に返される、ということが行われる。
Depending on the description of the bean
以上の一連の処理では、ビーンフロー83は、ビーン85Aを実行する際、確保されたリソース94をビーン85Aの処理の際に利用させるが、リソース94に対するコントロールまではビーン85Aに行わせない。また、例えば、ビーン85Aの処理の際に例外(例えば障害)が発生した場合、そのビーン85Aは、コマンドオブジェクト内の例外オブジェクトを、処理依頼元(或いは大本の呼出し元)に送ってもよい。
In the series of processes described above, the
以上が、ビーンフロー定義ファイル81に従って作成されるビーンフロー83の実行についての説明である。管理者(例えば、EJBサーバ7又はWEBサーバ5の管理者)は、ビーンフロー定義ファイル81のビーンフロー定義90内にどんな情報を設定するかにより、様々なビーンフロー83をEJBサーバ7に作成させること、換言すれば、一つのコマンドオブジェクトで様々な処理をEJBサーバ7に実行させることができる。
This completes the description of the execution of the
例えば、複数個の実行単位を一つのビーンフローで定義することができる。具体的には、例えば、図11Aに例示するように、実行単位名「step1」の実行単位におけるビーンのゲッター(ゲッター名から特定されるもの)が取得した情報と、実行単位名「step2」の実行単位におけるビーンのゲッターが取得した情報とを、実行単位名「step3」の実行単位におけるビーンにセットさせることができる。 For example, a plurality of execution units can be defined by one bean flow. Specifically, for example, as illustrated in FIG. 11A, information acquired by the bean getter (specified from the getter name) in the execution unit of the execution unit name “step1” and the execution unit name “step2” The information acquired by the bean getter in the execution unit can be set in the bean in the execution unit having the execution unit name “step3”.
また、例えば、図11Bに例示するように、実行単位88Dに、コマンドオブジェクト内の入力オブジェクト87Aを入力し、インスタンス化されたビーン85Dに、その入力オブジェクト87Aを用いて処理を実行させることもできる。
Also, for example, as illustrated in FIG. 11B, an
また、例えば、図11Cに例示するように、実行単位88Eに、コマンドオブジェクト内の入力オブジェクト87Bを、ビーンとして、指定メソッドを実行させることもできる。
Further, for example, as illustrated in FIG. 11C, the
また、例えば、図11Dに例示するように、処理を実行したビーン85Eのゲッターを使って、ビーンフローの出力オブジェクト89を取得させることもできる。
For example, as illustrated in FIG. 11D, the bean
また、例えば、図11Eに例示するように、処理を実行したビーン85Fの参照を、ビーンフローの戻り値として、コマンドオブジェクトの処理依頼元(又は大本の呼び出し元)に、返させることもできる。
For example, as illustrated in FIG. 11E, the reference of the
以上、これまでに述べた実施形態の説明から、以下のようなことが言える。 The following can be said from the description of the embodiments described above.
例えば、従来は、EJBサーバによりデータベースの操作を行うためには、エンティティビーンを作成し、EJBコンテナにデプロイする必要がある。 For example, conventionally, in order to operate a database by an EJB server, it is necessary to create an entity bean and deploy it to an EJB container.
しかし、上述した実施形態によれば、3つのEJB51、53及び55により、トランザクションコントロールを行うことができるため、エンティティビーンを作成する必要はない。上記のように、所定の処理を実行するプログラムモジュールを多数個準備しておきさえすれば、後は、ビーンフロー定義ファイル81での定義次第で、ビーンフロー実行層EJB55に、それら多数のプログラムモジュールの中から一又は複数のプログラムモジュールが選択させ、選択された一又は複数のプログラムモジュールの実行順序を決定させ、決定された順序で一又は複数のプログラムモジュールが実行させられる。これにより、例えば、様々なトランザクションコントロールをEJBサーバに行わせたい場合でも、それら様々なトランザクションコントロールをそれぞれ実行させるために様々なエンティティビーンを作成する必要はなくなる。
However, according to the above-described embodiment, since the transaction control can be performed by the three
また、上述した実施形態によれば、ビーンフロー定義ファイル81の定義次第で、例えば、第一のビーンのゲッターで取得した情報を第二のビーンにセットしたり、第一のビーンフローの出力(例えば処理結果)を第二のビーンフローに入力しその出力を用いて第二のビーンフローに処理を実行させたりすることもできる。つまり、こういったことを別の言い方をするのであれば、「ステートフルなビーンをステートレスに表すことができる」と言えよう。すなわち、EJB51、53及び55は、ステートレスなビーンであるが、インスタンス化されるPOJOに入力される属性情報次第で(つまり、ビーンフロー定義ファイル81の定義次第で)、そのPOJOをステートフルなビーンとして動作させることができる。
Further, according to the embodiment described above, depending on the definition of the bean
さて、上述した通り、コマンドオブジェクトに含まれているビーンフローキーから一又は複数のビーンフローが特定されるが、それに加えて、ビーンフローキーに基づいて、一又は複数のインターセプタが特定される。特定された一又は複数のインターセプタによる処理は、特定された一又は複数のビーンフローの実行の前及び後の少なくとも一方で行われる。以下、それに関して詳細に説明する。 As described above, one or more bean flows are specified from the bean flow key included in the command object. In addition, one or more interceptors are specified based on the bean flow key. The processing by the identified one or more interceptors is performed at least one of before and after execution of the identified one or more bean flows. Hereinafter, this will be described in detail.
図12は、インターセプタ定義ファイル91の一例を示す。
FIG. 12 shows an example of the
インターセプタ定義ファイル91は、所定形式のファイル、例えば、XML形式のファイルとすることができる。インターセプタ定義ファイル91には、プログラムモジュール記憶域61に存在する全てのインターセプタ(例えばJava(登録商標)のクラス)についての定義が記述されていてもよい。また、所定の種別毎にインターセプタ定義ファイル91が用意され、各インターセプタ定義ファイル91に、その種別に応じたインターセプタ定義が記述されていてもよい。
The
インターセプタ定義ファイル91には、例えば、多数のインターセプタ95のうちの複数のインターセプタ95の各々について、インターセプタ名と、そのインターセプタ名を持つインターセプタが選択されるための条件(以下、インターセプタ選択条件)とが設定される。図12では、インターセプタ名は、<intercepter-name>と</intercepter-name>とのタグ間に存在する記述であり、インターセプタ選択条件は、<pattern>と</pattern>とのタグ間に存在する記述である。
In the
インターセプタ選択条件は、様々な方法で表し得るが、本実施形態では、キーワードと正規表現(ワイルドカード)との組み合わせで表すことができる。すなわち、この図12に例示するインターセプタ定義ファイル91によれば、インターセプタ名「bank#Inter-cepter-A」というインターセプタ(以下、説明の便宜上、これを「インターセプタA」と称する)は、ビーンフローキーにキーワード「bank.」が含まれてさえいれば選択される。また、インターセプタ名「bank#Inter-cepter-B」というインターセプタ(以下、説明の便宜上、これを「インターセプタB」と称する)は、ビーンフローキーにキーワード「bank.service.」が含まれてさえいれば選択される。また、インターセプタ名「bank#Inter-cepter-C」というインターセプタ(以下、説明の便宜上、これを「インターセプタC」と称する)は、ビーンフローキーにキーワード「bank.service.furikomi」が含まれてさえいれば選択される。また、インターセプタ名「bank#Inter-cepter-D」というインターセプタ(以下、説明の便宜上、これを「インターセプタD」と称する)は、ビーンフローキーにキーワード「master.」が含まれてさえいれば選択される。
The interceptor selection condition can be expressed by various methods, but in this embodiment, it can be expressed by a combination of a keyword and a regular expression (wild card). That is, according to the
なお、例えば、ビーンフローキーが指すものをビーンフロー名とエイリアス名のどちらにするかによって、同一のビーンフローが実行されても、選択されるインターセプタを違えることができる。具体例を言えば、ビーンフロー名「bank.service.」とエイリアス名「master.」とを有したビーンフローがあった場合、ビーンフローキーが「bank.service.」であっても「master.」であっても、そのビーンフローが実行されることになるが、そのビーンフローの実行の際に選択されるインターセプタは異なる。すなわち、ビーンフローキーが「bank.service.」であった場合には、インターセプタA及びBが選択されることになるが、ビーンフローキーが「master.」であった場合には、インターセプタDが選択されることになる。 For example, even if the same bean flow is executed, the interceptor to be selected can be changed depending on whether the bean flow key indicates the bean flow name or the alias name. For example, if there is a bean flow with the bean flow name “bank.service.” And the alias name “master.”, Even if the bean flow key is “bank.service.” ”, The bean flow is executed, but the interceptor selected when the bean flow is executed is different. That is, when the bean flow key is “bank.service.”, Interceptors A and B are selected. When the bean flow key is “master.”, Interceptor D is Will be selected.
以上のようなインターセプタ定義ファイル91では、四つのインターセプタA〜Dの名称とインターセプタ選択条件とが定義されている。そのインターセプタ選択条件に従って複数のインターセプタが選択された場合、例えば、選択された複数のインターセプタがビーンフローの実行の前に実行されるのであれば、選択された複数のインターセプタは、このインターセプタ定義ファイル91での記述の順序で実行される。また、例えば、選択された複数のインターセプタがビーンフローの実行の後に実行されるのであれば、選択された複数のインターセプタは、このインターセプタ定義ファイル91での記述の順序とは逆の順序で実行される。
In the
以下、コマンドオブジェクト内のビーンフローキーに基づいて選択されるインターセプタがA及びBである場合を例に採り、その場合に行われる処理の流れについて説明する。 Hereinafter, the case where the interceptors selected based on the bean flow key in the command object are A and B will be described as an example, and the flow of processing performed in that case will be described.
図13Aは、コマンドオブジェクト内のビーンフローキーに基づいて選択されるインターセプタがA及びBである場合に実行される処理の説明図である。図13Bは、その処理の流れを示す。 FIG. 13A is an explanatory diagram of processing executed when the interceptors selected based on the bean flow key in the command object are A and B. FIG. FIG. 13B shows the flow of the processing.
ビーンフロー実行層EJB55には、インターセプタ管理オブジェクト402と、ビーンフロー実行オブジェクト403とが含まれている。ビーンフロー実行層EJB55は、インターセプタ管理オブジェクト402により、ビーンフローキーとインターセプタ選択条件とに基づいて一以上のインターセプタを選択したり、インターセプタ定義ファイル91での記述に基づいて、上記選択された一以上のインターセプタの実行順序を特定したりすることができる。また、ビーンフロー実行層EJB55は、ビーンフローを実行させるビーンフローオブジェクト403により、ビーンフローキーに適合するビーンフローを実行させることができる。
The bean flow
具体的には、インターセプタ管理オブジェクト402が、インターセプタA及びBの順序で実行することが特定された場合に、まず、インターセプタAを実行させる(S60)。それにより、インターセプタAが、所定の前処理(ビーンフローの実行前に実行すべき所定の処理)を実行し(S61)、その前処理が終わったならば、インターセプタ管理オブジェクト402を呼び出す。次に、インターセプタ管理オブジェクト402が、インターセプタBを実行させる(S62)。それにより、インターセプタBが、所定の前処理を実行し(S63)、その前処理が終わったならば、インターセプタ管理オブジェクト402を呼び出す。最後のインターセプタBから呼び出されたならば、インターセプタ管理オブジェクト402が、ビーンフロー実行オブジェクト403を呼び出す(S64)。呼び出されたビーンフロー実行オブジェクト403は、ビーンフローキーに適合するビーンフローを実行させる。
Specifically, when the
その後、ビーンフローの実行終了が検出されたならば(例えば、ビーンフロー実行オブジェクト403がビーンフローから所定の出力を受けたならば)、ビーンフロー実行オブジェクト403がインターセプタ管理オブジェクト402を呼び出す。呼び出されたインターセプタ管理オブジェクト402は、上記特定された実行順序(前処理の実行順序)とは逆の順序でインターセプタを実行させる。すなわち、インターセプタ管理オブジェクト402は、インターセプタBを実行させる(S66)。インターセプタBにより所定の後処理(ビーンフローの実行後に実行すべき所定の処理)が実行された後(S67)、インターセプタBから呼び出されたならば、インターセプタ管理オブジェクト402は、インターセプタAを実行させる(S68)。インターセプタAにより所定の後処理が行われた後(S69)、インターセプタAから呼び出されたならば、インターセプタ管理オブジェクト402は、情報(例えば、上記選択された一以上のインターセプタの実行結果)を出力する(S70)。
Thereafter, if the end of execution of the bean flow is detected (for example, if the bean
以上の説明によれば、インターセプタ定義ファイル91に設定するキーワードと正規表現との組み合わせにより、コマンドオブジェクトに含まれているビーンフローキーに応じて、実行させる一以上のインターセプタやそれらの実行順序とを違えることができる。
According to the above description, one or more interceptors to be executed and their execution order are determined according to the bean flow key included in the command object by the combination of the keyword set in the
以上、本発明の好適な実施形態を説明したが、これは本発明の説明のための例示であって、本発明の範囲をこの実施形態にのみ限定する趣旨ではない。本発明は、他の種々の形態でも実施することが可能である。例えば、上述の説明では、或る対象を特定するためのキーとして名称が用いられているが、それに限らず、多種のIDが採用されてもよい。また、ファサードバリュー上でのトランザクション境界の定義の仕方は、トランザクション分離の対象となるコマンドオブジェクトをユニットオブワークに内包させる仕方に限らず、例えば、トランザクション分離の対象となるコマンドオブジェクトに所定コードを付加する等の仕方を採用することもできる。 The preferred embodiment of the present invention has been described above, but this is an example for explaining the present invention, and the scope of the present invention is not limited to this embodiment. The present invention can be implemented in various other forms. For example, in the above description, a name is used as a key for specifying a certain target. However, the present invention is not limited to this, and various IDs may be adopted. In addition, the method of defining transaction boundaries on the facade value is not limited to the method of including the command object that is the target of transaction separation in the unit of work. For example, a predetermined code is added to the command object that is the target of transaction separation. It is also possible to adopt a method such as.
1…情報処理サーバ 3…クライアントシステム 5…WEBサーバ 7…EJBサーバ 13、23、33…CPU 15、25、35…メモリ 17、27、37…ハードディスク 38…データベース 43…WEBブラウザ 45…外部アプリケーション 47…ファサードバリュー選択プログラム 49…ファサードバリュー記憶域 51…ファサード層EJB 53…トランザクション分離層EJB 55…ビーンフロー実行層EJB 57…ビーンフロー定義ファイル記憶域 59…ビーンフロー記憶域 61…プログラムモジュール記憶域 63…インターセプタ定義ファイル記憶域
DESCRIPTION OF
Claims (6)
前記処理に対応する一以上のサブ処理を前記要求に基づいて複数のサブ処理の中から選択するサブ処理選択手段と、
前記選択されたサブ処理を前記処理の実行前及び実行後のうちの少なくとも一方で実行するサブ処理実行手段と
を備える情報処理システム。 Processing execution means for executing processing according to the request from the request source;
Sub-process selection means for selecting one or more sub-processes corresponding to the process from a plurality of sub-processes based on the request;
An information processing system comprising: a sub-process executing unit that executes the selected sub-process at least one of before and after the execution of the process.
前記サブ処理選択手段は、前記要求に適合する一以上のサブ処理選択条件を前記複数のサブ処理選択条件の中から特定し、特定された一以上のサブ処理選択条件に対応する一以上のサブ処理IDから識別される一以上のサブ処理を選択する、
請求項1記載の情報処理システム。 A storage unit that stores a plurality of sub-process IDs and a plurality of sub-process selection conditions respectively corresponding to a plurality of sub-processes,
The sub-process selection unit specifies one or more sub-process selection conditions that match the request from the plurality of sub-process selection conditions, and one or more sub-process selection conditions corresponding to the specified one or more sub-process selection conditions. Selecting one or more sub-processes identified from the process ID;
The information processing system according to claim 1.
前記サブ処理選択手段は、前記要求に含まれている特定の文字列と、サブ処理選択条件を構成するキーワードとに基づいて、前記要求に適合する一以上のサブ処理選択条件を特定する、
請求項2記載の情報処理システム。 The sub-process selection condition includes a keyword,
The sub-process selection unit specifies one or more sub-process selection conditions that match the request, based on a specific character string included in the request and a keyword constituting the sub-process selection condition.
The information processing system according to claim 2.
前記サブ処理選択手段は、前記要求に含まれている特定の文字列と、サブ処理選択条件を構成するキーワード及び正規表現とに基づいて、前記要求に適合する一以上のサブ処理選択条件を特定する、
請求項3記載の情報処理システム。 The sub-processing selection condition is composed of a combination of a keyword and a regular expression,
The sub-process selection unit specifies one or more sub-process selection conditions that match the request based on a specific character string included in the request and a keyword and a regular expression constituting the sub-process selection condition. To
The information processing system according to claim 3.
前記要求には特定の文字列が含まれており、前記特定の文字列は、要求対象となる処理の本名と別名とのいずれか一方を表す、
請求項2記載の情報処理システム。 The process has one real name and one or more aliases,
The request includes a specific character string, and the specific character string represents either a real name or an alias name of a process to be requested.
The information processing system according to claim 2.
前記処理に対応する一以上のサブ処理を前記要求に基づいて複数のサブ処理の中から選択するステップと、
前記選択されたサブ処理を前記処理の実行前及び実行後のうちの少なくとも一方で実行するステップと
を有する情報処理方法。 Executing a process according to the request from the requester;
Selecting one or more sub-processes corresponding to the process from a plurality of sub-processes based on the request;
An information processing method comprising: executing the selected sub-process at least one of before and after executing the process.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005065133A JP2006251974A (en) | 2005-03-09 | 2005-03-09 | Information processor and processing method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005065133A JP2006251974A (en) | 2005-03-09 | 2005-03-09 | Information processor and processing method |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006251974A true JP2006251974A (en) | 2006-09-21 |
Family
ID=37092425
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005065133A Pending JP2006251974A (en) | 2005-03-09 | 2005-03-09 | Information processor and processing method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006251974A (en) |
-
2005
- 2005-03-09 JP JP2005065133A patent/JP2006251974A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10002155B1 (en) | Dynamic code loading | |
US8122292B2 (en) | Debugging of business flows deployed in production servers | |
US9740543B1 (en) | Multi-endpoint method implementation | |
US6983400B2 (en) | Distributed test harness model | |
US8291047B2 (en) | Screen scraping interface | |
AU2008279001B2 (en) | Transactional graph-based computation with error handling | |
JP4287276B2 (en) | System for application server messaging using multiple shipping pools | |
US8032623B2 (en) | Context-based dynamic policy assignment in a distributed processing environment | |
US8307058B2 (en) | Apparatus, method, and computer program product for processing information | |
US20090037425A1 (en) | System and method for dynamically configuring a multiplatform computing environment | |
US10871918B2 (en) | Writing composite objects to a data store | |
US10768974B2 (en) | Specifying an order of a plurality of resources in a transaction according to distance | |
US20050262517A1 (en) | System and method for generating a web control in a Windows development environment | |
US20050086664A1 (en) | Method and apparatus for transaction tracking in a web presentation architecture | |
US7676810B2 (en) | Identification of execution context | |
US20230409295A1 (en) | Building base applications with user interface micro frontends | |
US9047144B2 (en) | System and method for providing Quality-of-Services in a multi-event processing environment | |
JP4889953B2 (en) | Information processing apparatus and method | |
US7275238B2 (en) | Program event activated and configured debugger method, system, article of manufacture, computer program product, and data structure | |
US7765284B2 (en) | Dynamically modified, multiple-platform computer programs, and methods and apparatus utilizing same | |
JP4764649B2 (en) | Information processing apparatus and method | |
US7853605B2 (en) | Auxiliary data provider | |
US20220365832A1 (en) | System to facilitate transition to microservices | |
JP2006251974A (en) | Information processor and processing method | |
US20050235247A1 (en) | Using behavioral annotations in source code to build middleware applications |