|
Summary: How to declare common attributes of services in the Deployment Descriptor.
OverviewGlobal 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:
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 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 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 RELATED TOPICS |
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.
Add Comment