Class PmessageJMSv0

java.lang.Object
pygar.communication.PmessageBase
pygar.communication.PmessageJMSv0
All Implemented Interfaces:
java.io.Serializable

@ThreadSafe
public class PmessageJMSv0
extends PmessageBase
implements java.io.Serializable
The PmessageJMSv0 class extends the PmessageBase class to provide a message type with additional fields. Instances of this class can be send as a JMS Message with relatively little effort. This implementation is limited to relatively small files because it allocates a byte buffer to hold the contents of any file that should be sent with the message. A more robust implementation would send the file in blocks with careful attention to potential network errors.

Note that a file body is sent in two fields. A name field holds the name of the file without the path. The path is deleted because it has no general value in a distributed system. Second, the content of the file is contained in a byte array.

See Also:
Serialized Form
  • Field Details

  • Constructor Details

    • PmessageJMSv0

      public PmessageJMSv0​(PmessageJMSv0 msg)
      copy constructor
      Parameters:
      msg -
    • PmessageJMSv0

      public PmessageJMSv0()
    • PmessageJMSv0

      public PmessageJMSv0​(java.lang.String myID, java.lang.String recipient, java.lang.String eventName, java.lang.String s)
    • PmessageJMSv0

      public PmessageJMSv0​(Pmessage msg)
      conversion constructor from the sibling type Pmessage
  • Method Details

    • makePmessageBase

      public PmessageBase makePmessageBase()
      Upcast a PmessageJMSv0 to a PmessageBase possibly discarding fields
      Returns:
    • setText

      public void setText​(java.lang.String stringBody)
    • getText

      public java.lang.String getText()
    • setFileName

      public void setFileName​(java.lang.String name)
    • getFileName

      public java.lang.String getFileName()
    • setFileContent

      public void setFileContent​(byte[] bytes)
    • getFileContent

      public byte[] getFileContent()