Advertisement
simeonvarbanov

Untitled

Nov 11th, 2012
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.22 KB | None | 0 0
  1. import org.omg.CORBA.Context;
  2. import org.omg.CORBA.ContextList;
  3. import org.omg.CORBA.DomainManager;
  4. import org.omg.CORBA.ExceptionList;
  5. import org.omg.CORBA.NVList;
  6. import org.omg.CORBA.NamedValue;
  7. import org.omg.CORBA.Object;
  8. import org.omg.CORBA.Policy;
  9. import org.omg.CORBA.Request;
  10. import org.omg.CORBA.SetOverrideType;
  11.  
  12. import bank.Administrator;
  13. import bank.AdministratorHelper;
  14.  
  15. public class MyAdministrator extends Client {
  16.  
  17.     private Administrator admin;
  18.  
  19.     private String objName;
  20.  
  21.     public MyAdministrator(String args[]) {
  22.         super(args);
  23.         if (args.length == 0) {
  24.             admin = AdministratorHelper.narrow(getObjectReference(objName));
  25.             closeBuffer();
  26.         } else {
  27.             objName = "Bank.cxt/admin.service";
  28.             admin = AdministratorHelper.narrow(getObjectReference(objName));
  29.         }
  30.     }
  31.    
  32.     public void test() {
  33.         admin.createAccount(1000.0, "Simeon Varbanov");
  34.         admin.createAccount(500.0, "Peter Karadzhov");
  35.         admin.createAccount(10.0, "Mamalichki");
  36.         admin.createAccount(700.0, "Kosta Varbanov");
  37.         admin.createAccount(200.0, "Teo");
  38.         System.out.println(admin.deleteAccounts(11));
  39.         System.out.println(admin.deleteAccounts(2));
  40.        
  41.     }
  42.  
  43.     public static void main(String[] args) {
  44.         MyAdministrator admin = new MyAdministrator(args);
  45.         admin.test();      
  46.     }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement