Converts a CORBA object reference from a general supertype to a more specific subtype.
This function is used by PowerBuilder clients connecting to EAServer.
CORBAObject objects
corbaobject._Narrow ( newremoteobject, classname )
Argument |
Description |
---|---|
corbaobject |
An object of type CORBAObject that you want to convert |
newremoteobject |
A variable that will contain the converted object reference |
classname |
The class name of the subtype to which you want to narrow the object reference |
Long. Returns 0 if it succeeds and a negative number if an error occurs.
The _Narrow function allows you to narrow proxy objects in a CORBA-compatible client that connects to EAServer. For additional examples, see the functions on the See also list.
The following example narrows a CORBA object reference to the n_Bank_Account interface:
CORBAObject my_corbaobj
n_Bank_Account my_account
...
...
my_corbaobj._narrow(my_account,"Bank/n_Bank_Account")
my_account.withdraw(100.0)
In this example, the component is an EJB component that resides in a separate domain in EAServer. In this case, the SimpleBean component’s classes are in the ../classes/adomain/asimplepackage subdirectory:
CORBAObject my_corbaobj
SimpleBean my_simplebean
SimpleBeanHome my_simplebeanhome
...
my_corbaobj._narrow(my_simplebeanhome, "adomain/asimplepackage/SimpleBeanHome")