Package vs.server

Examples of vs.server.Dispatcher


 
  Dispatcher dispatcher;
 
  public Server(int port) {
    System.out.println("server: " + port);
    dispatcher = new Dispatcher(port);
    dispatcher.start();
  }
View Full Code Here


    if (localhost == null) {
      localhost = InetAddress.getLocalHost();
    }

    // rpc infrastructure
    dispatcher = new Dispatcher(PORT_NUMBER);
   
    // business objects
    serverAccountOne = new AccountImpl(accountIdOne);
    serverAccountOne.deposit(initialBalance + initialBalance);
    serverAccountTwo = new AccountImpl(accountIdTwo);
View Full Code Here

    if (localhost == null) {
      localhost = InetAddress.getLocalHost();
    }

    // rpc infrastructure
    dispatcher = new Dispatcher(PORT_NUMBER);
   
    // business objects
    serverAccount = new AccountImpl(accountId);
    serverAccount.deposit(initialBalance);
   
View Full Code Here

    if (localhost == null) {
      localhost = InetAddress.getLocalHost();
    }

    // rpc infrastructure
    dispatcher = new Dispatcher(PORT_NUMBER);
   
    // business objects
    serverAccount = new AccountImpl(accountId);
    serverAccount.deposit(initialBalance);
   
View Full Code Here

  }
 
  public void testTimeout() throws Exception {
   
    // rpc infrastructure
    Dispatcher timeoutdispatcher = new TimeoutDispatcher(PORT_NUMBER);
   
    // business objects
    serverAccount = new AccountImpl(accountId);
    serverAccount.deposit(initialBalance);
   
    // register serverside object
    timeoutdispatcher.register(accountId, serverAccount);

    // run dispatcher
    timeoutdispatcher.start();
   
    // client side: create remote object factory and remote object
    rof = new RemoteObjectFactory(localhost, PORT_NUMBER);
    accountProxy = (Account)rof.createRemoteObject(Account.class, accountId);
    assertNotNull(accountProxy);
   
    try {

      // do some remote ops
      accountProxy.balance();
      fail("SimpleRpcException on timeout expected");
     
    } catch (SimpleRpcException e) {
      // ok, as expected
    }   
   
    timeoutdispatcher.stopDispatcher();
    timeoutdispatcher = null;

  }
View Full Code Here

TOP

Related Classes of vs.server.Dispatcher

Copyright © 2018 www.massapicom. 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.