Constants

namespace cppmicroservices::Constants

Defines standard names for the CppMicroServices environment system properties, service properties, and Manifest header attribute keys.

The values associated with these keys are of type std::string, unless otherwise indicated.

Variables

const std::string SYSTEM_BUNDLE_LOCATION

Location identifier of the OSGi system bundle , which is defined to be “System Bundle”.

const std::string SYSTEM_BUNDLE_SYMBOLICNAME

Alias for the symbolic name of the OSGi system bundle .

It is defined to be “system.bundle”.

const std::string BUNDLE_ACTIVATOR

Manifest header identifying the bundle’s activator.

The value for this attribute is of type bool. false - the bundle has no activator true - the bundle has an activator The behavior if the attribute is not specified is the same as when it is set to ‘false’.

The header value may be retrieved via the Bundle::GetProperty method.

const std::string BUNDLE_CATEGORY

Manifest header identifying the bundle’s category.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

const std::string BUNDLE_COPYRIGHT

Manifest header identifying the bundle’s copyright information.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

const std::string BUNDLE_DESCRIPTION

Manifest header containing a brief description of the bundle’s functionality.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

const std::string BUNDLE_MANIFESTVERSION

Manifest header identifying the bundle’s manifest version.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

const std::string BUNDLE_NAME

Manifest header identifying the bundle’s name.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

const std::string BUNDLE_VENDOR

Manifest header identifying the bundle’s vendor.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

const std::string BUNDLE_VERSION

Manifest header identifying the bundle’s version.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

const std::string BUNDLE_DOCURL

Manifest header identifying the bundle’s documentation URL, from which further information about the bundle may be obtained.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

const std::string BUNDLE_CONTACTADDRESS

Manifest header identifying the contact address where problems with the bundle may be reported; for example, an email address.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

const std::string BUNDLE_SYMBOLICNAME

Manifest header identifying the bundle’s symbolic name.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

const std::string BUNDLE_LOCALIZATION

Manifest header identifying the base name of the bundle’s localization entries.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

See
BUNDLE_LOCALIZATION_DEFAULT_BASENAME

const std::string BUNDLE_LOCALIZATION_DEFAULT_BASENAME

Default value for the bundle.localization manifest header.

See
BUNDLE_LOCALIZATION

const std::string BUNDLE_ACTIVATIONPOLICY

Manifest header identifying the bundle’s activation policy.

The header value may be retrieved from the AnyMap object returned by the Bundle::GetHeaders() method.

See
ACTIVATION_LAZY

const std::string ACTIVATION_LAZY

Bundle activation policy declaring the bundle must be activated when the library containing it is loaded into memory.

A bundle with the lazy activation policy that is started with the START_ACTIVATION_POLICY option will wait in the STATE_STARTING state until its library is loaded. The bundle will then be activated.

The activation policy value is specified as in the bundle.activation_policy manifest header like:

See
BUNDLE_ACTIVATIONPOLICY
See
Bundle::Start(uint32_t)
See
Bundle::START_ACTIVATION_POLICY

const std::string FRAMEWORK_VERSION

Framework environment property identifying the Framework version.

The header value may be retrieved via the BundleContext::GetProperty method.

const std::string FRAMEWORK_VENDOR

Framework environment property identifying the Framework implementation vendor.

The header value may be retrieved via the BundleContext::GetProperty method.

const std::string FRAMEWORK_STORAGE

Framework launching property specifying the persistent storage area used by the framework.

The value of this property must be a valid file path in the file system to a directory. If the specified directory does not exist then the framework will create the directory. If the specified path exists but is not a directory or if the framework fails to create the storage directory, then framework initialization fails. This area can not be shared with anything else.

If this property is not set, the framework uses the “fwdir” directory in the current working directory for the persistent storage area.

const std::string FRAMEWORK_STORAGE_CLEAN

Framework launching property specifying if and when the persistent storage area for the framework should be cleaned.

If this property is not set, then the framework storage area must not be cleaned.

See
FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT

const std::string FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT

Specifies that the framework storage area must be cleaned before the framework is initialized for the first time.

Subsequent inits, starts or updates of the framework will not result in cleaning the framework storage area.

const std::string FRAMEWORK_THREADING_SUPPORT

The framework’s threading support property key name.

