org.acplt.oncrpc.server
Class OncRpcTcpServerTransport.TransportList

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

private class OncRpcTcpServerTransport.TransportList
extends java.lang.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
private  class OncRpcTcpServerTransport.TransportList.Node
          Node class referencing an individual open transport and holding references to the previous and next open transports.
 
Field Summary
private  OncRpcTcpServerTransport.TransportList.Node head
          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 size
          Number of (real) open transports currently registered in this list.
 
Constructor Summary
OncRpcTcpServerTransport.TransportList()
          Create a new instance of a list of open transports.
 
Method Summary
 void add(java.lang.Object o)
          Add new transport to list of open transports.
 boolean remove(java.lang.Object o)
          Remove given transport from list of open transports.
 java.lang.Object removeFirst()
          Removes and returns the first open transport from list.
 int size()
          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 Detail

head

private OncRpcTcpServerTransport.TransportList.Node head
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.


size

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

Constructor Detail

OncRpcTcpServerTransport.TransportList

public OncRpcTcpServerTransport.TransportList()
Create a new instance of a list of open transports.

Method Detail

add

public void add(java.lang.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(java.lang.Object o)
Remove given transport from list of open transports.


removeFirst

public java.lang.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.