Class OncRpcTcpServerTransport.TransportList

java.lang.Object
org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList
Enclosing class:
OncRpcTcpServerTransport

private class OncRpcTcpServerTransport.TransportList extends Object
Minumum implementation of a double linked list which notices which transports are currently open and have to be shut down when this listening transport is shut down. The only reason why we have this code here instead of using java.util.LinkedList is due to JDK 1.1 compatibility.

Note that the methods are not synchronized as we leave this up to the caller, who can thus optimize access during critical sections.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private class 
    Node class referencing an individual open transport and holding references to the previous and next open transports.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Head node for list of open transports which does not represent an open transport but instead excuses us of dealing with all the special cases of real nodes at the begin or end of the list.
    private int
    Number of (real) open transports currently registered in this list.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a new instance of a list of open transports.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add new transport to list of open transports.
    boolean
    Remove given transport from list of open transports.
    Removes and returns the first open transport from list.
    int
    Returns the number of (open) transports in this list.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • size

      private int size
      Number of (real) open transports currently registered in this list.
  • Constructor Details

    • TransportList

      public TransportList()
      Create a new instance of a list of open transports.
  • Method Details

    • add

      public void add(Object o)
      Add new transport to list of open transports. The new transport is always added immediately after the head of the linked list.
    • remove

      public boolean remove(Object o)
      Remove given transport from list of open transports.
    • removeFirst

      public Object removeFirst()
      Removes and returns the first open transport from list.
    • size

      public int size()
      Returns the number of (open) transports in this list.
      Returns:
      the number of (open) transports.