Configuration directories and files

The SORCER OS (SOS) configuration files are in the distribution/build/sorcer-<version>/configs directory. They are used for starting up the SORCER OS and also can be used as default configuration file for individual service projects.

Three directories for each SORCER service project might be created (provider/requestor - below xxx is the name of the service):

  • configs—contains deployment configuration files, usually named xxx-prv.cofig, and provider/requestor properties files named as xxx-prv.properties/xxx-req.properties. The component names and entries in xxx-prv.cofig files are standardized, and configures for the SORCER provider a proxy with lookup attributes and how to register its proxy with Jini lookup services. The provider proxy is registered with attributes defined in these files. The deployment configuration files allow a single compile-time provider to be customized at runtime (dependency injection)—no source changes required. The xxx-prv.cofig files are mandatory for the startup scripts defined in the bin directory (start-prv.config or boot-prv.config). On the other hand, application specific properties can be defined in a provider properties file xxx-prv.properties/xxx-req.properties. These properties are defined as String key-value pairs and values can be obtained by calling on the SORCER provider/requestor:

    String value = getProperty("key");
    
  • policy—contains policy files that define Java security for providers/requestors, usually xxx-prv.policyxxx-req.policy. Otherwise a file from the SORCER distribution distribution/build/sorcer-<version>/policy/policy.all is used.

  • bin—contains provider/requestor startup scripts, for example: named xxx-run.xml or xxx-boot.xml in the Ant XML format. These scripts may define the execution configuration for SORCER providers and requestors. Alernatively Gradle bootme, stopme, runRequestor tasks can be specified in the build.gradle file in the project directory.

SORCER environment, provider, and requestor properties

The SOS properties (key-value pairs) are set in a configuration file in configs/sorcer.env. A recommended configuration is in configs/all-sorcer.env. A template of the provider configuration file is at: distribution/build/sorcer-<version>/configs/all-sorcer.env.

Provider deployment configuration

Provider deployment configuration (in Java/Jini format) is defined in configuration files myService-prv.config in your service project directory. See for example the configuration in examples/service/configs/adder-prv.config. A template of the provider configuration entries is in: distribution/build/sorcer-<version>/configs/all-prv.config.

Provider properties

Provider application-specific properties (Java properties as key-value pairs) are specified in a separate file configs/myService-prv.properties in your service project. For the service provider the properties file is declared as the following entry:

properties="configs/myService-prv.config";

in the provider deployment configuration file.

Requestor properties

Requestor application-specific properties (Java properties as key-value pairs) are specified in a separate file in configs/myService-req.properties in your service project. When subclassing sorcer.core.requestor.ServiceRequestor, your requestor loads both SORCER environment and requestor properties to be available via getProperty("my.requestor.propery). Otherwise, you have to load them in your own requestor code in a similar fashion as the ServiceRequestor does it.

Java System properties for configuration files

If the SOS, provider, or requestor properties files are not in the standard locations as described above then their file names can be specified via Java System properties as follows:

sorcer.env.file

requestor.properties.file

In Ant XML scripts they can be specified as follows:

Suffixed service providers names

Two suffixed schemas for provider names are available:

  • use provider names suffixed with your machine OS user name

    sorcer.provider.name.suffixed = true
    
  • or custom suffix for provider names

    sorcer.provider.name.suffix = "MWS"
    

A single attribute sorcer.provider.name.suffixed is used for default global suffixed names and sorcer.name.suffix for custom global suffixed names specified in configs/sorcer.env file in your distribution directory . The default value for sorcer.provider.name.suffixed is false and for sorcer.provider.name.suffix is the empty string.

Either of the global properties defined in the sorcer.env file can be overridden by provider config entries:

// overrides the sorce.env property: sorcer.provider.name.suffixed or sorcer.name.suffix
nameSuffixed = "false";

// ignore global suffix and use my own suffix
nameSuffixed = "mySuffix";

Therefore, the specific suffixing can be defined in the provider configuration (deployment) file *.config that may optionally contain either:

    nameSuffixed = "false";

or

    nameSuffixed = "mySuffix";

Back to top

Version: 1.0-SNAPSHOT. Last Published: 2020-01-18.