gov.sns.application
Class ApplicationStatusService

java.lang.Object
  |
  +--gov.sns.application.ApplicationStatusService
All Implemented Interfaces:
ApplicationStatus

public class ApplicationStatusService
extends java.lang.Object
implements ApplicationStatus

ApplicationStatusService handles application status queries on behalf of the running application instance. Provides status information to clients on the local network.


Constructor Summary
ApplicationStatusService()
           
 
Method Summary
 boolean collectGarbage()
          Request that the virtual machine run the garbage collector.
 int forceQuit(int code)
          Force the application to quit immediately without running any finalizers.
 java.lang.String getApplicationName()
          Get the application name.
 double getFreeMemory()
          Get the free memory available the application instance.
 java.lang.String getHostName()
          Get the name of the host where the application is running.
 double getLaunchTime()
          Get the launch time of the application in seconds since the epoch (midnight GMT, January 1, 1970)
 double getTotalMemory()
          Get the total memory consumed by the application instance.
 int quit(int code)
          Quit the application normally.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationStatusService

public ApplicationStatusService()
Method Detail

getFreeMemory

public double getFreeMemory()
Get the free memory available the application instance.

Specified by:
getFreeMemory in interface ApplicationStatus
Returns:
The free memory available on this virtual machine in kB.

getTotalMemory

public double getTotalMemory()
Get the total memory consumed by the application instance.

Specified by:
getTotalMemory in interface ApplicationStatus
Returns:
The total memory consumed by the application instance in kB.

collectGarbage

public boolean collectGarbage()
Request that the virtual machine run the garbage collector.

Specified by:
collectGarbage in interface ApplicationStatus
Returns:
true.

quit

public int quit(int code)
Quit the application normally.

Specified by:
quit in interface ApplicationStatus
Parameters:
code - An unused status code.
Returns:
The status code.

forceQuit

public int forceQuit(int code)
Force the application to quit immediately without running any finalizers.

Specified by:
forceQuit in interface ApplicationStatus
Parameters:
code - The status code used for halting the virtual machine.
Returns:
The supplied status code.

getHostName

public java.lang.String getHostName()
Get the name of the host where the application is running.

Specified by:
getHostName in interface ApplicationStatus
Returns:
The name of the host where the application is running.

getApplicationName

public java.lang.String getApplicationName()
Get the application name.

Specified by:
getApplicationName in interface ApplicationStatus
Returns:
The application name.

getLaunchTime

public double getLaunchTime()
Get the launch time of the application in seconds since the epoch (midnight GMT, January 1, 1970)

Specified by:
getLaunchTime in interface ApplicationStatus
Returns:
the time at with the application was launched in seconds since the epoch