moss.ipc
Class MNamedMsgQ

java.lang.Object
  extended by moss.ipc.MNamedMsgQ

public class MNamedMsgQ
extends java.lang.Object

this class provides named message-queues. it allows kernel and user processes to exchange messages, broadcast messages, etc.


Nested Class Summary
static class MNamedMsgQ.MNamedMsg
          this class is used to return data in a nmq_read() call
 
Constructor Summary
MNamedMsgQ()
           
 
Method Summary
static void finalinit()
          performs final initialisation (in context of the init-task)
static void init_namedmsgq()
          called to initialise
static int nmq_close(MFile handle, java.lang.String name)
          closes a named message queue -- this is called locally by PrivMsgQ.close()
static int nmq_open(MFile handle, java.lang.String name)
          opens a named message queue -- creates the queue if it doesn't exist
static int nmq_recv(MFile handle, MNamedMsgQ.MNamedMsg msg)
          waits for a message from the named message queue
static int nmq_send(MFile handle, int type, java.lang.Object msg)
          sends a message to the named message queue
static void shutdown_namedmsgq()
          called to shut-down
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MNamedMsgQ

public MNamedMsgQ()
Method Detail

init_namedmsgq

public static void init_namedmsgq()
called to initialise


finalinit

public static void finalinit()
performs final initialisation (in context of the init-task)


shutdown_namedmsgq

public static void shutdown_namedmsgq()
called to shut-down


nmq_open

public static int nmq_open(MFile handle,
                           java.lang.String name)
opens a named message queue -- creates the queue if it doesn't exist

Parameters:
handle - file-handle to be associated with this queue
name - name of the message queue to create
Returns:
0 on success, or < 0 indicating error

nmq_close

public static int nmq_close(MFile handle,
                            java.lang.String name)
closes a named message queue -- this is called locally by PrivMsgQ.close()

Parameters:
handle - file-handle associated with this queue (one of them)
name - name of this message queue
Returns:
0 on success, or < 0 indicating error

nmq_send

public static int nmq_send(MFile handle,
                           int type,
                           java.lang.Object msg)
sends a message to the named message queue

Parameters:
handle - handle on the message-queue
type - application defined type field
msg - object message
Returns:
0 on success, or < 0 indicating error

nmq_recv

public static int nmq_recv(MFile handle,
                           MNamedMsgQ.MNamedMsg msg)
waits for a message from the named message queue

Parameters:
handle - handle on the message-queue
msg - where the message is stored
Returns:
0 on success, or < 0 indicating error