|
|
|
|||||
|
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. |
|
||||||
|
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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |