All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javaNOW.JavaNOWAPI

java.lang.Object
   |
   +----javaNOW.JavaNOWAPI

public class JavaNOWAPI
extends Object
JavaNOWAPI: The public interface for JavaNOW operations


Variable Index

 o MAX_WAIT
Constants

Constructor Index

 o JavaNOWAPI(JavaNOWVirtualMachine)
Constructors

Method Index

 o addWaitingMailboxKeys(MailboxKey)
keeps count of sync for messagespaces
 o barrier(MailboxKey, int)
barrier: waits numMessages number of processes have executed this operation.
 o broadcast(int, Message, MailboxKey[])
It retrieves copy of message from one messagespace and inserts it in all other messagespaces.
 o broadcast(int, Message, Vector)
It retrieves copy of message from one messagespace and inserts it in all other messagespaces.
 o clear(MailboxKey)
Removes all message from a mailbox
 o combine(ActiveMessage, MailboxKey[], Message[])
 o combine(ActiveMessage, Vector, Message[])
It is like reduce except it stores result in all messages e.g.
 o concat(Message[], MailboxKey[])
 o concat(Message[], Vector)
It is complete broadcast and inserts messages from each message space into each other message spaces, e.g.
 o eval(MailboxKey, ActiveMessage, Object)
It is used to evaluate a message method (execute()) and inserts the output of that method in message space.
 o evalDelayed(MailboxKey, MailboxKey, Message, ActiveMessage)
Performs data flow operation by evaluating active message in messageSapceKey1 when message arrives at mailboxKey2 and pass the data value as argument to eval.
 o finalize()
Destructors
 o gather(int, Message[], MailboxKey[])
 o gather(int, Message[], Vector)
It gathers messages from different message spaces (keys stored in enumeration) and stores them in output message space e.g.
 o get(MailboxKey, Message)
Removes message from message space in blocking fashion.
 o getDestHost(Message)
 o getHostId()
 o getHostName()
 o getJavaNOWHandle()
 o getMessageCount(MailboxKey)
It returns number of messages in the messagespace
 o getMessageCount(MailboxKey, Message)
It returns number of messages in the messagespace that matches the message value as that of aMessage
 o getp(MailboxKey, Message)
Removes message from message space in nonblocking fashion.
 o getpType(MailboxKey, Message)
It returns vector of messages that match the message value of the aMessage
 o getpType(MailboxKey, Message, int)
It returns nth message in the message space that matches the message value as that of aMessage
 o getTime()
It returns current time in milliseconds
 o index(Message[][], MailboxKey[])
It distributes distinct messages from each message space to all other message spaces e.g.
 o notifyGet(JavaNOWMessageNotifier, MailboxKey, Message)
notify user when message arrives
 o notifyIfWaiting(MailboxKey)
Wake any processes who are waiting in sync
 o notifyRead(JavaNOWMessageNotifier, MailboxKey, Message)
notify user when message arrives
 o prefix(ActiveMessage, MailboxKey[], Message[])
 o prefix(ActiveMessage, Vector, Message[])
It is like reduce except it stores partial result in all messages e.g.
 o present(MailboxKey, Message)
Returns true if message exist in message spaces (nonblocking)
 o put(MailboxKey, Message)
Inserts a message into message space
 o putDelayed(MailboxKey, MailboxKey, Message)
