Configuring a Chameleon
The configuration of the Chameleon is done in the conf/chameleon.properties
file. This file contains the chameleon specifics and the OSGi runtime configuration.
Chameleon properties
You can configure the chameleon structure and behavior using the following properties:
# Core directory
chameleon.core = core
# Runtime directory
chameleon.runtime = runtime
# Application directory
chameleon.application = application
# Enables / disables the monitoring of the runtime and application directories.
chameleon.runtime.monitoring = false
chameleon.application.monitoring = true
# Configure the monitoring (i.e. polling) period in milliseconds
chameleon.monitoring.period = 2000
# Enables or disables the auto-refresh after bundle updates or removals )enabled by default)
chameleon.auto.refresh = true
OSGi container configuration
The OSGi container can also be configured from the same place:
# Packages from the Java classpath to exprot to the OSGi runtime
org.osgi.framework.system.packages.extra=
# Configure the OSGi bootdelegation
org.osgi.framework.bootdelegation=sun.*,com.sun.*
# Set to 'onFirstInit' (default) to clean the cache on startup, 'none' to disable this cleaning
org.osgi.framework.storage.clean=onFirstInit
#
# Bundle config properties can also go here
#
org.osgi.service.http.port=8080
Libraries configuration
Jars located in the libs
directory are named libraries. They are raw jar files (so not bundles). Chameleon scans these jars and exposes every included packages within the OSGi runtime. So, Chameleon applications can relies on packages included in jars that are not bundles.
These jars are loaded using a specific and isolated classloader. By default, this classloader delegates to the system / bootstrap classloader. This policy can be changed using the chameleon.libraries.parent
property. Supported values are:
system
- this is the default value, it delegates to the system classloaderparent
- it delegates to the parent classloader of Chameleon. This let libraries load classes and resources located in thelib/ext
directoryapplication
- it delegates to the Chameleon’s classloader. It let libraries load classes from the classpath
Loading system properties
You can specify system properties in the conf/system.properties
file.
Passing system properties form the command line
Chameleon supports system properties set from the command line using the usual -Dprop=value
syntax. Flags are also supported using -Dflag
. Properties specified this way overrides system properties from conf/system.properties
:
./chameleon.sh --interactive -Dsmtp.password=********