Declaring Elements Globally in Deployment Descriptor

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: How to declare common attributes of services in the Deployment Descriptor.

Overview

Global configuration is simply the capability to declare common attributes of services declared in the Deployment Descriptor. This provides ease of use reducing the amount of (potential) repetitive definitions for services in a Deployment Descriptor.

The benefit to doing this is you define common attributes once, and all ServiceBean and Service definitions essentially 'inherit' those declarations. If attributes are declared at both levels (gs-deployment and ServiceBean) , declared ServiceBean attributes would take precedence. That is if an OperationalString-level parameter is defined, and the same name is defined at the ServiceBean-level the ServiceBean defined parameter would override the parameter declared at the OperationalString level for that specific service's parameter configuration.

Elements that can be globally declared are:

  • Cluster
  • Codebase
  • Configuration
  • Groups
  • Locators
  • Logging
  • Organization
  • Parameters
  • ServiceProvisionPolicy
  • Associations (and Association)

If global elements are declared in both the OperationalString element and either the ServiceBean or Service element, they are replaced with the ServiceBean or Service declared values. If the declared elements contain child elements (Cluster, Groups, Locators, Parameters, Logging, Configuration, Cluster) the element's attribute of IncludeGlobalDecl is used to determine if the globally declared value should be added to the currect declaration, or the current declaration should override the global declaration. If IncludeGlobalDecl is set to "yes" then the globally declared value is included. If "no" then the locally (the element in the ServiceBean or Service element) is used.

Example 1

<gs-deployment Name="Hello World">
    <Parameters>
        <Parameter Name="param4" Value="baz"/>
    </Parameters>

    <ServiceBean Name="Hello World">
        ...
        <Parameters IncludeGlobalDecl="yes">
            <Parameter Name="param1" Value="foo"/>
            <Parameter Name="param2" Value="bar"/>
            <Parameter Name="param3" Value="foobar"/>
        </Parameters>
        ...
    </ServiceBean>
</gs-deployment>

In this example the resulting Parameters are:

param1=foo
param2=bar
param3=foobar
param4=baz

Example 2

<gs-deployment  Name="Hello World">
    <Parameters>
        <Parameter Name="param4" Value="baz"/>
    </Parameters>
    ...
    <ServiceBean Name="Hello World">
        ...
        <Parameters>
            <Parameter Name="param1" Value="foo"/>
            <Parameter Name="param2" Value="bar"/>
            <Parameter Name="param3" Value="foobar"/>
        </Parameters>
        ...
    </ServiceBean>
</gs-deployment >

In this example the resulting Parameters are:

param1=foo
param2=bar
param3=foobar

Example 3:

<gs-deployment Name="Hello World">
    <Parameters>
        <Parameter Name="param4" Value="baz"/>
    </Parameters>
    ...
    <ServiceBean Name="Hello World">
        ...        
    </ServiceBean>
</gs-deployment>

In this example the resulting Parameters are:

param4=baz

In addition to this processing if a globally declared value contains child elements, and the child element is of the form key/value (Parameters, Configuration, Logging), the declared value at the <ServiceBean> or <Service> element will override the key/value of the global element

Example 4

<gs-deployment Name="Hello World">
    <Parameters>
        <Parameter Name="param2" Value="baz"/>
    </Parameters>
    ...
    <ServiceBean Name="Hello World">
        ...
        <Parameters>
            <Parameter Name="param1" Value="foo"/>
            <Parameter Name="param2" Value="bar"/>
            <Parameter Name="param3" Value="foobar"/>
        </Parameters>
        ...
    </ServiceBean>
</gs-deployment>

In this example the resulting Parameters are:

param1=foo
param2=bar
param3=foobar

RELATED TOPICS

Declaring Elements Globally in Deployment Descriptor
Declaring Service UI in Deployment Descriptor
Deployment Descriptor Codebase Element
Deployment Descriptor DeploymentSchedule Element
Deployment Descriptor Parameters and Configuration Elements
Deployment Descriptor SharedComponent Element
Deployment Descriptor SLA Element
deploy - Service Grid CLI
Fixed and Dynamic ServiceBean ProvisionType
Injecting Deployment Descriptor Properties into POJOs
POJO Lifecycle in Service Grid
Proactive Cache
redeploy - Service Grid CLI
Rio OperationalString
Service Associations
Service Deployment Descriptor
Service Grid ClassLoader Hierarchy
undeploy - Service Grid CLI
Using Service Grid to Deploy Partitioned Space
Using Service Grid to Deploy Partitioned Space with Backup
Using Service Grid to Deploy Replicated Space
Using Service Grid to Deploy Space
Using Service Grid to Deploy Spring Applications
Using System Properties for Deployment Descriptor Element Values

Wiki Content Tree


Your Feedback Needed!

We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.

Labels