Package org.acplt.oncrpc.server
Class OncRpcTcpServerTransport.TransportList
java.lang.Object
org.acplt.oncrpc.server.OncRpcTcpServerTransport.TransportList
- Enclosing class:
- OncRpcTcpServerTransport
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 ClassesModifier and TypeClassDescriptionprivate class
Node class referencing an individual open transport and holding references to the previous and next open transports. -
Field Summary
FieldsModifier and TypeFieldDescriptionHead 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 -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
size()
Returns the number of (open) transports in this list.
-
Field Details
-
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 sizeNumber 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
Add new transport to list of open transports. The new transport is always added immediately after the head of the linked list. -
remove
Remove given transport from list of open transports. -
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.
-