
This section describes the workflow of services in the application logic
layer:
- 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.
- 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.
- 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.
- The service requester contacts the service holder.
- 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:
- 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.
- The service holder assigns a service ID to the newly created (or located)
service object.
- The service holder returns the service ID to the service requester.
- The service requester factory passes the service requester to the service
invoker.
- The service invoker uses the service requester to access the corresponding
service object.
- 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.