org.apache.jcs.auxiliary.remote.server
Class RegistryKeepAliveRunner

java.lang.Object
  extended by org.apache.jcs.auxiliary.remote.server.RegistryKeepAliveRunner
All Implemented Interfaces:
Runnable

public class RegistryKeepAliveRunner
extends Object
implements Runnable

This class tries to keep the resitry alive. If if is able to create a registry, it will also rebind the remote cache server.


Constructor Summary
RegistryKeepAliveRunner(String registryHost, int registryPort, String serviceName)
           
 
Method Summary
protected  void checkAndRestoreIfNeeded()
          Tries to lookup the server.
protected  void createAndRegister(String registry)
          Creates the registry and registers the server.
protected  void createReqistry(String registry)
          Try to create the registry.
protected  void registerServer(String registry)
          Try to rebind the server.
 void run()
          Tries to lookup the server.
 void setCacheEventLogger(ICacheEventLogger cacheEventLogger)
          Allows it to be injected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryKeepAliveRunner

public RegistryKeepAliveRunner(String registryHost,
                               int registryPort,
                               String serviceName)
Parameters:
registryHost - - Hostname of the registry
registryPort - - the port on which to start the registry
serviceName -
Method Detail

run

public void run()
Tries to lookup the server. If unsuccessful it will rebind the server using the factory rebind method.

Specified by:
run in interface Runnable

checkAndRestoreIfNeeded

protected void checkAndRestoreIfNeeded()
Tries to lookup the server. If unsuccessful it will rebind the server using the factory rebind method.


createAndRegister

protected void createAndRegister(String registry)
Creates the registry and registers the server.

Parameters:
registry -

createReqistry

protected void createReqistry(String registry)
Try to create the registry. Log errors

Parameters:
registry -

registerServer

protected void registerServer(String registry)
Try to rebind the server.

Parameters:
registry -

setCacheEventLogger

public void setCacheEventLogger(ICacheEventLogger cacheEventLogger)
Allows it to be injected.

Parameters:
cacheEventLogger -


Copyright © 2002-2012 Apache Software Foundation. All Rights Reserved.