Package com.peterhi.working

Examples of com.peterhi.working.Registry.run()


public class Responder {

  public static void main(String[] args) throws Exception {
    Registry registry = new Registry(22222);
    registry.run();
    AboutMe aboutMe = new AboutMeImpl(registry);
    registry.publish("aboutMe", AboutMe.class, aboutMe);
    Thread.sleep(5000);
    aboutMe.fireCallback("HUGO is the best!");
    Thread.sleep(5000);
View Full Code Here


public class Requester {

  public static void main(String[] args) throws Exception {
    final Registry registry = new Registry(0);
    registry.run();
    SocketAddress address = new InetSocketAddress(InetAddress.getLocalHost(), 22222);
    final AboutMe aboutMe = registry.subscribe(address, "aboutMe", AboutMe.class, 0);
    System.out.println("Returned! " + aboutMe.getClass());
    System.out.println("NAME = " + aboutMe.getName());
    Hobbies h = aboutMe.getHobbies();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.