_Narrow PowerScript function
Description
Converts a CORBA object reference from a general supertype
to a more specific subtype.
This function is used by PowerBuilder clients connecting to EAServer.
Controls
CORBAObject objects
Syntax
|
1 |
<span>corbaobject</span>.<span>_Narrow</span> ( <span>newremoteobject</span><span>, classname </span>) |
|
Argument |
Description |
|---|---|
|
corbaobject |
An object of type CORBAObject that you |
|
newremoteobject |
A variable that will contain the converted |
|
classname |
The class name of the subtype to which |
Return Values
Long. Returns 0 if it succeeds and a
negative number if an error occurs.
Usage
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.
Examples
The following example narrows a CORBA object reference
to the n_Bank_Account interface:
|
1 |
CORBAObject my_corbaobj |
|
1 |
n_Bank_Account my_account |
|
1 |
... |
|
1 |
... |
|
1 |
my_corbaobj.<span>_narrow</span>(my_account,"Bank/n_Bank_Account") |
|
1 |
|
1 |
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:
|
1 |
CORBAObject my_corbaobj |
|
1 |
SimpleBean my_simplebean |
|
1 |
SimpleBeanHome my_simplebeanhome |
|
1 |
... |
|
1 |
my_corbaobj.<span>_narrow</span>(my_simplebeanhome, <br> "adomain/asimplepackage/SimpleBeanHome") |
|
1 |