On Sunday, August 4, 2002, at 11:55 AM, Sven Harazim wrote:
> My contract is called "UpdaterateMonitorContract".
> The generated Qosket-skeleton code shows an static generated contract
> name:
>
> ...
> quo_UpdaterateMonitorContract =
> kernel.bindContract("UpdaterateMonitorContract"
> ...
There are two generated functions called 'initContract' in the skeleton:
public Contract initContract(String name, QuoKernel(kernel);
public Contract initContract(String name, String interfaceName,
QuoKernel kermel);
The line above is from the first one. You want the second one.
As you say, the first method ignores the name parameter. Eventually
this method will be appropriate if you're making a single instance of a
qosket that has multiple contracts (QuO doesn't support this yet but it
will later).
The second one uses the name parameter, so this is the one you want to
call. You can either call it directly on the qosket, or you can call a
method on the adapter with the same signature (have a look at the
generated code for your adapter). The interface parameter should be in
idl format, just as it appears in the body of the first initContract
method.
Actually, now that I think of it, I believe you'll have multiple
contracts even if you use the first function. But you won't be able to
tell which is which in the gui. We never run it this way, so I can't
say for sure.
> Is a possibility there of determining the contract name dynamically, so,
> that I have two contracts of the same type in Kernel. (Contracts are
> organized
> in the core about their name anyway?)
I think it's better for the application wrapper to choose a unique name
that's meaningful to it.
--
rshapiro@...
--
[To unsubscribe to this list send an email to "
majdart@..."
with the following text in the BODY of the message "unsubscribe quo-users"]