BUILDING HIGHER ABSTRACTION BASED ON CORE JavaNOW FUNCTIONS /** /** Performs data flow operation by putting message in messageSapceKey1 when message arrives at mailboxKey2
 o read(MailboxKey, Message)
Returns a copy of message from message space in nonblocking fashion.
 o readp(MailboxKey, Message)
Returns a copy of message from message space in nonblocking fashion.
 o readpType(MailboxKey, Message)
It is same as getpType() couterpart except it returns copy of messages
 o readpType(MailboxKey, Message, int)
It is same as getpType() counterpart except it returns copy of messages
 o reduce(int, ActiveMessage, MailboxKey[], Message[])
 o reduce(int, ActiveMessage, Vector, Message[])
It retrieves message from different message spaces and performs operation on it as specified in the message method and inserts in output message space.
 o removeWaitingMailboxKeys(MailboxKey)
remove messagespace from list of waiting messagespaces
 o scatter(int, Message[], MailboxKey[])
 o scatter(int, Message[], Vector)
Inserts each message in message array into different message space as specified in message space key.
 o shift(Message[], MailboxKey[])
 o shift(Message[], Vector)
It retrieves message from one message space and inserts it in next message space, e.g.
 o slaveNums()
It returns number of slave workers
 o stopAll()
Stop threads to process
 o stopProcessing()
 o stopProcessing(boolean)
Stop threads to process
 o sync(MailboxKey, int)
waits until the message space contains numMessages number of messages
 o sync(MailboxKey[], int)
waits until each message space in enumerations contains numMessages
 o sync(Vector, int)
waits until each message space in enumerations contains numMessages
 o validateArgument(Object)
 o waitAllHosts()
 o waitAllHosts(long)
 o waitUntilFound(MailboxKey, Message)
Waits until message exist in message spaces (blocking)
 o workerNums()
It returns number of threads/workers

Variables

 o MAX_WAIT
 protected static final int MAX_WAIT
Constants

See Also:
class, method

Constructors

 o JavaNOWAPI
 public JavaNOWAPI(JavaNOWVirtualMachine javaNOWVM)
Constructors

See Also:
class, method

Methods

 o finalize
 protected void finalize()
Destructors

Overrides:
finalize in class Object
See Also:
class, method
 o getHostName
 public String getHostName()
 o getHostId
 public int getHostId()
 o workerNums
 public int workerNums()
It returns number of threads/workers

See Also:
class, method
 o slaveNums
 public int slaveNums()
It returns number of slave workers

See Also:
class, method
 o getTime
 public long getTime()
It returns current time in milliseconds

See Also:
class, method
 o stopAll
 public void stopAll()
Stop threads to process

See Also:
class, method
 o stopProcessing
 public void stopProcessing()
 o stopProcessing
 public void stopProcessing(boolean flag)
Stop threads to process

See Also:
class, method
 o put
 public void put(MailboxKey ts,
                 Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
Inserts a message into message space

See Also:
class, method
 o getp
 public Message getp(MailboxKey ts,
                     Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
Removes message from message space in nonblocking fashion. If message does not exist, it returns null

See Also:
class, method
 o get
 public Message get(MailboxKey ts,
                    Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
Removes message from message space in blocking fashion. If message does not exist, it blocks until it is inserted

See Also:
class, method
 o present
 public boolean present(MailboxKey ts,
                        Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
Returns true if message exist in message spaces (nonblocking)

See Also:
class, method
 o notifyRead
 public void notifyRead(JavaNOWMessageNotifier notifier,
                        MailboxKey ts,
                        Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
notify user when message arrives

See Also:
class, method
 o notifyGet
 public void notifyGet(JavaNOWMessageNotifier notifier,
                       MailboxKey ts,
                       Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
notify user when message arrives

See Also:
class, method
 o waitUntilFound
 public void waitUntilFound(MailboxKey ts,
                            Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
Waits until message exist in message spaces (blocking)

See Also:
class, method
 o readp
 public Message readp(MailboxKey ts,
                      Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
Returns a copy of message from message space in nonblocking fashion. If message does not exist, it returns null

See Also:
class, method
 o read
 public Message read(MailboxKey ts,
                     Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
Returns a copy of message from message space in nonblocking fashion. If message does not exist, it blocks until it is inserted

See Also:
class, method
 o eval
 public void eval(MailboxKey ts,
                  ActiveMessage aMessage,
                  Object arg) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It is used to evaluate a message method (execute()) and inserts the output of that method in message space.

See Also:
class, method
 o getpType
 public Vector getpType(MailboxKey ts,
                        Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It returns vector of messages that match the message value of the aMessage

See Also:
class, method
 o getpType
 public Message getpType(MailboxKey ts,
                         Message aMessage,
                         int n) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It returns nth message in the message space that matches the message value as that of aMessage

See Also:
class, method
 o readpType
 public Vector readpType(MailboxKey ts,
                         Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It is same as getpType() couterpart except it returns copy of messages

See Also:
class, method
 o readpType
 public Message readpType(MailboxKey ts,
                          Message aMessage,
                          int n) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It is same as getpType() counterpart except it returns copy of messages

See Also:
class, method
 o getMessageCount
 public int getMessageCount(MailboxKey ts,
                            Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It returns number of messages in the messagespace that matches the message value as that of aMessage

See Also:
class, method
 o getMessageCount
 public int getMessageCount(MailboxKey ts) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It returns number of messages in the messagespace

See Also:
class, method
 o barrier
 public void barrier(MailboxKey ts,
                     int numMessages) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
barrier: waits numMessages number of processes have executed this operation.

See Also:
class, method
 o sync
 public void sync(MailboxKey ts,
                  int numMessages) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
waits until the message space contains numMessages number of messages

See Also:
class, method
 o clear
 public void clear(MailboxKey ts) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
Removes all message from a mailbox

See Also:
class, method
 o putDelayed
 public void putDelayed(MailboxKey ts1,
                        MailboxKey ts2,
                        Message aMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
BUILDING HIGHER ABSTRACTION BASED ON CORE JavaNOW FUNCTIONS /** /** Performs data flow operation by putting message in messageSapceKey1 when message arrives at mailboxKey2

See Also:
class, method
 o evalDelayed
 public void evalDelayed(MailboxKey ts1,
                         MailboxKey ts2,
                         Message aMessage,
                         ActiveMessage activeMessage) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
Performs data flow operation by evaluating active message in messageSapceKey1 when message arrives at mailboxKey2 and pass the data value as argument to eval.

See Also:
class, method
 o broadcast
 public void broadcast(int source,
                       Message aMessage,
                       Vector mailboxes) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It retrieves copy of message from one messagespace and inserts it in all other messagespaces. e.g. if messagespaces 1,2,3, and 4 have following messages value as specified by their message key: MailboxKey 1 2 3 4 MessageValue A Then after this operation, it will look like MailboxKey 1 2 3 4 MessageValue A A A A

See Also:
class, method
 o broadcast
 public void broadcast(int source,
                       Message aMessage,
                       MailboxKey arrMailboxKey[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It retrieves copy of message from one messagespace and inserts it in all other messagespaces. e.g. if messagespaces 1,2,3, and 4 have following messages value as specified by their message key: MailboxKey 1 2 3 4 MessageValue A Then after this operation, it will look like MailboxKey 1 2 3 4 MessageValue A A A A

See Also:
class, method
 o concat
 public void concat(Message aMessages[],
                    Vector mailboxes) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It is complete broadcast and inserts messages from each message space into each other message spaces, e.g. e.g. if messagespaces 1,2,3, and 4 have following messages value as specified by their message key: MailboxKey 1 2 3 4 MessageValue A B C D Then after this operation, it will look like MailboxKey 1 2 3 4 MessageValue A A A A B B B B C C C C D D D D

See Also:
class, method
 o concat
 public void concat(Message aMessages[],
                    MailboxKey arrMailboxKey[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
 o scatter
 public void scatter(int source,
                     Message aMessages[],
                     Vector mailboxes) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
Inserts each message in message array into different message space as specified in message space key. e.g. if messagespaces 1,2,3, and 4 have following messages value as specified by their message key: MailboxKey 1 2 3 4 MessageValue A B C D Then after this operation, it will look like MailboxKey 1 2 3 4 MessageValue A B C D

See Also:
class, method
 o scatter
 public void scatter(int source,
                     Message aMessages[],
                     MailboxKey arrMailboxKey[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
 o gather
 public void gather(int dest,
                    Message aMessages[],
                    Vector mailboxes) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It gathers messages from different message spaces (keys stored in enumeration) and stores them in output message space e.g. if messagespaces 1,2,3, and 4 have following messages value as specified by their message key: MailboxKey 1 2 3 4 MessageValue A B C D Then after this operation, it will look like MailboxKey 1 2 3 4 MessageValue A B C D

See Also:
class, method
 o gather
 public void gather(int dest,
                    Message aMessages[],
                    MailboxKey arrMailboxKey[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
 o shift
 public void shift(Message aMessages[],
                   Vector mailboxes) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It retrieves message from one message space and inserts it in next message space, e.g. if messagespaces 1,2,3, & 4 have following messages value as specified by their message key: MailboxKey 1 2 3 4 MessageValue A B C D Then after this operation, it will look like MailboxKey 1 2 3 4 MessageValue B C D A

See Also:
class, method
 o shift
 public void shift(Message aMessages[],
                   MailboxKey arrMailboxKey[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
 o index
 public void index(Message aMessages[][],
                   MailboxKey mailboxes[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It distributes distinct messages from each message space to all other message spaces e.g. if messagespaces A,B,C, and D have following messages value as specified by their message key: MailboxKey A B C D MessageValue 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 Then after this operation, it will look like MailboxKey A B C D MessageValue 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

See Also:
class, method
 o reduce
 public void reduce(int dest,
                    ActiveMessage outMessage,
                    Vector mailboxes,
                    Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It retrieves message from different message spaces and performs operation on it as specified in the message method and inserts in output message space. e.g. if messagespaces A,B,C, and D have following messages value as specified by their message key: MailboxKey A B C D MessageValue 3 12 5 7 and the execute method of ActiveMessage is simply adding message values then after this operation, the output message will contain 27.

See Also:
class, method
 o reduce
 public void reduce(int dest,
                    ActiveMessage outMessage,
                    MailboxKey arrMailboxKey[],
                    Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
 o combine
 public void combine(ActiveMessage outMessage,
                     Vector mailboxes,
                     Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It is like reduce except it stores result in all messages e.g. if messagespaces A,B,C, and D have following messages value as specified by their message key: MailboxKey A B C D MessageValue 3 12 5 7 and the execute method of ActiveMessage is simply adding message values then after this operation, it will look like MailboxKey A B C D MessageValue 27 27 27 27

See Also:
class, method
 o combine
 public void combine(ActiveMessage outMessage,
                     MailboxKey arrMailboxKey[],
                     Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
 o prefix
 public void prefix(ActiveMessage outMessage,
                    Vector mailboxes,
                    Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
It is like reduce except it stores partial result in all messages e.g. if messagespaces A,B,C, and D have following messages value as specified by their message key: MailboxKey A B C D MessageValue 3 12 5 7 and the execute method of ActiveMessage is simply adding message values then after this operation, it will look like MailboxKey A B C D MessageValue 3 15 20 27

See Also:
class, method
 o prefix
 public void prefix(ActiveMessage outMessage,
                    MailboxKey arrMailboxKey[],
                    Message aMessages[]) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
 o sync
 public void sync(Vector mailboxes,
                  int numMessages) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
waits until each message space in enumerations contains numMessages

See Also:
class, method
 o sync
 public void sync(MailboxKey arrMailboxKey[],
                  int numMessages) throws InvalidArgumentException, NotSerializableException, JavaNOWShutException
waits until each message space in enumerations contains numMessages

See Also:
class, method
 o addWaitingMailboxKeys
 protected synchronized void addWaitingMailboxKeys(MailboxKey ts)
keeps count of sync for messagespaces

See Also:
class, method
 o removeWaitingMailboxKeys
 protected synchronized void removeWaitingMailboxKeys(MailboxKey ts)
remove messagespace from list of waiting messagespaces

See Also:
class, method
 o waitAllHosts
 protected void waitAllHosts(long milliseconds)
 o waitAllHosts
 protected void waitAllHosts()
 o notifyIfWaiting
 protected void notifyIfWaiting(MailboxKey ts) throws SingleThreadBlockException
Wake any processes who are waiting in sync

See Also:
class, method
 o validateArgument
 protected void validateArgument(Object arg) throws InvalidArgumentException, NotSerializableException
 o getJavaNOWHandle
 protected JavaNOWVirtualMachine getJavaNOWHandle()
 o getDestHost
 protected int getDestHost(Message aMessage) throws InvalidArgumentException

All Packages  Class Hierarchy  This Package  Previous  Next  Index