--------------------------------------------------------------------- Sample Usage --------------------------------------------------------------------- public class ChatTopic { public String UserName, Message; public ChatTopic(){} public ChatTopic(String userName, String message){ UserName = userName; Message = message; } } ---------------------------------------------------------------------- Console application code ---------------------------------------------------------------------- //Register PSBClient.register(ChatTopic.class); //Subscribe PSBClient.subscribe(ChatTopic.class, new Action<ChatTopic>(){ public void execute(ChatTopic msg){ System.out.println(String.format("%s: %s",msg.UserName, msg.Message)); } }); //Publish PSBClient.publish(new ChatTopic("JavaUser", "Hello from Java"));