org.miv.mbox.net
Class RemoteMBox

java.lang.Object
  extended by org.miv.mbox.net.RemoteMBox
All Implemented Interfaces:
MBox

public class RemoteMBox
extends Object
implements MBox

Representation of a remove message box.

Instances of this class can be used to mimic the behaviour of a local message box, allowing to post things in it, whereas the thing that lays under is a Sender that transmit messages to a distant message box.

Since:
20061212
Author:
Antoine Dutot

Field Summary
protected  String remoteMBoxName
          Name of the remote message box.
protected  Sender sender
          The sender.
 
Constructor Summary
RemoteMBox(Sender sender, String remoteMBoxName)
          New remote message box.
 
Method Summary
 void post(String from, Object... data)
          Post a message to the remote message box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sender

protected Sender sender
The sender.


remoteMBoxName

protected String remoteMBoxName
Name of the remote message box.

Constructor Detail

RemoteMBox

public RemoteMBox(Sender sender,
                  String remoteMBoxName)
New remote message box.

Parameters:
sender - Sender to the distant host containing the remove message box.
remoteMBoxName - Name of the distant message box on the distant host.
Method Detail

post

public void post(String from,
                 Object... data)
          throws CannotPostException
Post a message to the remote message box. As the post method in the message box cannot fail, this method throws a RuntimeException if something bad happen.

Specified by:
post in interface MBox
Parameters:
from - The name of the message sender.
data - A set of objects to send.
Throws:
CannotPostException


Copyright © 2011. All Rights Reserved.