This property’s default value is “single”. Valid key values are:

  • “single” - The framework APIs are not thread-safe.
  • “multi” - The framework APIs are thread-safe.

Note

This is a read-only property and cannot be altered at run-time. The key’s value is set at compile time by the US_ENABLE_THREADING_SUPPORT option. See Build Instructions for more information.

const std::string FRAMEWORK_THREADING_SINGLE

Framework threading support configuration declaring that the framework is configured for single thread usage.

It is not safe to use the framework API concurrently from multiple threads.

const std::string FRAMEWORK_THREADING_MULTI

Framework threading support configuration declaring that the framework is configured for multi-thread usage.

The framework API uses internal locks such that it is safe to use the API concurrently from multiple threads.

const std::string FRAMEWORK_LOG

The framework’s log property key name.

This property’s default value is off (boolean ‘false’).

const std::string FRAMEWORK_UUID

Framework environment property identifying the Framework‘s universally unique identifier (UUID).

A UUID represents a 128-bit value. A new UUID is generated by the Framework#Init() method each time a framework is initialized. The value of this property conforms to the UUID string representation specified in RFC 4122.

The header value may be retrieved via the BundleContext::GetProperty method.

const std::string FRAMEWORK_WORKING_DIR

Framework launching property specifying the working directory used for resolving relative path names.

If not set, the framework will use the process current working directory as set during static initialization of the framework library.

const std::string OBJECTCLASS

Service property identifying all of the class names under which a service was registered in the Framework.

The value of this property must be of type std::vector<std::string>.

This property is set by the Framework when a service is registered.

const std::string SERVICE_ID

Service property identifying a service’s registration number.

The value of this property must be of type long int.

The value of this property is assigned by the Framework when a service is registered. The Framework assigns a unique value that is larger than all previously assigned values since the Framework was started. These values are NOT persistent across restarts of the Framework.

const std::string SERVICE_PID

Service property identifying a service’s persistent identifier.

This property may be supplied in the properties ServiceProperties object passed to the BundleContext::RegisterService method. The value of this property must be of type std::string or std::vector<std::string>.

A service’s persistent identifier uniquely identifies the service and persists across multiple Framework invocations.

By convention, every bundle has its own unique namespace, starting with the bundle’s identifier (see Bundle#GetBundleId()) and followed by a dot (.). A bundle may use this as the prefix of the persistent identifiers for the services it registers.

const std::string SERVICE_RANKING

Service property identifying a service’s ranking number.

This property may be supplied in the ServiceProperties object passed to the BundleContext::RegisterService method. The value of this property must be of type int.

The service ranking is used by the framework to determine the natural order of services, see ServiceReference::operator<(const ServiceReference&), and the default service to be returned from a call to the BundleContext::GetServiceReference method.

The default ranking is zero (0). A service with a ranking of std::numeric_limits<int>::max() is very likely to be returned as the default service, whereas a service with a ranking of std::numeric_limits<int>::min() is very unlikely to be returned.

If the supplied property value is not of type int, it is deemed to have a ranking value of zero.

const std::string SERVICE_VENDOR

Service property identifying a service’s vendor.

This property may be supplied in the properties ServiceProperties object passed to the BundleContext::RegisterService method.

const std::string SERVICE_DESCRIPTION

Service property identifying a service’s description.

This property may be supplied in the properties ServiceProperties object passed to the BundleContext::RegisterService method.

const std::string SERVICE_SCOPE

Service property identifying a service’s scope.

This property is set by the framework when a service is registered. If the registered object implements PrototypeServiceFactory, then the value of this service property will be SCOPE_PROTOTYPE. Otherwise, if the registered object implements ServiceFactory, then the value of this service property will be SCOPE_BUNDLE. Otherwise, the value of this service property will be SCOPE_SINGLETON.

const std::string SCOPE_SINGLETON

Service scope is singleton.

All bundles using the service receive the same service object.

See
SERVICE_SCOPE

const std::string SCOPE_BUNDLE

Service scope is bundle.

Each bundle using the service receives a distinct service object.

See
SERVICE_SCOPE

const std::string SCOPE_PROTOTYPE

Service scope is prototype.

Each bundle using the service receives either a distinct service object or can request multiple distinct service objects via ServiceObjects.

See
SERVICE_SCOPE