Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 02-11-2007
nicole nicole is offline
Registered User
 
Name: Nicole Yoblick
Organization: highbridge capital management
Project: jmsForC#Client
 
Join Date: Feb 2007
Posts: 3
passing objects

I am new to ICE and have a question.

i am currently returning an object (not a proxy) from a java server to a c#client. On the client side, i want the methods and members of the object I just retrieved to be called locally to the client (non-rmi). So i did this with this slice code:

class JMSQueueIce {
string queuename;
string getName() throws Util::JMSExceptionIce;
void setName( string name ) throws Util::JMSExceptionIce;
};
....
JMSQueueIce lookup( string destinationName) throws Util::JMSExceptionIce;

I had my generated abstract class, extended it in on both sides (c# for client, java for server), and registered them with object factories.

The problem is that on the server side, i want to associate another object (a non-ice, java jms queue object) with the one i'm returning to the client - in other words, i want to store it on the server-side only.

So my question first is:
1. how do you recommend I do this?

2. If your answer is "pass a proxy to this queue object back and forth" in order to facilliate the server-side storage, then how do i ensure that the getName() and setName() methods will be invoked locally when called from the client, instead of remotely? (i.e. i want that variable queuename to be sent across the wire as well)
Reply With Quote
  #2 (permalink)  
Old 02-11-2007
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 907
You may find this post of interest.

Quote:
If your answer is "pass a proxy to this queue object back and forth" in order to facilliate the server-side storage, then how do i ensure that the getName() and setName() methods will be invoked locally when called from the client, instead of remotely? (i.e. i want that variable queuename to be sent across the wire as well)
If you invoke on a class instance via its Java reference, the call will be dispatched locally. If you invoke on a class instance via its proxy, the call will be dispatched remotely. So, you can choose the behavior you want.

Another way to (conceptully) pass a reference to Java (non-Ice) object is to have the server create the object and put it into a table. The server then passes the table index to the client, and the client can return the index to the server to indicate which object it is referring to.

The first option (using a proper Ice object and invoking on its proxy) is preferable, unless you really have no choice but to use option 2.

Cheers,

Michi.
Reply With Quote
  #3 (permalink)  
Old 02-11-2007
nicole nicole is offline
Registered User
 
Name: Nicole Yoblick
Organization: highbridge capital management
Project: jmsForC#Client
 
Join Date: Feb 2007
Posts: 3
The reason I am returning a proxy from the server to the client
(JMSQueueIce* lookup( string destinationName) ...) instead of just a regular class is to be able to associate a non-ice object with the ice object JMSQueueIceObject on the server to save the non-ice object (saving state). Is there a better way to enable this sort of caching?

Thanks!
Reply With Quote
  #4 (permalink)  
Old 02-12-2007
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 907
I'm not sure I fully understand what you are after...

As I said previously, if you want to allow the client to denote a non-Ice object in the server, one way to do it is to have the server associate some unique identifier (such as a table index) with the object and then have the client pass that identifier.

Cheers,

Michi.
Reply With Quote
  #5 (permalink)  
Old 02-12-2007
nicole nicole is offline
Registered User
 
Name: Nicole Yoblick
Organization: highbridge capital management
Project: jmsForC#Client
 
Join Date: Feb 2007
Posts: 3
How would I implement the table suggestion?

I was reading the former post you recommended, and have these questions:

- How do you denote an address space for a Prx? Isn't is always remote?
Or can you have some methods in the Prx (such as getName() ) be local and others be remote?
Reply With Quote
  #6 (permalink)  
Old 02-12-2007
matthew's Avatar
matthew matthew is online now
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,052
Quote:
...
- How do you denote an address space for a Prx? Isn't is always remote?
Or can you have some methods in the Prx (such as getName() ) be local and others be remote?
A proxy has nothing to do with whether the referenced object is remote or local. A proxy refers a single Ice object (defined by the object identity and optionally addressing information). I re-read your posts and to be honest I have no idea what you really want to do... Perhaps you should restate your goals?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem passing context map with createSession() bartley Help Center 6 02-02-2006 11:39 PM
Passing parameters to constructor jacopo Help Center 2 05-12-2005 01:47 PM
passing a context to a locator robert Help Center 4 10-23-2004 12:26 PM
Passing Java Objects using Slice brian Help Center 10 05-03-2004 06:42 PM


All times are GMT -4. The time now is 11:49 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.