The OSGi subsystem is configured like any other subsystem in the standalone/domain XML descriptor. The configuration options are:
Subsystem Activation - By default the OSGi subsystem is activated on-demand. The activation attribute can be set to 'eager' to initialize the subsystem on server startup.
Framework Properties - OSGi supports the notion of framework properties. Property values are of type string. A typical configuration includes a set of packages that are provided by the server directly. Please refer to the OSGi core specification for a list of standard OSGi properties.
Module Dependencies - The Framework can export packages from server system modules. The property 'org.jboss.osgi.system.modules.extra' contains a list of module identifiers that are setup as dependencies of the OSGi Framework.
Capabilities - OSGi bundles can be installed by providing coordinates to the OSGi Repository. Supported coordinates include but are not limited to Maven coordinates and module identifiers.
Config Admin properties - Supported are multiple configurations identified by persistent id (PID). Each configuration may contain multiple configuration key/value pairs.Below is a sample configuration for the OSGi subsystem
<subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy"> <properties> <property name="org.jboss.osgi.system.modules.extra">org.apache.log4j</property> <property name="org.osgi.framework.system.packages.extra">org.apache.log4j;version=1.2</property> <property name="org.osgi.framework.startlevel.beginning">1</property> </properties> <capabilities> <capability name="javax.servlet.api:v25"/> <capability name="javax.transaction.api"/> <capability name="org.apache.felix.log" startlevel="1"/> <capability name="org.jboss.osgi.logging" startlevel="1"/> <capability name="org.apache.felix.configadmin" startlevel="1"/> <capability name="org.jboss.as.osgi.configadmin" startlevel="1"/> </capabilities> </subsystem> ... <subsystem xmlns="urn:jboss:domain:configadmin:1.0"> <configuration pid="org.apache.felix.webconsole.internal.servlet.OsgiManager"> <property name="manager.root">jboss-osgi</property> </configuration> </subsystem>
For more details on the Application Service integration configuration see AS7 Subsystem Configuration documentation.