|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Provides an API to use properties.
This API falls in two major parts:
configuration properties
that provides access to properties keys and values: de.smartics.properties.api.config.app
configuration keys
or ConfigurationProperties
: de.smartics.properties.api.config.domain
and its sub packages.In the following sections you find information how to get started using properties with this API.
The simplest way of creating a configuration properties
instance is to rely on the application configuration found in the Manifest file of the current archive and only provide the environment identifier (test
in this example) like this:
final ConfigurationPropertiesFactory factory = InfinispanCacheManagerFactory.createDefaultFactory(); final EnvironmentId environmentId = new EnvironmentId("test"); final ConfigurationProperties propertiesConfiguration = factory.get(environmentId);
Instead of using the ConfigurationPropertiesFactoryFactory.createDefaultFactory()
you may pass in the type of factory you want to create.
final ConfigurationPropertiesFactory factory = InfinispanCacheManagerFactory.create(MyConfigurationPropertiesFactory.class); ...
If you do not want to rely on the automatic application ID detection of the group ID, application ID and version from the manifest file (for details on this please refer to ApplicationIdLoader
).
final ConfigurationKey key = new EnvAppConfigurationKeyBuilder() .withEnvironmentName(environmentId) .withGroupId(myGroup) .withArtifactId(myArtifact) .withVersion(myVersion) .build(); final ConfigurationPropertiesFactory factory = ... (see above) final ConfigurationProperties propertiesConfiguration = factory.get(key);
ConfigurationPropertiesFactoryFactory
,
ConfigurationPropertiesFactory
,
ConfigurationKey
,
ConfigurationProperties
,
EnvAppConfigurationKeyBuilder
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |