All Packages  This Package  Class Hierarchy  Class Search  Index

Class utah.npm.core.PortSet
java.lang.Object
   |
   +----utah.npm.core.Lockable
           |
           +----utah.npm.core.NPMObject
                   |
                   +----utah.npm.core.Refable
                           |
                           +----utah.npm.core.PortSet

  Summary

public final class  PortSet
     extends utah.npm.core.Refable
{
          // Fields 2
     private Thread clientQHead;
     private Thread serverQHead;

          // Constructors 2
     public PortSet();
     public PortSet(int);

          // Methods 9
     static String typeName();

     public void destroy();
     Thread s_captureClientThread();
     Thread s_captureServerThread();
     void s_init(int);
     int s_type();
     int s_waitForClientThread(Thread);
     int s_waitForServerThread(Thread);
     public String toString();
}

PortSet is the IPC connection point for a server. Under the covers it is also the rendezvous point for both client and servers (either will block here until a pair are available.)

Version:
NPMJava 0.5.0 April, 1998
Author:
Patrick Tullmann tullmann@cs.utah.edu




  Fields

· serverQHead

Summary  |  Top

   private Thread serverQHead

The first thread in the queue of available server threads.


· clientQHead

Summary  |  Top
   private Thread clientQHead

The first thread in the queue of client threads waiting for service.


  Constructors

· PortSet

Summary  |  Top

   public PortSet() 

Construct a new Port Set.



· PortSet

Summary  |  Top
   public PortSet(int hashCode) 

Construct a new Port Set with a specific hasCode.

Parameter Description
hashCode the hashCode to set for this new NPMObject.



  Methods

· s_init

Summary  |  Top
   void s_init(int hashCode) 

Port Set specific intialization. Nothing interesting for a PortSet.

Parameter Description
hashCode the hashCode to use for this object.

Overrides:
s_init in class Refable


· s_captureServerThread

Summary  |  Top
   Thread s_captureServerThread() 

Return a captured server thread from the queue of servers blocked on this pset. Returns null if no server is available. Pset should be locked by caller before invoking this method.

Pset should be locked before entry

Returns:
a captured server thread, if available, null otherwise.

See Also: ThreadIPC.s_psetDequeue



· s_waitForServerThread

Summary  |  Top
   int s_waitForServerThread(Thread client) 

Wait for a server thread to come along and rescue this thread (a client). Returns true if/when this thread is rescued, false for bogon situations like the pset got destroyed (or something like that).

Pset should be locked before entry and will be unlocked before returning.

Parameter Description
client the current thread which is trying to rendezvous with a server on this PortSet.

Returns:
an IPC return code.

See Also: ThreadIPC.s_psetEnqueue



· s_captureClientThread

Summary  |  Top
   Thread s_captureClientThread() 

Return a captured client thread from the queue of clients blocked on this PortSet. Returns null if no client is avaialbe. PortSet should be locked by caller before invoking this method.

Returns:
a captured client thread, if available, null otherwise.


· s_waitForClientThread

Summary  |  Top
   int s_waitForClientThread(Thread server) 

Wait for a client thread to come along and rescue us. Returns an return code describing the reason for being woken up (RC_OK if all is ok, etc.)

Pset should be locked before entry and will be unlocked before returning.

Parameter Description
server the current thread which is acting as a server for this PortSet

Returns:
an IPC return code.

See Also: ThreadIPC.s_psetEnqueue



· destroy

Summary  |  Top
   public void destroy() 

Destroy this PortSet. All queued client and server threads will be woken up and will return ThreadIPC.RC_INVALIDDEST.

Overrides:
destroy in class Refable


· toString

Summary  |  Top
   public String toString() 

Return a string representation of this PortSet ("PortSet").

Returns:
a string representation of this PortSet.
Overrides:
toString in class NPMObject


· typeName

Summary  |  Top
   static String typeName() 

Return the string "PortSet".

Returns:
the string "PortSet"
Overrides:
typeName in class NPMObject


· s_type

Summary  |  Top
   int s_type() 

Return the integer NPMObject.PortSetType.

Returns:
the integer NPMObject.PortSetType
Overrides:
s_type in class NPMObject


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7