Package ru.bgcrm.util

Class AdminPortListener

java.lang.Object
ru.bgcrm.util.AdminPortListener
All Implemented Interfaces:
Runnable

public class AdminPortListener extends Object implements Runnable
Socket listener for managing running app. Accepts one line text commands. Is singleton.
  • Field Details

  • Constructor Details

    • AdminPortListener

      public AdminPortListener(int port)
      Constructor, binds a server socket on loopback interface only.
      Parameters:
      port - port.
  • Method Details

    • run

      public void run()
      Main listening loop.
      Specified by:
      run in interface Runnable
    • getVersionInfo

      public static String getVersionInfo()
      Returns:
      app version string.
    • statusApp

      public static String statusApp()
      Returns:
      running application status: version, uptime, memory.
    • uptimeStatus

      public static final String uptimeStatus()
      Returns:
      string with formatted START_TIME and calculated uptime after it.
    • memoryStatus

      public static final String memoryStatus()
      Returns:
      string with applications memory state.
    • start

      public void start()