Difference between revisions of "Adding State"

From GCube System
Jump to: navigation, search
(Multi Port-Type service)
(Multi Port-Type service)
Line 2: Line 2:
 
In the first part of this tutorial we have created a stateless service for simplicity. However, the most common patterns used when developing gCube services are the ones that allow to create stateful service.
 
In the first part of this tutorial we have created a stateless service for simplicity. However, the most common patterns used when developing gCube services are the ones that allow to create stateful service.
 
In this part of the tutorial we see how to add a state to the SampleService.  
 
In this part of the tutorial we see how to add a state to the SampleService.  
== Multi Port-Type service ==
+
== Multi port-type service ==
To add a state we need firstly to add two new Port-Types to the SampleService:
+
To add a state we need firstly to add two new port-types to the SampleService:
# one is dedicated to create a new stateful resource, the so-called ''Factory'' Port-Type
+
* one is dedicated to create a new stateful resource, the so-called ''Factory service'' port-type
# the other one is dedicated to access and manage the state, the so-called ''Service'' Port-Type
+
* the other one is dedicated to access and manage the state, the so-called ''Service instance'' port-type
  
For both, we need to perform the same [[Single_Port-Type#Sketching_Port-type_Interfaces|steps]] done for the Stateless Port-Type:
+
For both, we need to perform the same [[Single_Port-Type#Sketching_Port-type_Interfaces|steps]] done for the Stateless port-type:
 +
* the profile file has to be changed in order to declare the two new port-types
 +
* a WSDL interface definition file has to be provided for each port-type
 +
* the Java implementation of the two port-types has to be provided
 +
 
 +
plus other specific steps that allow to manage stateful services.
  
 
== Basic steps ==  
 
== Basic steps ==  

Revision as of 19:03, 25 March 2008

Adding State

In the first part of this tutorial we have created a stateless service for simplicity. However, the most common patterns used when developing gCube services are the ones that allow to create stateful service. In this part of the tutorial we see how to add a state to the SampleService.

Multi port-type service

To add a state we need firstly to add two new port-types to the SampleService:

  • one is dedicated to create a new stateful resource, the so-called Factory service port-type
  • the other one is dedicated to access and manage the state, the so-called Service instance port-type

For both, we need to perform the same steps done for the Stateless port-type:

  • the profile file has to be changed in order to declare the two new port-types
  • a WSDL interface definition file has to be provided for each port-type
  • the Java implementation of the two port-types has to be provided

plus other specific steps that allow to manage stateful services.

Basic steps

Implementation

Configuring JNDIs & Descriptors

Building & Deploying

A Test Client