edu.rit.pj.cluster
Class Proxy
- java.lang.Object
-
- edu.rit.pj.cluster.Proxy
-
- Direct Known Subclasses:
- JobBackendProxy, JobFrontendProxy, JobSchedulerProxy
public abstract class Proxy extends java.lang.ObjectClass Proxy is the abstract base class for a proxy object for sending messages to a PJ process.
-
-
Constructor Summary
Constructors Constructor and Description Proxy(ChannelGroup theChannelGroup, Channel theChannel)Construct a new proxy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()Close communication with this proxy's far end process.Statusreceive(Buf theDst)Receive a message from this proxy's far end process.Statusreceive(java.lang.Integer theTag, Buf theDst)Receive a message with the given tag from this proxy's far end process.voidsend(int theTag, Buf theSrc)Send a message with the given tag and items to this proxy's far end process.voidsend(Message theMessage)Send the given message to this proxy's far end process.
-
-
-
Constructor Detail
-
Proxy
public Proxy(ChannelGroup theChannelGroup, Channel theChannel)
Construct a new proxy. The proxy will use the given channel in the given channel group to send messages to the far end process.- Parameters:
theChannelGroup- Channel group.theChannel- Channel.
-
-
Method Detail
-
send
public void send(Message theMessage) throws java.io.IOException
Send the given message to this proxy's far end process.- Parameters:
theMessage- Message.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
send
public void send(int theTag, Buf theSrc) throws java.io.IOExceptionSend a message with the given tag and items to this proxy's far end process.- Parameters:
theTag- Message tag.theSrc- Item source buffer.- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
receive
public Status receive(Buf theDst) throws java.io.IOException
Receive a message from this proxy's far end process. A message will be received from this proxy's channel in this proxy's channel group. The message must have a tag of 0. The message items are stored in the given item destination buffer.The receive() method does not return until the message has been fully received.
- Parameters:
theDst- Item destination buffer.- Returns:
- Status object giving the outcome of the message reception.
- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
receive
public Status receive(java.lang.Integer theTag, Buf theDst) throws java.io.IOException
Receive a message with the given tag from this proxy's far end process. A message will be received from this proxy's channel in this proxy's channel group. If theTag is null, a message will be received with any tag. The message items are stored in the given item destination buffer.The receive() method does not return until the message has been fully received.
- Parameters:
theTag- Message tag, or null to receive any tag.theDst- Item destination buffer.- Returns:
- Status object giving the outcome of the message reception.
- Throws:
java.io.IOException- Thrown if an I/O error occurred.
-
close
public void close()
Close communication with this proxy's far end process.
-
-
DMelt 3.0 © DataMelt by jWork.ORG