Enterprise Server に付属の OSGi モジュール管理サブシステムは、Apache Felix OSGi フレームワークです。このフレームワークを管理できるように、Enterprise Server ではデフォルトで Apache Felix Remote Shell が有効 なっています。このシェルは Felix シェルサービスを使用して OSGi モジュール管理サブシステムと相互作用し、次のような管理タスクを実行可能にします。
インストール済みの OSGi バンドルを参照する
インストール済みの OSGi バンドルのヘッダーを表示する
OSGi バンドルをインストールする
インストールしたバンドルのライフサイクルを管理する
Apache Felix Remote Shell は、ネットワークのどこからでも telnet クライアントにアクセスできます。telnet サービスを使用して Apache Felix Remote Shell に接続するには、コマンド telnet(1) を次のように使用します。
telnet host felix-remote-shell-port |
DAS が稼働中のホスト
telnet サービスを使用して Apache Felix Remote Shell に接続するポート。Enterprise Server は、このためにポート 6666 を使用するように事前構成されています。
Apache Felix Remote Shell で使用できるコマンドを一覧表示するには、Apache Felix Remote Shell のプロンプトに help と入力します。
Apache Felix Remote Shell を終了するには、Apache Felix Remote Shell のプロンプトに exit と入力します。
この例では、ローカルホストで動作し、telnet サービスによる Apache Felix Remote Shell への接続に事前構成されたポートを使用しているドメインで Apache Felix Remote Shell に接続します。
telnet localhost 6666 |
接続の確立後、次の情報が表示されます。
Connected to localhost. Escape character is '^]'. Felix Remote Shell Console: ============================ -> |
この例は、引数を指定せずに Felix Remote Shell のコマンド ps を実行して、インストール済みの OSGi バンドルを一覧表示します。見やすくするために、この例で表示される可能性のある一部のバンドルを記載していません。
-> ps START LEVEL 1 ID State Level Name [ 0] [Active ] [ 0] System Bundle (2.0.2) [ 1] [Active ] [ 1] HK2 OSGi Main Bundle (1.0.0) [ 2] [Installed ] [ 1] AMX V3 Core (3.0.0.SNAPSHOT) [ 3] [Active ] [ 1] GlassFish Rest Interface (3.0.0.SNAPSHOT) ... [ 217] [Installed ] [ 1] Admin Console JDBC Plugin (3.0.0.SNAPSHOT) [ 218] [Resolved ] [ 1] stats77 (3.0.0.SNAPSHOT) [ 219] [Active ] [ 1] Apache Felix Declarative Services (1.0.8) [ 220] [Active ] [ 1] GlassFish Web Container (rfc #66) for OSGi Enabled Web Applications (3.0.0.SNAPSHOT) -> |
この例は、Felix Remote Shell のコマンド find を実行して、名前にテキスト rfc が含まれる OSGi バンドルを検索します。··
-> find rfc START LEVEL 1 ID State Level Name [ 220] [Active ] [ 1] GlassFish Web Container (rfc #66) for OSGi Enabled Web Applications (3.0.0.SNAPSHOT) -> |
この例は、オプション service と capability を指定して Felix Remote Shell のコマンド inspect を実行し、OSGi バンドル 220 が提供するサービスを調べます。
-> inspect service capability 220 GlassFish Web Container (rfc #66) for OSGi Enabled Web Applications (220) provides services: -------------------------------------------------------------------------------------------- objectClass = org.glassfish.osgiweb.Extender service.id = 30 ---- objectClass = org.osgi.service.url.URLStreamHandlerService service.id = 31 url.handler.protocol = webbundle -> |