Class RemoteCacheServerFactory
java.lang.Object
org.apache.commons.jcs3.auxiliary.remote.server.RemoteCacheServerFactory
- All Implemented Interfaces:
IRemoteCacheConstants
Provides remote cache services. This creates remote cache servers and can proxy command line
requests to a running server.
-
Field Summary
Fields inherited from interface org.apache.commons.jcs3.auxiliary.remote.behavior.IRemoteCacheConstants
CACHE_SERVER_ATTRIBUTES_PROPERTY_PREFIX, CACHE_SERVER_PREFIX, CUSTOM_RMI_SOCKET_FACTORY_PROPERTY_PREFIX, PROPERTY_PREFIX, REMOTE_ALLOW_CLUSTER_GET, REMOTE_CACHE_SERVICE_NAME, REMOTE_CACHE_SERVICE_PORT, REMOTE_CACHE_SERVICE_VAL, REMOTE_LOCAL_CLUSTER_CONSISTENCY, SOCKET_TIMEOUT_MILLIS, TOMCAT_ON, TOMCAT_XML
-
Method Summary
Modifier and TypeMethodDescriptionprotected static ICacheEventLogger
Tries to get the event logger.protected static RMISocketFactory
This configures an object specific custom factory.protected static RemoteCacheServerAttributes
Configure.static <K,
V> RemoteCacheServer<K, V> This will allow you to get stats from the server, etc.protected static String
protected static void
keepAlive
(String registryHost, int registryPort, ICacheEventLogger cacheEventLogger) Tries to lookup the server.static void
Creates an local RMI registry on the default port, starts up the remote cache server, and binds it to the registry.protected static void
registerServer
(String serviceName, Remote server) Registers the server with the registry.protected static void
setServiceName
(String serviceName) static void
startup
(String host, int port, Properties props) Starts up the remote cache server on this JVM, and binds it to the registry on the given host and port.
-
Method Details
-
getRemoteCacheServer
This will allow you to get stats from the server, etc. Perhaps we should provide methods on the factory to do this instead.A remote cache is either a local cache or a cluster cache.
- Returns:
- Returns the remoteCacheServer.
-
startup
Starts up the remote cache server on this JVM, and binds it to the registry on the given host and port.A remote cache is either a local cache or a cluster cache.
- Parameters:
host
-port
-props
-- Throws:
IOException
-
keepAlive
protected static void keepAlive(String registryHost, int registryPort, ICacheEventLogger cacheEventLogger) Tries to lookup the server. If unsuccessful it will rebind the server using the factory rebind method.- Parameters:
registryHost
- - Hostname of the registryregistryPort
- - the port on which to start the registrycacheEventLogger
- the event logger for error messages- Since:
- 3.1
-
configureCacheEventLogger
Tries to get the event logger.- Parameters:
props
- configuration properties- Returns:
- ICacheEventLogger, may be null
-
configureObjectSpecificCustomFactory
This configures an object specific custom factory. This will be configured for just this object in the registry. This can be null.- Parameters:
props
-- Returns:
- RMISocketFactory
-
registerServer
Registers the server with the registry. I broke this off because we might want to have code that will restart a dead registry. It will need to rebind the server.- Parameters:
serviceName
- the name of the serviceserver
- the server object to bind- Throws:
RemoteException
-
configureRemoteCacheServerAttributes
Configure.jcs.remotecache.serverattributes.ATTRIBUTENAME=ATTRIBUTEVALUE
- Parameters:
prop
-- Returns:
- RemoteCacheServerAttributesconfigureRemoteCacheServerAttributes
-
main
Creates an local RMI registry on the default port, starts up the remote cache server, and binds it to the registry.A remote cache is either a local cache or a cluster cache.
- Parameters:
args
- The command line arguments- Throws:
Exception
-
setServiceName
- Parameters:
serviceName
- the serviceName to set
-
getServiceName
- Returns:
- the serviceName
-