Package vs.server

Examples of vs.server.TimeoutDispatcher


  }
 
  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.TimeoutDispatcher

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.