Class RemoteUtils

java.lang.Object
org.apache.commons.jcs3.auxiliary.remote.RemoteUtils

public class RemoteUtils extends Object
This class provides some basic utilities for doing things such as starting the registry properly.
  • Method Details

    • createRegistry

      public static Registry createRegistry(int port)
      Creates and exports a registry on the specified port of the local host.

      Parameters:
      port -
      Returns:
      the registry
    • loadProps

      public static Properties loadProps(String propFile) throws IOException
      Loads properties for the named props file. First tries class path, then file, then URL

      Parameters:
      propFile -
      Returns:
      The properties object for the file, never null
      Throws:
      IOException
    • configureGlobalCustomSocketFactory

      public static void configureGlobalCustomSocketFactory(int timeoutMillis)
      Configure a custom socket factory to set the timeout value. This sets the global socket factory. It's used only if a custom factory is not configured for the specific object.

      Parameters:
      timeoutMillis -
    • getNamingURL

      public static String getNamingURL(RemoteLocation location, String serviceName)
      Get the naming url used for RMI registration
      Parameters:
      location - the remote location
      serviceName - the remote service name
      Returns:
      the URL for RMI lookup
    • getNamingURL

      public static String getNamingURL(String registryHost, int registryPort, String serviceName)
      Get the naming url used for RMI registration
      Parameters:
      registryHost - the remote host
      registryPort - the remote port
      serviceName - the remote service name
      Returns:
      the URL for RMI lookup