jist.runtime
Class Channel

java.lang.Object
  extended by jist.runtime.Entity.Empty
      extended by jist.runtime.Channel
All Implemented Interfaces:
Entity, JistAPI.Entity, JistAPI.Timeless, Timeless

public class Channel
extends Entity.Empty
implements JistAPI.Entity

Implements a single-slot channel ala Communicating Sequential Processes (CSP) by Hoare. Other synchronization primitives can be built atop this structure, or directly using the same idea. This Channel implementation may not block the sender, and may drop excessive sends by setting flags accordingly.

Since:
JIST1.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface jist.runtime.Entity
Entity.Empty, Entity.Static
 
Field Summary
static java.lang.reflect.Method _jistMethodStub_receive_28_29Ljava_2elang_2eObject_3b
          Jist method stub for receive method.
static java.lang.reflect.Method _jistMethodStub_send_28Ljava_2elang_2eObject_3b_29V
          Jist method stub for send(Object) method.
static java.lang.reflect.Method _jistMethodStub_send_28Ljava_2elang_2eObject_3bZZ_29V
          Jist method stub for send(Object) method.
static java.lang.reflect.Method _jistMethodStub_sendNonBlock_28Ljava_2elang_2eObject_3b_29V
          Jist method stub for sendNonBlock(Object).
static java.lang.reflect.Method _jistMethodStub_sendNonBlock_28Ljava_2elang_2eObject_3bZZ_29V
          Jist method stub for sendNonBlock(Object, boolean).
 
Fields inherited from class jist.runtime.Entity.Empty
_jistField__ref
 
Method Summary
 java.lang.Object receive()
          Blocking receive call.
 void send(java.lang.Object data)
          Blocking non-dropping send call.
 void send(java.lang.Object data, boolean shouldDropIfFull, boolean shouldDropIfNoReceiveWaiting)
          Blocking send call.
 void sendNonBlock(java.lang.Object data)
          Non-blocking non-dropping send call.
 void sendNonBlock(java.lang.Object data, boolean shouldDropIfFull, boolean shouldDropIfNoReceiveWaiting)
          Non-blocking send call.
 
Methods inherited from class jist.runtime.Entity.Empty
_jistMethod_Get__ref, _jistMethod_Set__ref
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_jistMethodStub_receive_28_29Ljava_2elang_2eObject_3b

public static java.lang.reflect.Method _jistMethodStub_receive_28_29Ljava_2elang_2eObject_3b
Jist method stub for receive method.


_jistMethodStub_send_28Ljava_2elang_2eObject_3b_29V

public static java.lang.reflect.Method _jistMethodStub_send_28Ljava_2elang_2eObject_3b_29V
Jist method stub for send(Object) method.


_jistMethodStub_send_28Ljava_2elang_2eObject_3bZZ_29V

public static java.lang.reflect.Method _jistMethodStub_send_28Ljava_2elang_2eObject_3bZZ_29V
Jist method stub for send(Object) method.


_jistMethodStub_sendNonBlock_28Ljava_2elang_2eObject_3b_29V

public static java.lang.reflect.Method _jistMethodStub_sendNonBlock_28Ljava_2elang_2eObject_3b_29V
Jist method stub for sendNonBlock(Object).


_jistMethodStub_sendNonBlock_28Ljava_2elang_2eObject_3bZZ_29V

public static java.lang.reflect.Method _jistMethodStub_sendNonBlock_28Ljava_2elang_2eObject_3bZZ_29V
Jist method stub for sendNonBlock(Object, boolean).

Method Detail

send

public void send(java.lang.Object data,
                 boolean shouldDropIfFull,
                 boolean shouldDropIfNoReceiveWaiting)
          throws JistAPI.Continuation
Blocking send call.

Parameters:
data - object to transmit
shouldDropIfFull - whether over-sent channel should throw exception or silently drop
shouldDropIfNoReceiveWaiting - whether send should be dropped if no receive is waiting
Throws:
JistAPI.Continuation - never (merely a rewriter tag)

send

public void send(java.lang.Object data)
          throws JistAPI.Continuation
Blocking non-dropping send call.

Parameters:
data - object to transmit
Throws:
JistAPI.Continuation - never (merely a rewriter tag)

sendNonBlock

public void sendNonBlock(java.lang.Object data,
                         boolean shouldDropIfFull,
                         boolean shouldDropIfNoReceiveWaiting)
Non-blocking send call.

Parameters:
data - object to transmit
shouldDropIfFull - whether over-sent channel should throw exception or silently drop
shouldDropIfNoReceiveWaiting - whether send should be dropped if no receive is waiting

sendNonBlock

public void sendNonBlock(java.lang.Object data)
Non-blocking non-dropping send call.

Parameters:
data - object to transmit

receive

public java.lang.Object receive()
                         throws JistAPI.Continuation
Blocking receive call.

Returns:
transmitted data
Throws:
JistAPI.Continuation - never (merely a rewriter tag)