Package xal.extension.application
Class ApplicationStatusService
java.lang.Object
xal.extension.application.ApplicationStatusService
- All Implemented Interfaces:
ApplicationStatus
ApplicationStatusService handles application status queries on behalf of the
running application instance. Provides status information to clients on the
local network.
- Author:
- tap
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRequest that the virtual machine run the garbage collector.voidforceQuit(int code) Force the application to quit immediately without running any finalizers.Get the application name.doubleGet the free memory available to the application instance.Get a heartbeat from the service.Get the name of the host where the application is running.Get the launch time of the application in seconds since the epoch (midnight GMT, January 1, 1970)doubleGet the total memory consumed by the application instance.voidquit(int code) Quit the application normally.voidreveal the application by bringing all windows to the front
-
Constructor Details
-
ApplicationStatusService
public ApplicationStatusService()
-
-
Method Details
-
getFreeMemory
public double getFreeMemory()Get the free memory available to the application instance.- Specified by:
getFreeMemoryin interfaceApplicationStatus- 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:
getTotalMemoryin interfaceApplicationStatus- Returns:
- The total memory consumed by the application instance in kB.
-
showAllWindows
public void showAllWindows()reveal the application by bringing all windows to the front- Specified by:
showAllWindowsin interfaceApplicationStatus
-
collectGarbage
public void collectGarbage()Request that the virtual machine run the garbage collector.- Specified by:
collectGarbagein interfaceApplicationStatus
-
quit
public void quit(int code) Quit the application normally.- Specified by:
quitin interfaceApplicationStatus- Parameters:
code- An unused status code.
-
forceQuit
public void forceQuit(int code) Force the application to quit immediately without running any finalizers.- Specified by:
forceQuitin interfaceApplicationStatus- Parameters:
code- The status code used for halting the virtual machine.
-
getHostName
Get the name of the host where the application is running.- Specified by:
getHostNamein interfaceApplicationStatus- Returns:
- The name of the host where the application is running.
-
getApplicationName
Get the application name.- Specified by:
getApplicationNamein interfaceApplicationStatus- Returns:
- The application name.
-
getLaunchTime
Get the launch time of the application in seconds since the epoch (midnight GMT, January 1, 1970)- Specified by:
getLaunchTimein interfaceApplicationStatus- Returns:
- the time at with the application was launched in seconds since the epoch
-
getHeartbeat
Get a heartbeat from the service.- Specified by:
getHeartbeatin interfaceApplicationStatus- Returns:
- the time measured from the service at which the heartbeat was sent
-