The Artima Developer Community
Sponsored Link

Jini Forum
MAD!! Problem about ServiceDiscoveryListener

2 replies on 1 page. Most recent reply: Mar 31, 2004 12:09 PM by Steve Hoffman

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
yulu

Posts: 1
Nickname: sparks
Registered: Jan, 2004

MAD!! Problem about ServiceDiscoveryListener Posted: Jan 26, 2004 9:19 PM
Reply to this message Reply
Advertisement
I've implemented a ServiceDiscoveryListener which monitors all services in the lookup service and simply puts and removes serviceItems in a hashtable as they are removed or registered. The problem is that whenever a new services is registered with or removed from the lookup service, it seems that the lookup service doesn't notify my client at all!!

ServiceDiscoveryManager sdm = new ServiceDiscoveryManager(null,null);
LookupCache cache = sdm.createLookupCache(null,null,this);
//try to get all services available
ServiceItem[] items = cache.lookup(null,Integer.MAX_VALUE);

(Exception handling were ommitted here for simplicity)are those lines right? If not, what should I do? Thanks a lot for any help, I've been stucked on this whole night and nearly mad.......


Dan Creswell

Posts: 49
Nickname: dancres
Registered: Apr, 2003

Re: MAD!! Problem about ServiceDiscoveryListener Posted: Jan 28, 2004 4:40 AM
Reply to this message Reply
Okay, I dunno, because I can't see all your code but are you expecting that call to lookup to actually go talk to all the service registrars and return the results?

If so, I'm not sure that's what actually happens. I think what's probably happening is that you haven't allowed enough time for the cache to be populated with entries - i.e. the populating of the cache is asynchronous not synchronous.

Try creating the cache, sleeping for a couple of minutes and then invoking the lookup and see what happens......

Steve Hoffman

Posts: 2
Nickname: hoffman
Registered: Mar, 2004

Re: MAD!! Problem about ServiceDiscoveryListener Posted: Mar 31, 2004 12:09 PM
Reply to this message Reply
I've noticed that if your codebase isn't set correctly, the client won't get called. The easy way to tell is to run the example browser on another machine. If you point it at your lookup server and you see your service as "Unknown Service" then your codebase is foobar.

w/o more info it would be hard to speculate more than I already have... I just ran into this reciently and thought your problem sounded familar.

Steve

Flat View: This topic has 2 replies on 1 page
Topic: BILLING SYTEM ADVISE IS NEEDED Previous Topic   Next Topic Topic: Reggie problem-URGENT

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use