Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-03-2005
xdm's Avatar
xdm xdm is online now
ZeroC Staff
 
Name: José Gutíerrez de la Concha Martínez
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Sep 2003
Location: La Coruña, Spain
Posts: 291
java dictionaries

hello can anybody say me what is the correct way to return a proxy stored in a java dictionary.
Below i show an example of what i'm trying to do

Code:
                class FopProcesor
                {

                }

                dictionray <Ice::Identity,FopProceso*>FopProcesorMap;

                class FopServer
                {
                        FopProcesorMap procesors;
                        FopProcesorMap getProcesor(Ice::Identity procesorId);
                }
Code:
public class XslFooServerI extends XslFooServer
{
	
	public XslFooFopPrx getFopProcesor(Ice.Identity idProcesor,Ice.Current current)
	{
		return procesors.getKey(idProcesor);
	}
}

ouput error when build

XslFooServerI.java:13: cannot resolve symbol
    [javac] symbol  : method getKey (Ice.Identity)
Reply With Quote
  #2 (permalink)  
Old 03-03-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
You need to use get(), not getKey(). For example, if you know that all values in the map are of type XslFooFopPrx, you can do the following:
Code:
return (XslFooFopPrx)procesors.get(idProcesor);
If the proxies are of various types, you can do this:
Code:
FopProcesorPrx proxy = (FopProcesorPrx)procesors.get(idProcesor);
return XslFooFopPrxHelper.uncheckedCast(proxy);
- Mark
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
IceV3.11 java client and vc7.0Server : java.lang.NullPointerException? zhoubin Help Center 2 11-24-2006 04:03 AM
My first Python code fails with dictionaries Anhur Help Center 2 10-02-2006 10:03 AM
Patch #6 for Ice 3.1.0: byte sequences in dictionaries dwayne Patches 1 07-31-2006 10:35 AM
desing question about dictionaries xdm Help Center 0 11-23-2004 01:03 PM


All times are GMT -4. The time now is 09:51 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.