Discussion:
[jacorb-developer] [jacorb-developers] Obtaining references of trader interfaces
Hans C.J. Kruse
2001-05-16 09:20:22 UTC
Permalink
Hello,

I am wrapping the Trader provided by JacORB to be useful in a CORBA
Component Model (like) implementation.
Since the Jacorb distribution does not contain much documentation
about it's Trader, I used the examples to create my wrapper code.

We now have our first naive wrapper ready. Besides some fine tuning
issues, I like to get some questions answered before we really start
using the 'CCM compliant' Trader component.

Usually you get the Trader's Lookup interface by something like:
[...]
private org.omg.CORBA.Object trader=null;
protected org.omg.CosTrading.Lookup lookup=null;

[...]
lookup=org.omg.CosTrading.LookupHelper.narrow(trader);

Getting the Register interface or the other interfaces can be done with
something like:

[...]
protected org.omg.CosTrading.Register register=null;
[...]
register=lookup.register_if();

Is there a good reason why code like the following does not work?
[...]
register=org.omg.CosTrading.RegisterHelper.narrow(trader);
[...]

As far as I can detect the ior produces by JacORB's trader software
points to it's Lookup interface.
Am I wrong?


yours sincerely,
Hans C.J. Kruse
Nicolas Noffke
2001-05-16 10:59:09 UTC
Permalink
Hello,

the reason for the failed narrow basically is the trader design. The
Lookup interface inherits from the interface TraderComponents which in
turn contains some other interfaces (including Register) as attributes.
That means Lookup doesn't inherit from Register, but has an attribute of
type Register called register_if.

Best regards,
Nicolas
Post by Hans C.J. Kruse
Hello,
I am wrapping the Trader provided by JacORB to be useful in a CORBA
Component Model (like) implementation.
Since the Jacorb distribution does not contain much documentation
about it's Trader, I used the examples to create my wrapper code.
We now have our first naive wrapper ready. Besides some fine tuning
issues, I like to get some questions answered before we really start
using the 'CCM compliant' Trader component.
[...]
private org.omg.CORBA.Object trader=null;
protected org.omg.CosTrading.Lookup lookup=null;
[...]
lookup=org.omg.CosTrading.LookupHelper.narrow(trader);
Getting the Register interface or the other interfaces can be done with
[...]
protected org.omg.CosTrading.Register register=null;
[...]
register=lookup.register_if();
Is there a good reason why code like the following does not work?
[...]
register=org.omg.CosTrading.RegisterHelper.narrow(trader);
[...]
As far as I can detect the ior produces by JacORB's trader software
points to it's Lookup interface.
Am I wrong?
yours sincerely,
Hans C.J. Kruse
Humans need fantasy to be human. To be the place
where the falling angel meets the rising ape.
T. Pratchett, Hogfather, p. 422
Hans C.J. Kruse
2001-05-16 12:11:46 UTC
Permalink
Thanks a lot,

We had some internal discussions at the Telematica instituut and came to the
same answer. I have an UML scheme of CosTrading on my whiteboard. So I knew
the design. I was only concerned about the implementation. The ior written to
disk is the ior of the Lookup interface of the trader. Is this standard
behavior or is this specific for JacORB? In other words: When I do resolve
initial references for a trading service Do I always get the Lookup or is
that unspecified?

greeting,
Hans C.J. Kruse
Post by Hans C.J. Kruse
Hello,
the reason for the failed narrow basically is the trader design. The
Lookup interface inherits from the interface TraderComponents which in
turn contains some other interfaces (including Register) as attributes.
That means Lookup doesn't inherit from Register, but has an attribute of
type Register called register_if.
Best regards,
Nicolas
Post by Hans C.J. Kruse
Hello,
I am wrapping the Trader provided by JacORB to be useful in a CORBA
Component Model (like) implementation.
Since the Jacorb distribution does not contain much documentation
about it's Trader, I used the examples to create my wrapper code.
We now have our first naive wrapper ready. Besides some fine tuning
issues, I like to get some questions answered before we really start
using the 'CCM compliant' Trader component.
[...]
private org.omg.CORBA.Object trader=null;
protected org.omg.CosTrading.Lookup lookup=null;
[...]
lookup=org.omg.CosTrading.LookupHelper.narrow(trader);
Getting the Register interface or the other interfaces can be done with
[...]
protected org.omg.CosTrading.Register register=null;
[...]
register=lookup.register_if();
Is there a good reason why code like the following does not work?
[...]
register=org.omg.CosTrading.RegisterHelper.narrow(trader);
[...]
As far as I can detect the ior produces by JacORB's trader software
points to it's Lookup interface.
Am I wrong?
yours sincerely,
Hans C.J. Kruse
Humans need fantasy to be human. To be the place
where the falling angel meets the rising ape.
T. Pratchett, Hogfather, p. 422
Nicolas Noffke
2001-05-16 12:25:41 UTC
Permalink
Yes, we're compliant. Chapter 16.1.4 of the CORBAServices spec says that a
resolve_initial_references() with arg "TradingService" yields an object of
type Lookup.

Best regards,
Nicolas
Post by Hans C.J. Kruse
Thanks a lot,
We had some internal discussions at the Telematica instituut and came to the
same answer. I have an UML scheme of CosTrading on my whiteboard. So I knew
the design. I was only concerned about the implementation. The ior written to
disk is the ior of the Lookup interface of the trader. Is this standard
behavior or is this specific for JacORB? In other words: When I do resolve
initial references for a trading service Do I always get the Lookup or is
that unspecified?
greeting,
Hans C.J. Kruse
Post by Hans C.J. Kruse
Hello,
the reason for the failed narrow basically is the trader design. The
Lookup interface inherits from the interface TraderComponents which in
turn contains some other interfaces (including Register) as attributes.
That means Lookup doesn't inherit from Register, but has an attribute of
type Register called register_if.
Best regards,
Nicolas
Post by Hans C.J. Kruse
Hello,
I am wrapping the Trader provided by JacORB to be useful in a CORBA
Component Model (like) implementation.
Since the Jacorb distribution does not contain much documentation
about it's Trader, I used the examples to create my wrapper code.
We now have our first naive wrapper ready. Besides some fine tuning
issues, I like to get some questions answered before we really start
using the 'CCM compliant' Trader component.
[...]
private org.omg.CORBA.Object trader=null;
protected org.omg.CosTrading.Lookup lookup=null;
[...]
lookup=org.omg.CosTrading.LookupHelper.narrow(trader);
Getting the Register interface or the other interfaces can be done with
[...]
protected org.omg.CosTrading.Register register=null;
[...]
register=lookup.register_if();
Is there a good reason why code like the following does not work?
[...]
register=org.omg.CosTrading.RegisterHelper.narrow(trader);
[...]
As far as I can detect the ior produces by JacORB's trader software
points to it's Lookup interface.
Am I wrong?
yours sincerely,
Hans C.J. Kruse
Humans need fantasy to be human. To be the place
where the falling angel meets the rising ape.
T. Pratchett, Hogfather, p. 422
Humans need fantasy to be human. To be the place
where the falling angel meets the rising ape.
T. Pratchett, Hogfather, p. 422

Loading...