uka.karmi.stream
Class StreamTechnology.LocalID

java.lang.Object
  extended byuka.karmi.stream.StreamTechnology.LocalID
All Implemented Interfaces:
StreamTechnology.CallBack
Enclosing class:
StreamTechnology

protected class StreamTechnology.LocalID
extends java.lang.Object
implements StreamTechnology.CallBack

A LocalID references a remote technology. Each remote technology is assigned an local identifier that is used to fast access connections to that technology in a remote method invocation. The assigned identifier is stored in the UTID object identifying the remote technology. The LocalID object is responsible for managing open connections to the remote technology. If no more open connections are active to a remote technology, the corresponding LocalID object is collected and the allocated local identifier is reused.


Field Summary
private  int connectionCnt
          Count of connections alive to the remote technology.
(package private)  ClientConnection head
          Head of the linked list of unused open connections to the remote technology this LocalID represents.
(package private)  int index
          Local identifier for the remote technology.
(package private)  UTID utid
          Reference to the remote technology.
 
Constructor Summary
StreamTechnology.LocalID(int index, UTID utid)
           
 
Method Summary
 void collectConnections(long now)
           
 void failed(StreamClientConnection c)
          Indicates that the remote call has terminated, but the connection can not be reused, because an internal error occurred at the server-side.
 void finished(StreamClientConnection c)
          Indicates that the remote call terminated and the connection can be reused.
 StreamClientConnection getConnection()
          Look up an unused connection to the remote technology.
 boolean isInUse()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

int index
Local identifier for the remote technology.


connectionCnt

private int connectionCnt
Count of connections alive to the remote technology.


head

ClientConnection head
Head of the linked list of unused open connections to the remote technology this LocalID represents.


utid

final UTID utid
Reference to the remote technology.

Constructor Detail

StreamTechnology.LocalID

public StreamTechnology.LocalID(int index,
                                UTID utid)
Method Detail

isInUse

public boolean isInUse()

getConnection

public StreamClientConnection getConnection()
                                     throws java.io.IOException
Look up an unused connection to the remote technology. If no conection exists, a new one is created.

Throws:
java.io.IOException

finished

public void finished(StreamClientConnection c)
Description copied from interface: StreamTechnology.CallBack
Indicates that the remote call terminated and the connection can be reused.

Specified by:
finished in interface StreamTechnology.CallBack

failed

public void failed(StreamClientConnection c)
            throws java.io.IOException
Description copied from interface: StreamTechnology.CallBack
Indicates that the remote call has terminated, but the connection can not be reused, because an internal error occurred at the server-side.

Specified by:
failed in interface StreamTechnology.CallBack
Throws:
java.io.IOException

collectConnections

public void collectConnections(long now)