The OSGi module management subsystem that is provided with GlassFish Server is the Apache Felix OSGi framework. To enable you to administer this framework, the Apache Felix Remote Shell is enabled by default in GlassFish Server. This shell uses the Felix shell service to interact with the OSGi module management subsystem, and enables you to perform administrative tasks such as:
Browsing installed OSGi bundles
Viewing the headers of installed OSGi bundles
Installing OSGi bundles
Controlling the life cycle of installed bundles
The Apache Felix Remote Shell is accessible to telnet clients from anywhere in the network. To connect to the Apache Felix Remote Shell through the telnet service, use the telnet(1) command as follows:
telnet host felix-remote-shell-port |
The host where the DAS is running.
The port for connecting to the Apache Felix Remote Shell through the telnet service. GlassFish Server is preconfigured to use port 6666 for this purpose.
To see a list of the commands that are available in the Apache Felix Remote Shell, type help at the Apache Felix Remote Shell prompt.
To exit the Apache Felix Remote Shell, type exit at the Apache Felix Remote Shell prompt.
This example connects to the Apache Felix Remote Shell for a domain that is running on the local host and that uses the preconfigured port for connecting to this shell through the telnet service.
telnet localhost 6666 |
After the connection is established, the following information is displayed:
Connected to localhost. Escape character is '^]'. Felix Remote Shell Console: ============================ -> |
This example runs the Felix Remote Shell Command ps without any arguments to list all installed OSGi bundles. For better readability, some bundles that would be listed by this example are not shown.
-> 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) -> |
This example runs the Felix Remote Shell Command find to find all OSGi bundles whose names contain the text rfc.
-> 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) -> |
This example runs the Felix Remote Shell Command inspect with the service option and the capability option to determine the services that OSGi bundle 220 provides.
-> 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 -> |