Class ApplicationStatusService

java.lang.Object
xal.extension.application.ApplicationStatusService
All Implemented Interfaces:
ApplicationStatus

public class ApplicationStatusService extends Object implements 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 Details

    • ApplicationStatusService

      public ApplicationStatusService()
  • Method Details

    • getFreeMemory

      public double getFreeMemory()
      Get the free memory available to 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.
    • showAllWindows

      public void showAllWindows()
      reveal the application by bringing all windows to the front
      Specified by:
      showAllWindows in interface ApplicationStatus
    • collectGarbage

      public void collectGarbage()
      Request that the virtual machine run the garbage collector.
      Specified by:
      collectGarbage in interface ApplicationStatus
    • quit

      public void quit(int code)
      Quit the application normally.
      Specified by:
      quit in interface ApplicationStatus
      Parameters:
      code - An unused status code.
    • forceQuit

      public void 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.
    • getHostName

      public 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 String getApplicationName()
      Get the application name.
      Specified by:
      getApplicationName in interface ApplicationStatus
      Returns:
      The application name.
    • getLaunchTime

      public Date 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
    • getHeartbeat

      public Date getHeartbeat()
      Get a heartbeat from the service.
      Specified by:
      getHeartbeat in interface ApplicationStatus
      Returns:
      the time measured from the service at which the heartbeat was sent