Package org.eclipse.net4j.util.om.trace

## Class RemoteTraceServer

- java.lang.Object
- - org.eclipse.net4j.util.om.trace.RemoteTraceServer

-     public class RemoteTraceServer
      extends java.lang.Object

  A server that `agents` can connect to and that passes the received `trace events` to `registered` `listeners`.
  Author:
    Eike Stepper

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `RemoteTraceServer.Event` | A trace event being passed by a remote trace `server` to `registered` `listeners`.
    `static interface` | `RemoteTraceServer.Listener` | Listens to `trace events` being passed by a remote trace `server`.
    `static class` | `RemoteTraceServer.PrintListener` | A `listener` that appends `trace events` to a `print stream`.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static int` | `ANY_PORT` |
    `static java.lang.String` | `DEFAULT_ADDRESS` |
    `static int` | `DEFAULT_PORT` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `RemoteTraceServer()` |
    `RemoteTraceServer​(int port)` |
    `RemoteTraceServer​(int port, java.lang.String address)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addListener​(RemoteTraceServer.Listener listener)` |
    `protected java.net.ServerSocket` | `bind()` |
    `java.lang.Exception` | `close()` |
    `protected void` | `fireEvent​(RemoteTraceServer.Event event)` |
    `protected void` | `handleConnections()` |
    `protected void` | `handleSession​(java.net.Socket socket)` |
    `protected void` | `handleTrace​(java.io.DataInputStream in)` |
    `void` | `removeListener​(RemoteTraceServer.Listener listener)` |
    `void` | `start()` |

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

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

- - ### Field Detail

    - #### DEFAULT_ADDRESS

          public static final java.lang.String DEFAULT_ADDRESS

      See Also:
        Constant Field Values

    - #### DEFAULT_PORT

          public static final int DEFAULT_PORT

      See Also:
        Constant Field Values

    - #### ANY_PORT

          public static final int ANY_PORT

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RemoteTraceServer

          public RemoteTraceServer()
                            throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### RemoteTraceServer

          public RemoteTraceServer​(int port)
                            throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### RemoteTraceServer

          public RemoteTraceServer​(int port,
                                   java.lang.String address)
                            throws java.io.IOException

      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### start

          public void start()

      Since:
        3.0

    - #### addListener

          public void addListener​(RemoteTraceServer.Listener listener)

    - #### removeListener

          public void removeListener​(RemoteTraceServer.Listener listener)

    - #### close

          public java.lang.Exception close()

    - #### bind

          protected java.net.ServerSocket bind()
                                        throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### handleConnections

          protected void handleConnections()

    - #### handleSession

          protected void handleSession​(java.net.Socket socket)

    - #### handleTrace

          protected void handleTrace​(java.io.DataInputStream in)
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### fireEvent

          protected void fireEvent​(RemoteTraceServer.Event event)