com.creamtec.ajaxswing.core
Class AjaxSwingRegistryManager

java.lang.Object
  extended by com.creamtec.ajaxswing.core.AjaxSwingRegistryManager

public class AjaxSwingRegistryManager
extends java.lang.Object

Manages RMI registry. For the main (servlet) process, the registry is created in-process. For client agent JVMs, the registry is expected to be running on the configured port.


Constructor Summary
AjaxSwingRegistryManager()
           
 
Method Summary
static void execProcess(java.lang.String procName, java.lang.String param)
          Executes the script with the given name from the bin directory.
static int getActivePort()
           
static java.rmi.registry.Registry getRegistry(int port, int portRange)
          Locates the registry on the given port.
static void shutdownRegistry()
          Shuts down the registry, if it was created in this process
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AjaxSwingRegistryManager

public AjaxSwingRegistryManager()
Method Detail

getRegistry

public static java.rmi.registry.Registry getRegistry(int port,
                                                     int portRange)
                                              throws java.lang.Exception
Locates the registry on the given port. First tries to connect to the registry on the given port. If the registry is not running, attempts to create it in-process. If that fails, attempts to connect to the registry running on the default RMI port. If that fails and attemptRunningExternal is true, attempts to launch an external registry using runRegistry script.

Parameters:
port - initial registry port
attemptRunningExternal - if true, an attempt will be made to run registry externally
Returns:
Registry
Throws:
java.lang.Exception

execProcess

public static void execProcess(java.lang.String procName,
                               java.lang.String param)
                        throws java.lang.Exception
Executes the script with the given name from the bin directory. For Windows, the script extension is .bat, for UNIX it is .sh.

Parameters:
procName - script name, such as "runRegistry"
param - command line parameters to the script
Throws:
java.lang.Exception

shutdownRegistry

public static void shutdownRegistry()
Shuts down the registry, if it was created in this process


getActivePort

public static int getActivePort()


Copyright © 2000-2012 CreamTec LLC. All Rights Reserved.