1. OSGi Commands
The following is a list of OSGi commands.
Command | Description |
---|---|
Adds an OSGi framework configuration to the domain. |
|
Installs bundles in a specified location to a specified OSGi framework. |
|
Displays a list of OSGi frameworks configured in the domain. |
|
Modifies a OSGi framework configuration. |
|
Deletes a OSGi framework configuration. |
|
Displays information of the OSGi frameworks running in a specified server. |
|
Starts a specified bundle. |
|
Stops a specified bundle. |
|
Deletes a specified bundle. |
|
Updates a specified bundle. |
1.1. add-osgi-framework
Adds an OSGi framework configuration to the domain.
-
Alias
addfwk
-
Usage
add-osgi-framework -n,--name <framework-name> [-en,--exportName <jndi-export-name>] [-s,--servers <server-list>] [-iib <true | false>] [-ibd <path>] [-dsl <start-level>] [-foe <true | false>] [-bid <path-list>] [-f,--forceLock] [-detail]
-
Parameters
Parameter Description -n,--name <framework-name>
Unique name of the OSGi framework.
[-en,--exportName <jndi-export-name>]
JNDI name of the OSGi framework.
[-s,--servers <server-list>]
A list of servers that uses the OSGi framework. To specify multiple servers, separate each server with a comma(,).
[-iib <true | false>]
Determines whether to install bundles in the initial bundles directory. (true | false)
[-ibd <path>]
Path of the initial bundles directory. If not specified, the default path is JEUS_HOME/lib/osgi/FRAMEWORK_NAME.
[-dsl <start-level>]
Start-level default value for the bundles located in the initial bundles directory.
[-foe <true | false>]
Determines whether to regard the failure to install initial bundles as an error. (true | false)
[-bid <path-list>]
Path of bundle installation descriptor XML files. To specify multiple files, separate each file with a comma(,).
[-f,--forceLock]
Forcibly applies the configuration changes.
[-detail]
Displays detailed results of the dynamic changes.
-
Example
[MASTER]domain1.adminServer>list-osgi-frameworks No OSGi Frameworks exists. [MASTER]domain1.adminServer>add-osgi-framework -name framework-0 -servers server1 Successfully performed the ADD operation for OSGi Framework framework-0, but all changes were non-dynamic. They will be applied after restarting. Check the results using "list-osgi-frameworks". [MASTER]domain1.adminServer>list-osgi-frameworks List of OSGi Frameworks ================================================================================ +------------------------+----------------------------+------------------------+ | Framework Name | JNDI Export Name | Target Servers | +------------------------+----------------------------+------------------------+ | framework-0 | | server1 | +------------------------+----------------------------+------------------------+ ================================================================================ [MASTER]domain1.adminServer>
1.2. install-bundle
Installs bundles in a specified location to a specified OSGi framework.
-
Alias
installb
-
Usage
install-bundle -l,--location <location> -f,--framework <framework-name> -s,--server <server-name>
-
Parameters
Parameter Description -l,--location <location>
URL of the bundle to be installed.
-f,--framework <framework-name>
Name of the OSGi framework to which the bundle will be installed.
-s,--server <server-name>
Server to which the bundle will be installed.
-
Example
[MASTER]domain1.adminServer>install-bundle -location https://repo.maven.apache.org/maven2/org/ops4j/pax/url/pax-url-mvn/1.3.7/pax-url-mvn-1.3.7.jar -framework framework-0 -server server1 Installation completed successfully. [MASTER]domain1.adminServer>
1.3. list-osgi-frameworks
Displays a list of OSGi frameworks configured in the domain.
-
Alias
lsfwks
-
Usage
list-osgi-frameworks [-f,--framework <framework-name>]
-
Parameters
Parameter Description [-f,--framework <framework-name>]
Displays detailed configuration of a specified OSGi framework.
-
Example
[MASTER]domain1.adminServer>list-osgi-frameworks List of OSGi Frameworks ================================================================================ +------------------------+----------------------------+------------------------+ | Framework Name | JNDI Export Name | Target Servers | +------------------------+----------------------------+------------------------+ | framework-0 | | server1 | +------------------------+----------------------------+------------------------+ ================================================================================ [MASTER]domain1.adminServer>list-osgi-frameworks -framework framework-0 OSGi Framework [framework-0] ================================================================================ +--------------------------------------------------------------+---------------+ | Attribute Name | Value | +--------------------------------------------------------------+---------------+ | Framework Name | framework-0 | | JNDI Export Name | Not Specified | | Target Servers | server1 | | Install Initial Bundles | true | | Initial Bundles Directory Location | Not Specified | | Default Start Level | 30 | | Fail On Error | true | +--------------------------------------------------------------+---------------+ ================================================================================ Framework Configuration Properties ==================================================== +-----+--------------------------------------------+ | Key | Value | +-----+--------------------------------------------+ (No data available) ==================================================== Bundle Installation Descriptors ================================================================================ +------------------------------------------------------------------------------+ | Location | +------------------------------------------------------------------------------+ (No data available) ================================================================================
1.4. modify-osgi-framework
Modifies an OSGi framework configuration.
-
Alias
modfwk
-
Usage
modify-osgi-framework -n,--name <framework-name> [-en,--exportName <jndi-export-name>] [-s,--servers <server-list>] [-iib <true | false>] [-ibd <path>] [-dsl <start-level>] [-foe <true | false>] [-bid <path-list>] [-f,--forceLock] [-detail]
-
Parameters
Parameter Description -n,--name <framework-name>
Unique name of the OSGi framework.
[-en,--exportName <jndi-export-name>]
JNDI name of the OSGi framework.
[-s,--servers <server-list>]
A list of servers that uses the OSGi framework. To specify multiple servers, separate each server with a comma(,).
[-iib <true | false>]
Determines whether to install bundles in the initial bundles directory. (true | false)
[-ibd <path>]
Path of the initial bundles directory. If not specified, the default path is JEUS_HOME/lib/osgi/FRAMEWORK_NAME.
[-dsl <start-level>]
Start-level default value for the bundles located in the initial bundles directory.
[-foe <true | false>]
Determines whether to regard the failure to install initial bundles as an error. (true | false)
[-bid <path-list>]
Path of bundle installation descriptor XML files. To specify multiple files, separate each file with a comma(,).
[-f,--forceLock]
Forcibly applies the configuration changes.
[-detail]
Displays detailed results of the dynamic changes.
-
Example
[MASTER]domain1.adminServer>modify-osgi-framework -name framework-0 -dsl 45 Successfully performed the MODIFY operation for OSGi Framework framework-0, but some changes were non-dynamic. They will be applied after restarting. Check the results using "list-osgi-frameworks". [MASTER]domain1.adminServer>
1.5. remove-osgi-framework
Deletes a OSGi framework configuration.
-
Alias
rmfwk
-
Usage
remove-osgi-framework -n,--name <framework-name>
-
Parameters
Parameter Description -n,--name <framework-name>
Name of the OSGi framework to delete.
-
Example
[MASTER]domain1.adminServer>remove-osgi-framework -name framework-0 Successfully performed the REMOVE operation for OSGi Framework framework-0. Check the results using "list-osgi-frameworks". [MASTER]domain1.adminServer>
1.6. show-osgi-framework-info
Displays information of the OSGi frameworks running in a specified server.
-
Alias
osgiinfo, fwkinfo
-
Usage
show-osgi-framework-info -s,--server <server-name> [-f,--framework <framework-name>] [-lb]
-
Parameters
Parameter Description -s,--server <server-name>
Server name.
[-f,--framework <framework-name>]
Name of the OSGi framework to display the information.
[-lb]
Determines whether to display the information of the installed bundles. This parameter must be used with the -f option.
-
Example
[MASTER]domain1.adminServer>show-osgi-framework-info -server server1 -framework framework-0 -lb OSGi Framework [framework-0] Information in the server[framework-0] Framework [framework-0] Overview ====================================================================== +----------------------------------------------------------+---------+ | System Bundle Name | Version | +----------------------------------------------------------+---------+ | org.apache.felix.framework | 5.4.0 | +----------------------------------------------------------+---------+ ====================================================================== Installed Bundles in the framework [framework-0]. ================================================================================ +----+-------------------+---------+--------------------+--------+-------------+ | Id | Symbolic Name | Version | Location | State | Start-level | +----+-------------------+---------+--------------------+--------+-------------+ | 0 | org.apache.felix. | 5.4.0 | System Bundle | ACTIVE | 0 | | |framework | | | | | +----+-------------------+---------+--------------------+--------+-------------+ | 2 | org.ops4j.pax.url | 1.3.7 | https://repo.maven | ACTIVE | 30 | | |.mvn | |.apache.org/maven2/ | | | | | | |org/ops4j/pax/url/p | | | | | | |ax-url-mvn/1.3.7/pa | | | | | | |x-url-mvn-1.3.7.jar | | | +----+-------------------+---------+--------------------+--------+-------------+ ================================================================================ [MASTER]domain1.adminServer>
1.7. start-bundle
Starts a specified bundle.
-
Alias
startb
-
Usage
start-bundle -name <bundle-symbolic-name> [-version <bundle-version>] -f,--framework <framework-name> -s,--server <server-name>
-
Parameters
Parameter Description -name <bundle-symbolic-name>
Name of the bundle to start.
[-version <bundle-version>]
Version of the bundle to to start.
-f,--framework <framework-name>
Name of the OSGi framework.
-s,--server <server-name>
Server name.
-
Example
[MASTER]domain1.adminServer>start-bundle -name org.ops4j.pax.url.mvn -framework framework-0 -server server1 The bundle has been started successfully. [MASTER]domain1.adminServer>
1.8. stop-bundle
Stops a specified bundle.
-
Alias
stopb
-
Usage
stop-bundle -name <bundle-symbolic-name> [-version <bundle-version>] -f,--framework <framework-name> -s,--server <server-name>
-
Parameters
Parameter Description -name <bundle-symbolic-name>
Name of the bundle to stop.
[-version <bundle-version>]
Version of the bundle to stop.
-f,--framework <framework-name>
Name of the OSGi framework.
-s,--server <server-name>
Server name.
-
Example
[MASTER]domain1.adminServer>stop-bundle -name org.ops4j.pax.url.mvn -framework framework-0 -server server1 The bundle has been stopped successfully. [MASTER]domain1.adminServer>
1.9. uninstall-bundle
Deletes a specified bundle.
-
Alias
uninstallb
-
Usage
uninstall-bundle -name <bundle-symbolic-name> [-version <bundle-version>] -f,--framework <framework-name> -s,--server <server-name>
-
Parameters
Parameter Description -name <bundle-symbolic-name>
Name of the bundle to delete.
[-version <bundle-version>]
Version of the bundle to delete.
-f,--framework <framework-name>
Name of the OSGi framework.
-s,--server <server-name>
Server name.
-
Example
[MASTER]domain1.adminServer>uninstall-bundle -name org.ops4j.pax.url.mvn -framework framework-0 -server server1 The bundle has been uninstalled successfully. [MASTER]domain1.adminServer>
1.10. update-bundle
Updates a specified bundle.
-
Alias
updateb
-
Usage
update-bundle -name <bundle-symbolic-name> [-version <bundle-version>] -f,--framework <framework-name> -s,--server <server-name> [-l,--location <location>]
-
Parameters
Parameter Description -name <bundle-symbolic-name>
Name of the bundle to update.
[-version <bundle-version>]
Version of the bundle to update.
-f,--framework <framework-name>
Name of the OSGi framework.
-s,--server <server-name>
Server name.
[-l,--location <location>]
URL of the bundle to use.
-
Example
[MASTER]domain1.adminServer>update-bundle -name org.ops4j.pax.url.mvn -framework framework-0 -server server1 The bundle has been updated successfully. [MASTER]domain1.adminServer>