org.licas.server

## Class BlockingListener

- java.lang.Object
- - java.lang.Thread
  - - org.licas.module.LicasModule
    - - org.licas.module.FrameworkModule
      - - org.licas.module.ServiceModule
        - - org.licas.server.HttpListener
          - - org.licas.server.BlockingListener

- All Implemented Interfaces:
    java.lang.Runnable, ServiceDef

      public class BlockingListener
      extends HttpListener

  This class implements a listener thread for processing blocked (synchronous) HTTP requests.
  Author:
    Kieran Greer

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.lang.Thread

      `java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.nio.channels.ServerSocketChannel` | `listener` Synchronous server channel

    - ### Fields inherited from class org.licas.server.HttpListener

      `ipAddress, listenerPool, port, timeOut`

    - ### Fields inherited from class org.licas.module.ServiceModule

      `shutDown`

    - ### Fields inherited from class org.licas.module.FrameworkModule

      `passwordHandler, service, serviceType`

    - ### Fields inherited from class org.licas.module.LicasModule

      `jarFile, syncOn, uuid`

    - ### Fields inherited from class java.lang.Thread

      `MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BlockingListener(int thePort, java.lang.String theIpAddress, long theTimeOut, java.lang.String theServerPassword, java.lang.String theAdminKey)` Create a new instance of BlockingListener.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `closeListener()` Close the listener down
    `void` | `initRequestListener()` Initialise the request listener thread.
    `void` | `run()` Run the thread.

    - ### Methods inherited from class org.licas.server.HttpListener

      `shutDownListenerThread`

    - ### Methods inherited from class org.licas.module.ServiceModule

      `getShutDown, interrupt, setShutDown, setShutDown`

    - ### Methods inherited from class org.licas.module.FrameworkModule

      `canAccess, canAccessTemp, getPasswordHandler, getPasswordHandler, getServerPassword, getServicePassword, getServiceType, isAdminKey, setServiceDetails, setServiceType`

    - ### Methods inherited from class org.licas.module.LicasModule

      `getJarFile, getUUID, loadObject, setJarFile, setUUID, threadAliveState`

    - ### Methods inherited from class java.lang.Thread

      `activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield`

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

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

    - ### Methods inherited from interface org.licas.def.ServiceDef

      `getUUID, setJarFile, setUUID`

- - ### Field Detail

    - #### listener

          protected java.nio.channels.ServerSocketChannel listener

      Synchronous server channel

  - ### Constructor Detail

    - #### BlockingListener

          public BlockingListener(int thePort,
                                  java.lang.String theIpAddress,
                                  long theTimeOut,
                                  java.lang.String theServerPassword,
                                  java.lang.String theAdminKey)
                           throws java.lang.Exception

      Create a new instance of BlockingListener.
      Parameters:
        `thePort` - the port to listen on.
        `theIpAddress` - the ip address to bind to.
        `theTimeOut` - timeout for receiving continuous message.
        `theServerPassword` - the server password.
        `theAdminKey` - the server service key.
      Throws:
        `java.lang.Exception` - any other error.

  - ### Method Detail

    - #### initRequestListener

          public void initRequestListener()
                                   throws java.lang.Exception

      Initialise the request listener thread.
      Specified by:
        `initRequestListener` in class `HttpListener`
      Throws:
        `java.lang.Exception` - any other error.
        `java.io.IOException` - for input/output error.

    - #### run

          public void run()

      Run the thread.
      Specified by:
        `run` in interface `java.lang.Runnable`
      Overrides:
        `run` in class `java.lang.Thread`

    - #### closeListener

          protected void closeListener()

      Close the listener down
      Specified by:
        `closeListener` in class `HttpListener`