カスタムリソースは、javax.naming.spi.ObjectFactory インタフェースを実装するサーバー全体のカスタムリソースオブジェクトファクトリを指定します。ここでは、次のテーマを取り上げます。
カスタムリソースを作成するには、リモートモードで create-custom-resource サブコマンドを使用します。
サーバーが実行されていることを確認します。
リモートサブコマンドには、実行中のサーバーが必要です。
create-custom-resource(1) サブコマンドを使用して、カスタムリソースを作成します。
サブコマンドのプロパティーについては、サブコマンドのマニュアルページを参照してください。
Enterprise Serverを再起動します。
「ドメインの再起動」を参照してください。
この例では、sample-custom-resource という名前のカスタムリソースを作成します。
asadmin> create-custom-resource --restype topic --factoryclass com.imq.topic sample_custom_resource Command create-custom-resource executed successfully. |
コマンド行に asadmin help create-custom-resource と入力して、このサブコマンドの完全な構文とオプションを確認することもできます。
既存のカスタムリソースを一覧表示するには、リモートモードで list-custom-resources サブコマンドを使用します。
サーバーが実行されていることを確認します。
リモートサブコマンドには、実行中のサーバーが必要です。
list-custom-resources(1) サブコマンドを使用して、カスタムリソースを一覧表示します。
この例では、既存のカスタムリソースを一覧表示します。
asadmin> list-custom-resources sample_custom_resource01 sample_custom_resource02 Command list-custom-resources executed successfully |
コマンド行に asadmin help list-custom-resources と入力して、このサブコマンドの完全な構文とオプションを確認することもできます。
list-custom-resources(1) サブコマンドを使用して、カスタムリソースを一覧表示します。
set(1) サブコマンドを使用して、カスタム JNDI リソースを変更します。
この例では、カスタムリソースを変更します。
asadmin> set server.resources.custom-resource.custom /my-custom-resource.property.value=2010server.resources.custom-resource.custom /my-custom-resource.property.value=2010 |
カスタムリソースを削除するには、リモートモードで delete-custom-resource サブコマンドを使用します。
サーバーが実行されていることを確認します。
リモートサブコマンドには、実行中のサーバーが必要です。
list-custom-resources(1) サブコマンドを使用して、カスタムリソースを一覧表示します。
delete-custom-resource(1) サブコマンドを使用して、カスタムリソースを削除します。
この例では、sample-custom-resource という名前のカスタムリソースを削除します。
asadmin> delete-custom-resource sample_custom_resource Command delete-custom-resource executed successfully. |
コマンド行に asadmin help delete-custom-resource と入力して、このサブコマンドの完全な構文とオプションを確認することもできます。