wt.manager
Class ServerLauncher

java.lang.Object
  extended bywt.manager.ServerLauncher

public class ServerLauncher
extends Object

A Class used by the server manager to launch new servers. This class uses service names to look up server launching commands as properties. Server launching command properties are of the form wt.manager.cmd.service_name.

If the command property value is a single word (i.e. no white space) and ends in .class, an attempt will be made to launch the service as an internal java.rmi.Remote object. Likewise, if no command property is found, but the service name is the fully qualified name of an available Java class, it will also be launched as an internal java.rmi.Remote object.

For external server processes, the command property is a command string that will be executed using java.lang.Runtime.exec.

This class contains a main method so it can be executed as a stand-alone application which will launch the "ServerManager" service using the configured launching command.

Supported API: true
Extendable: false


Field Summary
private static Process child_process
           
private static String RESOURCE
           
private static boolean serviceFlag
           
 
Constructor Summary
private ServerLauncher()
           
 
Method Summary
static void main(String[] args)
          Application main which launches the server manager.
static void setServiceFlag(boolean value)
           
static void start()
          Method called from within java code which launches the server manager.
private static void startInternal(String service_name, String class_name, ServerManager manager)
           
static void startServer(String service_name, ServerManager manager)
          Start a new instance of the specified service.
static void stopApplication()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

child_process

private static Process child_process

serviceFlag

private static boolean serviceFlag
Constructor Detail

ServerLauncher

private ServerLauncher()
Method Detail

setServiceFlag

public static void setServiceFlag(boolean value)

startServer

public static void startServer(String service_name,
                               ServerManager manager)
                        throws Exception
Start a new instance of the specified service. The service name is used to lookup a launch command for the service. If the command is the name of a Java class or no command is found, an internal server object is instantiated.

Supported API: false

Parameters:
service_name - name of the service
manager - local server manager instance for registering internal server objects (null if none).
Throws:
Exception - exception thrown executing command or instantiating server object

startInternal

private static void startInternal(String service_name,
                                  String class_name,
                                  ServerManager manager)
                           throws Exception
Throws:
Exception

start

public static void start()
                  throws Exception
Method called from within java code which launches the server manager. The command to launch the server manager is controlled by the wt.manager.cmd.ServerManager property.

Supported API: true

Throws:
Exception - throw by startServer method

main

public static void main(String[] args)
                 throws Exception
Application main which launches the server manager. The command to launch the server manager is controlled by the wt.manager.cmd.ServerManager property.

Supported API: true

Throws:
Exception - throw by startServer method

stopApplication

public static void stopApplication()