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 SummaryFields inherited from interface org.apache.commons.jcs3.auxiliary.remote.behavior.IRemoteCacheConstantsCACHE_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 SummaryModifier and TypeMethodDescriptionprotected static ICacheEventLoggerTries to get the event logger.protected static RMISocketFactoryThis configures an object specific custom factory.protected static RemoteCacheServerAttributesConfigure.static <K,V> RemoteCacheServer<K, V> This will allow you to get stats from the server, etc.protected static Stringprotected static voidkeepAlive(String registryHost, int registryPort, ICacheEventLogger cacheEventLogger) Tries to lookup the server.static voidCreates an local RMI registry on the default port, starts up the remote cache server, and binds it to the registry.protected static voidregisterServer(String serviceName, Remote server) Registers the server with the registry.protected static voidsetServiceName(String serviceName) static voidstartup(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- 
getRemoteCacheServerThis 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.
 
- 
startupStarts 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
 
- 
keepAliveprotected 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 registry
- registryPort- - the port on which to start the registry
- cacheEventLogger- the event logger for error messages
- Since:
- 3.1
 
- 
configureCacheEventLoggerTries to get the event logger.- Parameters:
- props- configuration properties
- Returns:
- ICacheEventLogger, may be null
 
- 
configureObjectSpecificCustomFactoryThis 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
 
- 
registerServerRegisters 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 service
- server- the server object to bind
- Throws:
- RemoteException
 
- 
configureRemoteCacheServerAttributesConfigure.jcs.remotecache.serverattributes.ATTRIBUTENAME=ATTRIBUTEVALUE - Parameters:
- prop-
- Returns:
- RemoteCacheServerAttributesconfigureRemoteCacheServerAttributes
 
- 
mainCreates 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
 
 
-