• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

RMI experts-> createRegistry and a stupid argument...

 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,
in my server start, i am asking the registry port, server port and host name (3 args).
i am using Naming.bind and Naming.lookup.

when i have to start the registry programatically , it works, irrrespective of the any_integer i am passing.
so i am planning to abondon the registry port input. i am also planning to keep at as it never hurts(just one more param). will it be OK. i am not sure though ,
it may turn out that the port/any_integer is the basic of RMI.
what is the use of the argument in LocateRegistry.createRegistry(int).
is Naming so superior, that it can find the registered obects in any port.


from 1.4 API
Creates and exports a Registry on the local host that accepts requests on the specified port.



please help!!!
Any notes will open a door to me in RMI.
[ March 20, 2003: Message edited by: aadhi agathi ]
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What more, i can start the registries on two different ports and bind a server with the same name. God knows, when somebody is doing a lookup using Naming.lookup(), it will use which registry and which object will be found.
when i tried to do a Registry.bind, it doesn't work! that makes me suspicious.
I have tried to start the registry 1t port 1099 and 1001 in that order , then bind the server. when the client says lookup 1001 registry is used
the, I have tried to start the registry 1t port 1001 and 1099 in that order , then bind the server. when the client says lookup 1009 registry is used.
so whenever i say bind , it erases the old copy and the new copy is used!! then what is the use of createRegistry ( ) at some port???
any help!!
[ March 20, 2003: Message edited by: aadhi agathi ]
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


in my server start, i am asking the registry port, server port and host name (3 args).


What is the server port if you bind your remote object to a specific port in the registry? What do you need a host name for, -- it's always localhost to the server. In fact, you don't need to specify the host at all:

It's the client that should specify the host name, not the server.
Eugene.
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eugene Kononov:

It's the client that should specify the host name, not the server.
Eugene.



so i have always use rmi://"+hostName+ "/"+port,Object . anyway feel good to get it clarified
But what about the createRegistry


would i use getRegistry() instead of ,createRegistry(int port)


am i correct. but i am still curious about the createRegistry, what purpose does it serve!!!
pls put in your comments!
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


so i have always use rmi://"+hostName+ "/"+port,Object . anyway feel good to get it clarified


There is Naming.rebind() and Registry.rebind(). The former one takes a URL-formatted String, the latter one takes just a String. The Java doc for Registry.rebind() was actually wrong up until JDK 1.4.0 where Sun finally fixed it.
Eugene.
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eugene Kononov:

There is Naming.rebind() and Registry.rebind().
Eugene.


for me, the Registry.rebind() doesn't work! i am using Naming.rebind(String). but what about starting the registry. what to use
1.createRegistry(int port) or
2.getRegistry()
i am confused on the part of creating the registry, dynamically. These two methods are not identical, as one takes a port. i dont know<B>how this port makes a difference</B>
Thanks much for the help!!
[ March 21, 2003: Message edited by: aadhi agathi ]
 
This guy is skipping without a rope. At least, that's what this tiny ad said:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic