Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 11-02-2004
vsonnathi vsonnathi is offline
Registered User
 
Name: Venkat Ramana
Organization: Amazon.com
Project: Prototype
 
Join Date: May 2004
Posts: 39
IceBoxService, Servant and Communicator question

Hi,

I am using IceBox service to register my servant posting code below:

public class IceBoxService extends Ice.LocalObjectImpl implements
<pre>
IceBox.Service {

private Ice.ObjectAdapter adapter;

public void start(String s, Communicator communicator, String[] strings) {

this.adapter = communicator.createObjectAdapter(s);
Ice.Object object = new FCASearchI();
adapter.add(object, Ice.Util.stringToIdentity("SimpleFCASearch"));
adapter.activate();
}

public void stop() {
adapter.deactivate();
}
}

}
</pre>

My servant FCASearchI needs to lookup with other services, what is the best/recommended way to lookup those? Is it okay to create an new communicator in the servant for the purposes of lookup? Will that interfere with SharedCommunicator instance if all the services in an IceBox share a single communicator?

Thanks in advance,
--Venkat.
Reply With Quote
  #2 (permalink)  
Old 11-02-2004
mes's Avatar
mes mes is online now
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 971
Hi Venkat,

Creating a communicator is expensive, therefore we recommend that you avoid it unless absolutely necessary. Marc discussed this issue recently here.

My suggestion is to pass the communicator to the servant's constructor. The servant can then use it in the constructor, or save it to use later.

Take care,
- Mark
Reply With Quote
  #3 (permalink)  
Old 11-02-2004
vsonnathi vsonnathi is offline
Registered User
 
Name: Venkat Ramana
Organization: Amazon.com
Project: Prototype
 
Join Date: May 2004
Posts: 39
Hi Mark,

Thanks for your suggestion. The other thread you pointed also clearly explains the differences.

--Venkat.
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
Question of forwarding ObjectPrx in Servant Locator kongchoy Help Center 6 02-17-2006 08:26 PM
IceBoxService and Logger xdm Help Center 2 01-11-2006 07:34 AM
How to name 'communicator' code Help Center 3 06-12-2005 04:30 PM
do i need the second communicator ? nsns Help Center 1 10-25-2004 11:06 AM
question: servant locators raj Help Center 1 12-28-2003 01:50 PM


All times are GMT -4. The time now is 04:57 PM.


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.