Syntax 1: For CORBA-compliant EAServer components
Description
Allows a PowerBuilder client or component to obtain the factory
interface of an EAServer component in order to create an instance of the
component.
Applies to
Connection objects, TransactionServer objects
Syntax
|
1 |
objname.Lookup (objectvariable , componentname ) |
|
Argument |
Description |
|---|---|
|
objname |
The name of the Connection object used to establish |
|
objectvariable |
A global, instance, or local variable of the |
|
componentname |
A string whose value is the name of the component |
Return value
Long.
Returns 0 if it succeeds and a negative number if an error
occurs.
Usage
The Lookup function can be used as an alternative to the
CreateInstance function. It obtains a reference to a factory interface
that you can use to create an instance of a component running in
EAServer.
Use the Connection object’s Lookup function to enable a
PowerBuilder client to access a component running in EAServer. You can
supply a server name or a list of server names in the location property
of the Connection object.
Use the TransactionServer object’s Lookup function to enable a
PowerBuilder component running in EAServer to access another component
running on the same server.
To use the Lookup function, you need to create an EAServer proxy
library for the SessionManager package to obtain a proxy for the factory
interface. Include this proxy library in your library list.
Examples
The following example uses Lookup to instantiate the factory
interface for the n_Bank_Account component, then it uses the factory’s
create method to create an instance of the component:
|
1 2 3 4 5 6 7 8 9 10 11 12 |
// Instance variable: // Connection myconnect Factory my_Factory CORBAObject mycorbaobj n_Bank_Account my_account long ll_result ll_result = & myconnect.lookup(my_Factory,"Bank/n_Bank_Account") mycorbaobj = my_Factory.create() mycorbaobj._narrow(my_account, "Bank/n_Bank_Account") my_account.withdraw(100.0) |
See also