Adding State
From GCube System
Contents
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.