Chapter 12: Creating CORBA Java Clients
You can call the ORB.object_to_string() and ORB.string_to_object() methods to serialize and deserialize proxy object references. Assuming that the proxy interface is Payroll, this call serializes a proxy component reference:
Payroll payroll; ... deleted code that instantiates payroll ... String payroll_ior = orb.object_to_string(payroll);
This call deserializes the reference:
Payroll payroll = PayrollHelper.narrow( orb.string_to_object(payroll_ior));
The following restrictions apply when serializing and deserializing component proxy references:
Unless the proxy is for an Enterprise Java EntityBean, the serialized reference remains valid only as long as the server has not been restarted since the time when proxy was first instantiated. When deserializing, the proxy instance will connect back to the same host and port as was used to create the original instance. An EntityBean proxy can be deserialized at any time, as long as the EntityBean is still installed on the original server.
If the original proxy instance was created by connecting to a secure port with a client-side SSL certificate, the proxy must be deserialized in a session that connects using the same client certificate and equal or greater security constraints. For example, if you create an object with session that uses 128-bit SSL encryption, serialize the object, then later try to deserialize the object using during a session that uses 40-bit SSL encryption, the ORB will throw the CORBA::NO_PERMISSION exception. Access will be allowed when objects created using less secure session are later accessed using a more secure session.
|Copyright © 2005. Sybase Inc. All rights reserved.|