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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `RESPONSE_SCHEDULER_HAS_TASKS`
  `protected boolean`
  `run`
  `protected ServerSocket`
  `s`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AdminPortListener(int port)`
  Constructor, binds a server socket on loopback interface only.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `getVersionInfo()`
  `static final String`
  `memoryStatus()`
  `void`
  `run()`
  Main listening loop.
  `void`
  `start()`
  `static String`
  `statusApp()`
  `static final String`
  `uptimeStatus()`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### RESPONSE_SCHEDULER_HAS_TASKS

    public static final String RESPONSE_SCHEDULER_HAS_TASKS
    See Also:
      - Constant Field Values

  - ### s

    protected ServerSocket s

  - ### run

    protected boolean run

- ## 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()