9.21.3. XML レジストリ

J2EE 5.0 は JAXR (Java API for XML Registries) のサポートを義務付けています。J2EE 5.0 認定の Application Server を持つ XML Registry を含むのは任意です。JBoss EAP には JBoss は Apache jUDDI レジストリである UDDI v2.0 規格のレジストリが同梱されています。また、 Apache Scout の統合により JAXR Capability Level 0 (UDDI レジストリ) にも対応しています。
「XML レジストリ」は JBoss での jUDDI レジストリ設定方法を説明し、いくつかのサンプルコードで jUDDI レジストリの発行および問い合わせに JAXR API を使用する概略を示します。

9.21.3.1. Apache jUDDI の設定

jUDDI レジストリの構成はallサーバープロファイルの juddi-service.sar アーカイブにデプロイされる MBean Service により行われます。このサービスの設定は juddi-service.sar 内の META-INF ディレクトリにある jboss-service.xml で行うことができます。
変更可能な設定アイテムを個別に見ていきます。
DataSources の設定
<!-- Datasource to Database -->
<attribute name="DataSourceUrl">java:/DefaultDS</attribute>
データベーステーブル (起動時に作成されるべきか、 停止時にドロップされるべきか、 起動時にドロップされるべきかなど)
<!-- Should all tables be created on Start-->
<attribute name="CreateOnStart">false</attribute>
<!-- Should all tables be dropped on Stop-->
<attribute name="DropOnStop">true</attribute>
<!-- Should all tables be dropped on Start-->
<attribute name="DropOnStart">false</attribute>
JNDI でバインドされるべき JAXR Connection ファクトリ (バインドされるべきか? どの名前の配下で?)
<!-- Should I bind a Context to which JaxrConnectionFactory bound-->
<attribute name="ShouldBindJaxr">true</attribute>
  
<!-- Context to which JaxrConnectionFactory to bind to. If you have remote clients, please bind it to the global namespace(default behavior). 
To just cater to clients running on the same VM as JBoss, change to java:/JAXR -->
<attribute name="BindJaxr">JAXR</attribute>
その他共通の設定
jUDDI レジストリへのアクセスを承認されたユーザーを追加します。 (1 行に sql 挿入ステートメントを追加する)
Look at the script META-INF/ddl/juddi_data.ddl for more details. Example for a user 'jboss'
  
INSERT INTO PUBLISHER (PUBLISHER_ID,PUBLISHER_NAME,
EMAIL_ADDRESS,IS_ENABLED,IS_ADMIN) 
VALUES ('jboss','JBoss User','jboss@xxx','true','true');