The Service Access framework distinguishes a server from a service:
Clients that want to reference a service do so by creating or obtaining a service reference. A service reference acts as a pointer to a service definition, providing the client with an access point through which the client can communicate with the service. This access point can point to a local service or to a service across a network (or other communications service) on another host.
A service has only one service definition and a client has only one service reference to a particular service. But because a service can have multiple clients, many clients can reference a single service at one time. For example, a service might have two clients on the same host (occupying different tasks) and one client on another host. In this case, three service references correspond to a single service definition.
When you instantiate a service definition, you use TStandardServiceDefinition, a wrapper class. Based on the parameters you use to construct the TStandardServiceDefinition, the class determines whether to create a TLocalServiceDefinition (for a service visible only to clients on the same host) or a TNetworkServiceDefinition (for a service visible to clients across a network).
For service references, you directly instantiate one of the two classes that derive from TServiceReference. Which class you use--TLocalServiceReference or TNetworkServiceReference--depends on the visibility of the service you want to connect to.
If you don't provide a local object name and define the quality of service, TStandardServiceDefinition constructs an unnamed service. Unnamed services are not visible to any clients. The only way a client can access an unnamed service is if the service itself creates the service reference and passes it directly to the client.
The same is true for service references. Once you create a valid service reference, your client has a service access point to the service, but can't yet transfer data to it. When you then instantiate a message stream and pass the service reference in, you can start to move data between the client and service.
Defining services
A server publishes a service by creating and activating a service definition. This service definition represents a specific service access point--a point to which clients can connect to the service. Creating a service definition is the first step in establishing client-server communication on the server side--a client cannot reference a server that is not published, and a server cannot open a communications channel without a definition.
Service Access
classes
You create service definitions and service references using classes that derive from TServiceDefinition and TServiceReference.
Characteristics
of services
When you construct a service definition, you specify:
You represent a service name using an instance of TLocalObjectName and the service visibility using a TQualityOfService object.
Publishing and
activating services
A service definition is published when it is activated. You activate a service--making it available for a client connection--when you pass it into a message stream, and thus establish a communications channel. Until you publish and activate a service, clients cannot locate or connect to the service.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Generated with WebMaker