MailboxFactory mailboxFactory = JAMailboxFactory.newMailboxFactory(1);
try {
Mailbox mailbox = mailboxFactory.createMailbox();
PrintingCalculator calculator = new PrintingCalculator();
calculator.initialize(mailbox);
JAFuture future = new JAFuture();
future.send(calculator, new Set(1));
future.send(calculator, new Add(2));
future.send(calculator, new Multiply(3));
future.send(calculator, new Divide(0));
} catch (Throwable e) {
e.printStackTrace();
} finally {
mailboxFactory.close();
}