Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.omg.CORBA.Context;
- import org.omg.CORBA.ContextList;
- import org.omg.CORBA.DomainManager;
- import org.omg.CORBA.ExceptionList;
- import org.omg.CORBA.NVList;
- import org.omg.CORBA.NamedValue;
- import org.omg.CORBA.Object;
- import org.omg.CORBA.Policy;
- import org.omg.CORBA.Request;
- import org.omg.CORBA.SetOverrideType;
- import bank.Administrator;
- import bank.AdministratorHelper;
- public class MyAdministrator extends Client {
- private Administrator admin;
- private String objName;
- public MyAdministrator(String args[]) {
- super(args);
- if (args.length == 0) {
- admin = AdministratorHelper.narrow(getObjectReference(objName));
- closeBuffer();
- } else {
- objName = "Bank.cxt/admin.service";
- admin = AdministratorHelper.narrow(getObjectReference(objName));
- }
- }
- public void test() {
- admin.createAccount(1000.0, "Simeon Varbanov");
- admin.createAccount(500.0, "Peter Karadzhov");
- admin.createAccount(10.0, "Mamalichki");
- admin.createAccount(700.0, "Kosta Varbanov");
- admin.createAccount(200.0, "Teo");
- System.out.println(admin.deleteAccounts(11));
- System.out.println(admin.deleteAccounts(2));
- }
- public static void main(String[] args) {
- MyAdministrator admin = new MyAdministrator(args);
- admin.test();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement