How the services work

Architecture of services in the application logic server

This section describes the workflow of services in the application logic layer:

  1. A service invoker (a business process or a Single Action EJB) sends a request to the service requester factory. The request contains a service requester ID existing in the ServiceRequesterIDs.properties file, which links a requester ID to a resource bundle containing the information for the requester creation.
  2. The Cache Cleaning Process runs searching for timeout service requesters. If the process finds any timeout service requesters, it'll remove those requesters from the service requester factory.
  3. According to the service requester ID, the service requester factory retrieves the service requester .

    If the corresponding service requester does not exist, the service requester factory will locate the resource bundle corresponding to the service requester ID defined in the ServiceRequesterIDs.properties file, and create a service requester using the information in the resource bundle.

  4. The service requester contacts the service holder.
  5. The service holder checks whether the service requester has a service ID. If it does, the service holder will locate the corresponding service object. If the service requester does not have a service ID, the following will happen:
    1. The service holder checks the service type specified in the service requester. If the type is a kind of Generic Pool, the service holder will locate or create a service object in the corresponding Generic Pool. If the type is not a kind of Generic Pool, the service holder creates a new service object.
    2. The service holder assigns a service ID to the newly created (or located) service object.
    3. The service holder returns the service ID to the service requester.
  6. The service requester factory passes the service requester to the service invoker.
  7. The service invoker uses the service requester to access the corresponding service object.
  8. When the transaction is finished, the service invoker releases the service requester and service object.

After the transaction has been done, if your service invoker doesn't release the service requesters and service objects by calling the releaseServiceRequester method, the toolkit will release the service requester and service object for you using the Cache Cleaning Process.