new BankAccount(args[i]).deposit(50);
Thread.sleep(1000);
// Remote accounts
DirectoryManager locator = HyFlow.getLocator();
for(int i=1; i<args.length; i++){
BankAccount account = (BankAccount)locator.open(args[i]);
if(account!=null){
account.deposit(50);
System.out.println(account.withdraw(10*Integer.parseInt(args[0])));
locator.release(account);
}
else
System.out.println("Account " + args[i] + " is not found!");
}
// Check results
Thread.sleep(1000);
for(int i=1; i<args.length; i++){
BankAccount account = (BankAccount)HyFlow.getLocator().open(args[i], "r");
System.out.println(account.checkBalance());
locator.release(account);
}
System.out.println("Complete Test");
}