RMI host binding question

Discussion in 'Java' started by G, Jun 18, 2007.

  1. G

    G Guest

    Greetings,

    I have code that starts the RMI registry as follows:

    LocateRegistry.createRegistry(5000);

    This works fine, however the registry listens on all interfaces at the
    port 5000. I would like rmi registry to listen only on localhost
    interface, in similar fashion to the way you can make MySQL and
    Postfix listen only to localhost. For example a netstat -ta would
    reveal:

    Proto Recv-Q Send-Q Local Address Foreign Address
    State
    tcp 0 0 localhost:mysql *:*
    LISTEN
    tcp 0 0 *:www *:*
    LISTEN
    tcp 0 0 localhost:smtp *:*
    LISTEN
    tcp 0 0 *:5000 *:*
    LISTEN
    tcp6 0 0 *:ssh *:*
    LISTEN

    In other words I would like to see:

    tcp 0 0 localhost:5000
    *:* LISTEN

    Does anyone know if rmi registry supports interface binding like this?
    >From what I can tell, it does not.


    Cheers,
    Greg
     
    G, Jun 18, 2007
    #1
    1. Advertising

  2. On Mon, 18 Jun 2007 06:55:30 -0700, G wrote:
    > In other words I would like to see:
    >
    > tcp 0 0 localhost:5000
    > *:* LISTEN
    >
    > Does anyone know if rmi registry supports interface binding like this?
    > From what I can tell, it does not.


    From what I can tell you can use the other createRegistry() method,
    and specify an RMIServerSocketFactory to create the actual
    ServerSocket that's to be used. So you should be able to create one
    that binds to localhost:port.

    Note: I haven't actually tried this.

    /gordon

    --
     
    Gordon Beaton, Jun 18, 2007
    #2
    1. Advertising

  3. G

    Tom Hawtin Guest

    G wrote:
    >
    > I have code that starts the RMI registry as follows:
    >
    > LocateRegistry.createRegistry(5000);
    >
    > This works fine, however the registry listens on all interfaces at the
    > port 5000. I would like rmi registry to listen only on localhost
    > interface, in similar fashion to the way you can make MySQL and
    > Postfix listen only to localhost. For example a netstat -ta would
    > reveal:


    The other LocateRegistry.createRegistry is;

    public static Registry createRegistry(
    int port,
    RMIClientSocketFactory csf,
    RMIServerSocketFactory ssf
    )

    So implement an RMIServerSocketFactory that creates server sockets bound
    to the localhost address.

    Tom Hawtin
     
    Tom Hawtin, Jun 18, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark McKay

    Restricting RMI calls by host

    Mark McKay, Sep 26, 2003, in forum: Java
    Replies:
    0
    Views:
    330
    Mark McKay
    Sep 26, 2003
  2. Alexander N. Spitzer
    Replies:
    21
    Views:
    1,814
    Randolf Richardson
    Aug 16, 2004
  3. Buu Nguyen

    RMI, JINI or RMI/IIOP

    Buu Nguyen, Aug 25, 2004, in forum: Java
    Replies:
    1
    Views:
    578
    Sudsy
    Aug 25, 2004
  4. JScoobyCed

    RMI Vs RMI over IIOP

    JScoobyCed, Jan 28, 2005, in forum: Java
    Replies:
    1
    Views:
    754
    Dag Sunde
    Jan 28, 2005
  5. Jan Schulze
    Replies:
    1
    Views:
    580
    Esmond Pitt
    Mar 26, 2005
Loading...

Share This Page