com.sun.enterprise.admin.launcher
Class GFLauncher

java.lang.Object
  extended by com.sun.enterprise.admin.launcher.GFLauncher

public abstract class GFLauncher
extends Object

This is the main Launcher class designed for external and internal usage. Each of the 3 kinds of server -- domain, node-agent and instance -- need to subclass this class.

Author:
bnevins

Method Summary
 String getAdminRealmKeyFile()
          Returns the admin realm key file for the server, if the admin realm is a FileRealm.
 List<String> getCommandLine()
           
 int getDebugPort()
          Return the port number of the debug port, or -1 if debugging is not enabled.
 int getExitValue()
          Returns the exit value of the process.
 GFLauncherInfo getInfo()
           
 List<String> getJvmOptions()
           
 String getLogFilename()
          Get the location of the server logfile
 Process getProcess()
          You don't want to call this before calling launch because it would not make sense.
 ProcessStreamDrainer getProcessStreamDrainer()
          A ProcessStreamDrainer is always attached to every Process created here.
 boolean isDebugSuspend()
          Return true if suspend=y AND debugging is on.
 boolean isSecureAdminEnabled()
          Returns true if secure admin is enabled
 void launch()
          Launches the server.
 void launchJVM(List<String> cmdsIn)
           
 boolean needsAutoUpgrade()
          Does this domain need to be automatically upgraded before it can be started?
 boolean needsManualUpgrade()
          Does this domain need to be manually upgraded before it can be started?
 void relaunch()
          Launches the server - but forces the setup() to go through again.
 void setup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInfo

public final GFLauncherInfo getInfo()
Returns:
The info object that contains startup info

launch

public final void launch()
                  throws GFLauncherException
Launches the server. Any fatal error results in a GFLauncherException No unchecked Throwables of any kind will be thrown.

Throws:
GFLauncherException

relaunch

public final void relaunch()
                    throws GFLauncherException
Launches the server - but forces the setup() to go through again.

Throws:
GFLauncherException

launchJVM

public final void launchJVM(List<String> cmdsIn)
                     throws GFLauncherException
Throws:
GFLauncherException

setup

public void setup()
           throws GFLauncherException,
                  MiniXmlParserException
Throws:
GFLauncherException
MiniXmlParserException

getAdminRealmKeyFile

public String getAdminRealmKeyFile()
Returns the admin realm key file for the server, if the admin realm is a FileRealm. Otherwise return null. This value can be used to create a FileRealm for the server.


isSecureAdminEnabled

public boolean isSecureAdminEnabled()
Returns true if secure admin is enabled


getExitValue

public final int getExitValue()
Returns the exit value of the process. This only makes sense when we ran in verbose mode and waited for the process to exit in the wait() method. Caveat Emptor!

Returns:
the process' exit value if it completed and we waited. Otherwise it returns -1

getProcess

public final Process getProcess()
                         throws GFLauncherException
You don't want to call this before calling launch because it would not make sense.

Returns:
The Process object of the launched Server process. you will either get a valid Process object or an Exceptio will be thrown. You are guaranteed not to get a null.
Throws:
GFLauncherException - if the Process has not been created yet - call launch() before calling this method.

getProcessStreamDrainer

public final ProcessStreamDrainer getProcessStreamDrainer()
                                                   throws GFLauncherException
A ProcessStreamDrainer is always attached to every Process created here. It is handy for getting the stdin and stdout as a nice String.

Returns:
A valid ProcessStreamDrainer. You are guaranteed to never get a null.
Throws:
GFLauncherException - if the process has not launched yet
See Also:
ProcessStreamDrainer

getLogFilename

public String getLogFilename()
                      throws GFLauncherException
Get the location of the server logfile

Returns:
The full path of the logfile
Throws:
GFLauncherException - if you call this method too early

getDebugPort

public final int getDebugPort()
Return the port number of the debug port, or -1 if debugging is not enabled.

Returns:
the debug port, or -1 if not debugging

isDebugSuspend

public final boolean isDebugSuspend()
Return true if suspend=y AND debugging is on. otherwise return false.

Returns:
the debug port, or -1 if not debugging

needsAutoUpgrade

public final boolean needsAutoUpgrade()
Does this domain need to be automatically upgraded before it can be started?

Returns:
true if the domain needs to be upgraded first

needsManualUpgrade

public final boolean needsManualUpgrade()
Does this domain need to be manually upgraded before it can be started?

Returns:
true if the domain needs to be upgraded first

getCommandLine

public final List<String> getCommandLine()

getJvmOptions

public final List<String> getJvmOptions()


Copyright © 2012. All Rights Reserved.