Object Activation

Category CORBAActivation of:

Declared In:

Category Description

This category implements the objects activation. To be activatable the object's class must implement the instance method -interface that returns an IDLInterface object. Such the objects can be passed or returned as the arguments in the remote method calls.
When object is activated a local object reference is created for that object. This local object reference retains the activated object, and in its turn is retained either by ORB or by a connection, depending on the activation method. An object may be activated either explicitly or implicitly. If an object is activated explicitly by calling one of the methods in this category then its local object reference is retained by ORB and the object should be explicitly deactivated to be released. An object is activated implicitly when it is passed as an argument to a remote method call, if it has not been activated yet. In this case the object's local reference is retained by a connection through which the object is vended to a remote party. When the connection is closed the object's local reference is released. If an object is passed to a remote party in a remote method call and then is returned back in another remote call, the object itself, not its local reference, is returned to the program.

Instance Methods

- (void) activate

Explicitly activates the receiver. The receiver must respond to the -interface method, which should return an instance of IDLInterface class.

- (void) activateWithObjectID:(NSData*)objectID

Explicitly activates the receiver with specified objectID. The receiver must respond to the -interface method, which should return an instance of IDLInterface class.

- (void) activateWithObjectKey:(NSString*)objectKey

Converts objectKey to NSData and calls previous method. The terminating zero is not included in objectID.

- (void) deactivate

Deactivates the receiver. The corresponding local reference is released from ORB and from all the connections, so the receiver becomes unavailable for the remote clients. If the local reference is not retained elsewhere it is deallocated and releases the receiver.

- (CORBAObject*) objectReference

Returns the receiver's local object reference if the receiver is activated, or nil otherwise.