Scribble.orgCommunity Documentation

Chapter 2. Eclipse Tools

2.1. Overview of the Tools Environment
2.1.1. Choreography Description
2.1.2. Choreography Description Designer
2.1.3. Validation Framework
2.1.4. Scenario (and Execution)
2.1.5. Generation Modules
2.2. Document Management
2.2.1. Loading a Choreography Description
2.2.2. Loading and Saving a Service Endpoint Description
2.2.3. Importing a WS-CDL document
2.2.4. Exporting a WS-CDL document
2.3. Validation Framework
2.3.1. Defining a Rule Set
2.3.2. Validaton Context (org.pi4soa.common.validation.ValidationContext)
2.3.3. Model Listener (org.pi4soa.common.model.ModelListener)
2.3.4. Registering a Rule Set
2.3.5. Validation Enabled Property
2.4. Service Endpoint Deployment
2.4.1. Target Specific Deployer
2.4.2. Deployment Information
2.4.3. Service Details

This section describes the utilities available for loading and saving descriptions relevant to the pi4soa tools, and also importing and exporting the choreography description to WS-CDL standard format.

The Validation Framework provides a common mechanism for the invocation of rules at the point where a choreography or service endpoint description has been modified and saved. The results from the validation are then presented in the 'Problems' window of the Eclipse IDE.

This section describes how to add validation rules into this framework.

A rule set is a collection of rules that will be triggered to process a Choreography or Service Endpoint Description when it has been saved following modification. The rule set interface (org.pi4soa.common.validation.ValidationRuleSet) is defined with the following methods:

There are two supplied implementations that can be derived from, depending upon the type of validation that needs to be performed:

  1. org.pi4soa.common.validation.AbstractValidationRuleSet

    This is the default implementation of the org.pi4soa.common.validation.ValidationRuleSet interface that should be extended by all custom implementations. This implementation will, by default, check that the rule set is enabled using the configured ruleset ID. To override this default mechanism, the method that makes the decision regarding whether the rule set is enabled is called 'isValidationEnabled()'.

    If the ruleset is enabled, and no errors have occurred in previous rulesets, then it will call a protected abstract method:

    protected abstract void validateModel(org.pi4soa.common.model.Model model, ValidationContext context, org.pi4soa.common.model.ModelListener listener);

    This method should be implemented by any class that extends this default validation rule set, to perform the actual validation of the supplied model.

    The org.pi4soa.common.validation.ValidationContext and org.pi4soa.common.model.ModelListener classes are described below.

  2. org.pi4soa.common.validation.AbstractComponentValidationRuleSet

    The component validation ruleset, which extends the org.pi4soa.common.validation.AbstractValidationRuleSet above, has been designed to enable only those components of interest within a model to be validated. This is achieved by derived implementations of org.pi4soa.common.validation.AbstractComponentValidationRuleSet visiting the elements within the model and invoking rules that have been registered against the particular element type. This is achieved by using the validateComponent method on the org.pi4soa.common.validation.AbstractComponentValidationRuleSet.

    Therefore the org.pi4soa.common.validation.AbstractComponentValidationRuleSet has an associated rule registry, which implements the interface org.pi4soa.common.validation.ComponentValidationRuleRegistry. Each rule in the registry implements the interface org.pi4soa.common.validation.ComponentValidationRule, which has two methods:

    • isRuleRelevant()

      This method determines if the rule is appropriate for the supplied model component.

    • validate()

      This method performs the validation of the supplied component using the rule.

This section discusses the generic service deployment framework. This framework can be used to deploy generated service endpoints, and the relevant service endpoint description, to a target deployment environment.

The first step is to create a specific Deployer for the target environment. The deployer will implement the interface org.pi4soa.service.generation.deploy.Deployer. The class should also be derived from a default implementation of this interface, org.pi4soa.service.generation.deploy.DefaultDeployer.

As an illustration of how to build a new deployer, we will use the Axis deployer as an example.

The Axis deployer (org.pi4soa.axis.deploy.AxisDeployer) is derived from the default deployer implementation. The constructor for the AxisDeployer sets the name of the deployment target and then configures the classes associated with the deployment information and service details (described in the following sections).


The only other method the Axis deploy provides is the 'deploy' method. The first task this method performs is to invoke the 'deploy' method on the default deployer superclass. This is followed by registering the selected services with the Axis server identified by the Administration URL in the deployment information bean.

The default deploy takes the responsibility for constructing the target deployment Jar. It does this in three stages, which can be overridden as necessary (e.g. to include deployment descriptors etc).

The first protected method it invokes is createDeploymentPackage(), which returns an object that acts as a holder for the Jar being constructed.

The second protected method it invokes is buildDeploymentPackage(), which adds the service description to the package, followed by all of the classes contained in the class folder for the selected services.

The final protected method it invokes is completeDeployment(), which closes the deployment package so that no further information can be recorded.

To register a new deployer implementation for the target environment, the plugin for the target should call: