All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.nodeos.pj_Flow
java.lang.Object
   |
   +----edu.utah.janos.nodeos.pj_Flow

  Summary

class  pj_Flow
     extends java.lang.Object
{
          // Fields 10
     private final Vector channels;
     private final pj_Credentials cred;
     private boolean destroyed;
     final Object lock;
     private final pj_MemSpec memSpec;
     private String name;
     private Object obj;
     private final pj_Flow parentFlow;
     private final Runnable terminationHandler;
     private final pj_ThreadPool threadPool;

          // Constructors 1
     pj_Flow(pj_Flow, pj_Credentials, pj_ThreadPoolSpec, pj_MemSpec, Runnable);

          // Methods 12
     static pj_Flow native_currentFlow();

     void addChannel(pj_CutThroughChannel);
     void addChannel(pj_InChannel);
     void addChannel(pj_OutChannel);
     synchronized void destroy();
     String getName();
     Object getObject();
     pj_ThreadPool getThreadPool();
     void setName(String);
     void setObject(Object);
     void threadStart(Runnable, String);
     public String toString();
}

Java implementation of a NodeOS Flow. A flow is the closest approximation to a process in Janos.

Author:
Janos Ministry of Development


  Cross Reference

Extended By:
Flow

Returned By:
Flow.getNativeFlow(), pj_Flow.native_currentFlow(), pj_ThreadPool.native_getFlow(), pj_Thread.getFlow()





  Fields

· cred

Summary  |  Top
   private final pj_Credentials cred

The credentials provided when this pj_Flow was created. This is the bucket from which the pj_Flow gets to extract resources and access Node facilities.


· threadPool

Summary  |  Top
   private final pj_ThreadPool threadPool

The threadPool for this flow.


· memSpec

Summary  |  Top
   private final pj_MemSpec memSpec

The Memory limit for this flow.


· channels

Summary  |  Top
   private final Vector channels

Channels created in this pj_Flow. This list only exists so that the channels can be cleanly destroyed when the flow is terminated.


· parentFlow

Summary  |  Top
   private final pj_Flow parentFlow

The parent flow of this flow. Used for handling termination requests.

XXX this is a cross-process pointer and must be treated specially.


· obj

Summary  |  Top
   private Object obj

A per-flow Object that user code can set and get. (for associating things with the flow).


· terminationHandler

Summary  |  Top
   private final Runnable terminationHandler

A per-flow pointer to the termination handler for this flow. Invoked when the flow is terminated.


· lock

Summary  |  Top
   final Object lock

XXX: need to examine the global locking structure for deadlock, etc

XXX: Probably should move to locks on each element of the state and not a global state lock.


· destroyed

Summary  |  Top
   private boolean destroyed


· name

Summary  |  Top
   private String name


  Constructors

· pj_Flow

Summary  |  Top

   pj_Flow(pj_Flow parentFlow, 
           pj_Credentials cred, 
           pj_ThreadPoolSpec threadPoolSpec, 
           pj_MemSpec memSpec, 
           Runnable termHandler) 

Initalize a new Flow. See newFlow().

XXX implicitly starts threads running (blocked) on the thread pool. Gak.



  Methods

· threadStart

Summary  |  Top
   void threadStart(Runnable r, 
                    String name) 

Create an explicit thread. This is a new thread which is not subject to whatever concurrency limit this Flow's ThreadPool has. But, it will be scheduled by the ThreadPool's scheduler.

Parameter Description
r the Runnable to start the target thread on.
name the String name of the new thread.



· destroy

Summary  |  Top
   synchronized void destroy() 


· addChannel

Summary  |  Top
   void addChannel(pj_InChannel c) 


· addChannel

Summary  |  Top
   void addChannel(pj_OutChannel c) 


· addChannel

Summary  |  Top
   void addChannel(pj_CutThroughChannel c) 


· getObject

Summary  |  Top
   Object getObject() 


· setObject

Summary  |  Top
   void setObject(Object obj) 


· getThreadPool

Summary  |  Top
   pj_ThreadPool getThreadPool() 


· toString

Summary  |  Top
   public String toString() 
Overrides:
toString in class Object


· native_currentFlow

Summary  |  Top
   static pj_Flow native_currentFlow() 

Get the current flow. The current Flow is the flow associated with the current Thread.

See Also: getFlow



· setName

Summary  |  Top
   void setName(String name) 


· getName

Summary  |  Top
   String getName() 


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