DSI, DII IN CORBA USING VISIBROKER AND JAVA


AIM:
    To write a Java application for bank accounts using visibroker.

ALGORITHM:

SERVER:

Step 1:Start
Step 2:Create the Bank folder using Bank.idl module program
Step 3:Initialize ORB
Step 4:Create the account manager to link client
Step 5:Compile and run the server program
Step 6:Display the accounts created
Step 7:Stop

CLIENT:
Step 1:Start
Step 2:Initialize ORB
Step 3:Create the account manager to link server
Step 4:Requesting server the account manager to open a named account
Step 5:Display the balance of the account’s holder
Step 6:Stop

SOURCE CODE:
 
Module:

    module Bank {
    interface Account {

    float balance();
    };
    Interface AccountManager {
    Account open(in string name);
    };
    };

Implementation:
    Public class AccountImpl extends Bank._AccountImplBase {
    Public AccountImpl(float balance) {
    _balance =balance;
    }
    Public float balance() {
    Return_balance;
    }
    Private float_balance;
    }

Server:
    Public class Server {
    Public static void main(String[] args) {
    Org.omg.CORBA.ORB orb=org.omg.CORBA.ORB.init(args,null);
    Org.omg.CORBA.BOA boa=((com.visigenic.vbroker.orb.ORB)orb).BOA_init();
    Bank.AccountManager=new AccountManagerImpl(“BankManager”);
    Boa.obj_is_ready(manager);
    System.out.println(manager + “is ready.”);
    Boa.impl_is_ready();
    }
    }

Client:
    Public class Client {
    Public static void main(String[] args) {
Org.omg.CORBA.ORB orb=org.omg.CORBA.ORB.init(args,null);
Bank.AccountManager manager=Bank.AccountManagerHelper.bind(orb,”BankManager”);
String name=args.length>0?args[0]:”Jack B.Quick”;
Bank.Account account=manager.open(name);
float balance=account.balance();
System.out.println(“The balance in”+name+””s account is $”+balance);
}
}

OUTPUT:

SERVER:



CLIENT:


RESULT:
          Thus the program for bank accounts using visibroker was performed and the output was verified.

.
Previous
Next Post »

Still not found what you are looking for? Try again here.