Class HostConfigurableSocketFactory

  • All Implemented Interfaces:
    java.io.Serializable, java.rmi.server.RMIClientSocketFactory, java.rmi.server.RMIServerSocketFactory

    public class HostConfigurableSocketFactory
    extends java.lang.Object
    implements java.rmi.server.RMIServerSocketFactory, java.rmi.server.RMIClientSocketFactory, java.io.Serializable
    This Spring depended class allows to control the binding of a RMI Registry to some port and concrete local host, e.g.: localhost, 192.168.0.1 etc. Host may be configured with the -Djava.rmi.server.hostname system property

    NOTE: Please look at ALF-4357 for more information
    Author:
    Dmitry Velichkevich
    See Also:
    Spring dependence, RMIServerSocketFactory, RMIClientSocketFactory, Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.ServerSocket createServerSocket​(int port)  
      java.net.Socket createSocket​(java.lang.String host, int port)  
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      void setHost​(java.lang.String host)  
      void setRetries​(int retries)
      How many retries to attempt if the socket is in use.
      void setRetryInterval​(int retryInterval)
      How long to wait between retries, in miliseconds?
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HostConfigurableSocketFactory

        public HostConfigurableSocketFactory()
    • Method Detail

      • setHost

        public void setHost​(java.lang.String host)
      • setRetries

        public void setRetries​(int retries)
        How many retries to attempt if the socket is in use. Default is zero (no retries)
      • setRetryInterval

        public void setRetryInterval​(int retryInterval)
        How long to wait between retries, in miliseconds?
      • createSocket

        public java.net.Socket createSocket​(java.lang.String host,
                                            int port)
                                     throws java.io.IOException
        Specified by:
        createSocket in interface java.rmi.server.RMIClientSocketFactory
        Throws:
        java.io.IOException
      • createServerSocket

        public java.net.ServerSocket createServerSocket​(int port)
                                                 throws java.io.IOException
        Specified by:
        createServerSocket in interface java.rmi.server.RMIServerSocketFactory
        Throws:
        java.io.IOException
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object