Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-26-2008
gumshoe gumshoe is offline
Registered User
 
Name: Ruedi Eder
Organization: Enbridge
Project: Enterprise wide IPC framework.
 
Join Date: Dec 2006
Posts: 18
implement location service in Java

Hi,

Location Services mentions that location service implementation is out of the scope for the document. Are there any examples, specifically in Java, already out there?

A colleague of mine got it working with Python by:

Code:
import Ice
import CustomIPC.Locator

class FileRegistry(Ice.Locator, CustomIPC.Locator.FileRegistry):
Implementing
def findObjectById_async(self, cb, id, current = None):
def findAdapterById_async(self, cb, id, current = None):

creating an OA, adding self to it, activating, and setting default locator to it.

My problem trying to do this in Java is not knowing exactly what interfaces to implement or classes to extend.
Implementing Ice.Locator can't be right as it implements Ice.Object and then too much internal stuff is exposed.

Thanks.
Reply With Quote
  #2 (permalink)  
Old 03-26-2008
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 912
If you want to implement your own location service, you need to implement the Ice::Locator interface and register your locator with the Ice run time. You can look at the implementation of the locator in IceGrid for inspiration.

I don't understand what you mean by derivation from Ice::Object exposing too much internal stuff. In fact every servant is-a Ice::Object--that's just how the API works.

Cheers,

Michi.
Reply With Quote
  #3 (permalink)  
Old 03-27-2008
benoit's Avatar
benoit benoit is online now
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,542
Hi,

You can also look at the implementation of the location service from the test/Ice/location test in your Ice for Java distribution. In Java, you need to create a class that extends Ice._LocatorDisp to implement the locator interface.

Cheers,
Benoit.
Reply With Quote
  #4 (permalink)  
Old 03-27-2008
gumshoe gumshoe is offline
Registered User
 
Name: Ruedi Eder
Organization: Enbridge
Project: Enterprise wide IPC framework.
 
Join Date: Dec 2006
Posts: 18
Thanks, that works. I was looking for a concrete class that already implemented Ice.Object and most of Ice.Locator to extend, not abstract interfaces to implement.
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
Unable to implement servant location in Ice for Python cmellon Help Center 1 01-04-2007 04:20 PM
How to start the iceBox in java for the storm service Jason Gao Help Center 5 10-20-2006 06:32 AM
broadcast / multicast location service? gerkey Help Center 3 10-05-2006 02:35 AM
Why Java proxies does not implement the slice interface ? annekat Comments 12 03-24-2006 11:38 AM
Icegrid java icebox service xdm Help Center 6 01-09-2006 04:59 AM


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