Home Help Center

implement location service in Java

gumshoegumshoe Member Gum ShoesOrganization: EnbridgeProject: Enterprise wide IPC framework.

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:
import Ice
import CustomIPC.Locator

class FileRegistry(Ice.Locator, CustomIPC.Locator.FileRegistry):

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.



  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    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.


  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff

    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.

  • gumshoegumshoe Member Gum ShoesOrganization: EnbridgeProject: Enterprise wide IPC framework.
    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.
Sign In or Register to comment.