516 DISTRIBUTED OBJECT-BASED SYSTEMS CHAP. 9
p to the client.
Whenever the client invokes one of the object’ s methods, the client ORB marshals the invocation request into an IIOP Request message. This message contains the server-specific object key that was also stored in the IOR. The message is sent through the TCP connection to the server, where it can subsequently be passed to the proper POA associated with the object key. The POA will then forward the request to the proper servant where it is first unmarshaled and transformed into an actual method call.
In this scenario, an IOR refers directly to an object, leading to what is known as direct binding. An alternative to direct binding is indirect binding by which a binding request is first sent to an implementation repository. The implementation repository is just another process, identified in the object’ s IOR. It acts as a registry by which the referenced object can be located and activated before sending invocation requests to it. In practice, indirect binding is used primarily for persistent objects, that is, objects controlled by a POA that follows the persistent lifespan policy.
When a client ORB uses an IOR based on indirect binding, it simply starts binding to the implementation repository. The repository will notice that the request is actually intended for another server, and will look into its tables to see whether the server is already running, and if so, where it can be located. If the server is not yet running, the implementation repository can start it, although this depends on whether or not automatic start-up is supported.
When the client invokes the referenced object for the first time, the invocation request is sent to the implementation repository, which responds by giving the details where the object’ s server can actually be reached, as shown in Fig. 9-15. From there on, invocation requests are forwarded to the proper server.
IOR refers to implementation repository
Client
IOR
5. Actual invocation
4. Redirect message
Object server
1. First invocation or binding request
3. Ack object is active
Implementation repository
2. Activate / start object
Figure 9-15. Indirect binding in CORBA.