• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Two questions

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello!

I have two questions I have struggled to find a solution to.

My first question is what is needed for code to enter a synchronized block? I'm trying to debug my lock method and it seems whenever I call the lock method, my code enters the method, but doesn't enter the synchronized block.

My second question is how can I take an ip address given to me, try to connect to it with rmi, and if I can't connect to it in a certain amount of time, timeout and give an error message?

Thanks!
David Pham
[ August 21, 2007: Message edited by: David Khoi Pham ]
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe that if the synchronized code is never executed, it means that in some place you have a lock which is needed to release, otherwise at least once the synchronized code would run.


When you call Naming.lookup("rmi://...IP.../rmi_object") in the client side, you can specify the IP. I think if the client can't connect to the remote object you'll get a RemoteException, but I don't know how long is the time out specified.
 
No one can make you feel inferior without your consent - Eleanor Roosevelt. tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic