Class RemoteUtils
java.lang.Object
org.apache.commons.jcs3.auxiliary.remote.RemoteUtils
This class provides some basic utilities for doing things such as starting
the registry properly.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
configureGlobalCustomSocketFactory
(int timeoutMillis) Configure a custom socket factory to set the timeout value.static Registry
createRegistry
(int port) Creates and exports a registry on the specified port of the local host.static String
getNamingURL
(String registryHost, int registryPort, String serviceName) Get the naming url used for RMI registrationstatic String
getNamingURL
(RemoteLocation location, String serviceName) Get the naming url used for RMI registrationstatic Properties
Loads properties for the named props file.
-
Method Details
-
createRegistry
Creates and exports a registry on the specified port of the local host.- Parameters:
port
-- Returns:
- the registry
-
loadProps
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
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
Get the naming url used for RMI registration- Parameters:
location
- the remote locationserviceName
- the remote service name- Returns:
- the URL for RMI lookup
-
getNamingURL
Get the naming url used for RMI registration- Parameters:
registryHost
- the remote hostregistryPort
- the remote portserviceName
- the remote service name- Returns:
- the URL for RMI lookup
-