GemFire 7.0

com.gemstone.gemfire.distributed
Class AbstractLauncher<T extends Comparable<T>>

java.lang.Object
  extended by com.gemstone.gemfire.distributed.AbstractLauncher<T>
All Implemented Interfaces:
Identifiable<T>, Serializable, Runnable
Direct Known Subclasses:
LocatorLauncher, ServerLauncher

public abstract class AbstractLauncher<T extends Comparable<T>>
extends Object
implements Runnable, Identifiable<T>

The AbstractLauncher class is a base class for implement various launchers to construct and run different GemFire processes, like Cache servers or Locators, Managers, HTTP servers and so on.

Since:
7.0
See Also:
Comparable, Runnable, Identifiable, Serialized Form

Nested Class Summary
static class AbstractLauncher.ServiceState<T extends Comparable<T>>
          The ServiceState is an immutable type representing the state of the specified Locator at any given moment in time.
static class AbstractLauncher.Status
          The Status enumerated type represents the various lifecycle states of a GemFire service (such as a Cache Server, a Locator or a Manager).
 
Field Summary
static String DEFAULT_WORKING_DIRECTORY
           
static String SIGNAL_HANLDER_REGISTRATION_SYSTEM_PROPERTY
           
 
Constructor Summary
AbstractLauncher()
           
 
Method Summary
abstract  String getLogFileName()
          Gets the name of the log file used to log information about this GemFire service.
 String getMember()
          Gets the name or ID of the member in the GemFire distributed system.
 String getMemberId()
          Gets the ID of the member in the GemFire distributed system as determined and assigned by GemFire when the member process joins the distributed system.
abstract  String getMemberName()
          Gets the name of the member in the GemFire distributed system as determined by the 'name' GemFire property.
abstract  Integer getPid()
          Gets the user-specified process ID (PID) of the running GemFire service that AbstractLauncher implementations can use to determine status, or stop the service.
abstract  String getServiceName()
          Gets the name of the GemFire service.
 String getWorkingDirectory()
          Gets the working directory pathname in which the process will be run.
 boolean isDebugging()
          Determines whether the Locator launcher is in debug mode.
 boolean isRunning()
          Determines whether the Locator referenced by this launcher is running.
 void setDebug(boolean debug)
          Sets the debug mode of the GemFire launcher class.
 String version()
          Gets the version of GemFire currently running.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 
Methods inherited from interface com.gemstone.gemfire.lang.Identifiable
getId
 

Field Detail

DEFAULT_WORKING_DIRECTORY

public static final String DEFAULT_WORKING_DIRECTORY

SIGNAL_HANLDER_REGISTRATION_SYSTEM_PROPERTY

public static final String SIGNAL_HANLDER_REGISTRATION_SYSTEM_PROPERTY
See Also:
Constant Field Values
Constructor Detail

AbstractLauncher

public AbstractLauncher()
Method Detail

isDebugging

public boolean isDebugging()
Determines whether the Locator launcher is in debug mode.

Returns:
a boolean to indicate whether the Locator launcher is in debug mode.
See Also:
setDebug(boolean)

setDebug

public final void setDebug(boolean debug)
Sets the debug mode of the GemFire launcher class. This mutable property of the launcher enables the user to turn the debug mode on and off programmatically.

Parameters:
debug - a boolean used to enable or disable debug mode.
See Also:
isDebugging()

isRunning

public boolean isRunning()
Determines whether the Locator referenced by this launcher is running.

Returns:
a boolean valued indicating if the referenced Locator is running.

getLogFileName

public abstract String getLogFileName()
Gets the name of the log file used to log information about this GemFire service.

Returns:
a String value indicating the name of this GemFire service's log file.

getMember

public String getMember()
Gets the name or ID of the member in the GemFire distributed system. This method prefers name if specified, otherwise the ID is returned. If name was not specified to the Builder that created this Launcher and this call is not in-process, then null is returned.

Returns:
a String value indicating the member's name if specified, otherwise the member's ID is returned if this call is made in-process, or finally, null is returned if neither name name was specified or the call is out-of-process.
See Also:
getMemberName(), getMemberId()

getMemberName

public abstract String getMemberName()
Gets the name of the member in the GemFire distributed system as determined by the 'name' GemFire property.

Returns:
a String value indicating the name of the member in the GemFire distributed system.

getMemberId

public String getMemberId()
Gets the ID of the member in the GemFire distributed system as determined and assigned by GemFire when the member process joins the distributed system. Note, this call only works if the API is used in-process.

Returns:
a String value indicating the ID of the member in the GemFire distributed system.

getPid

public abstract Integer getPid()
Gets the user-specified process ID (PID) of the running GemFire service that AbstractLauncher implementations can use to determine status, or stop the service.

Returns:
an Integer value indicating the process ID (PID) of the running GemFire service.

getServiceName

public abstract String getServiceName()
Gets the name of the GemFire service.

Returns:
a String indicating the name of the GemFire service.

getWorkingDirectory

public String getWorkingDirectory()
Gets the working directory pathname in which the process will be run.

Returns:
a String value indicating the pathname of the Server's working directory.

version

public String version()
Gets the version of GemFire currently running.

Returns:
a String representation of GemFire's version.

GemFire 7.0

Copyright © 1997-2012 VMware, Inc. All rights reserved.