After you have compiled stub classes, you can implement code that uses the stubs to interact with EAServer components.
Your program must obtain proxy objects for the EAServer component and narrow them to the stub interface that you intend to use by following the steps below:
Step |
What it does |
Detailed explanation |
---|---|---|
1 |
Initialize the CORBA ORB classes. |
|
2 |
Use an IOR string and the ORB.string_to_object method to obtain the Manager instance for the server. |
|
3 |
Use the Manager instance to create a Session. |
|
4 |
Call the Session’s lookup method to create proxy objects, then narrow them to an interface that the component supports. The lookup method uses the EAServer name service to resolve the requested name to an installed component. |
|
5 |
Call the stub methods to remotely invoke component methods. |
Java exceptions can occur at any step. “Handling exceptions” describes common exceptions and their cause.
Other patterns for proxy instantiation
Some patterns for proxy instantiation used in clients written
for earlier EAServer releases are not compatible with EAServer 6.0.
In particular, clients that use the CosNaming API
or SessionManager::Factory::create methods that take
parameters should be modified to use the implementation pattern described
here. For more information, see “Using the CosNaming interface”.