Bank
The Bank example has a simple Bank interface to open a bank account and
to query the balance in a bank account. It illustrates basic communication
using the ORB.
From this example, you will learn how to:
-
Implement a simple interface
-
Implement a server using the inheritance mechanism
Directory Contents
-
Bank.idl
IDL interface for the Bank object.
-
Server.java
Bank server. Creates an instance of the Bank and calls
org.omg.CORBA.BOA.impl_is_ready()
to make this object available to client programs. The Bank Server
implementation implements two methods: open, which opens a bank
account, and balance, which returns the balance in a person's
account whose name is provided as input (by generating a random number).
-
AccountImpl.java
Account Object implementation. This program contains the implementation of t
he Account object and is part of the Bank Server described above.
-
AccountManagerImpl.java
Account Manager Implementation. This program contains the implementation of
the Account Manager object and is part of the Bank Server described above.
-
Client.java
This is the Bank client. It binds to the AccountManager object and invokes open() to open a bank account. It then invokes balance() on the account object reference obtained to query the balance.
-
ClientApplet.java
This is the Bank Client Applet.
-
ClientApplet.html
This is the html file to download the ClientApplet.
Building this example
To build the example, select Build | Make Project. To modify the options passed
to IDL2JAVA, right click the Bank.idl file and select IDL Properties.
Running this example
-
First make sure that the VisiBroker Smart Agent (osagent
executable) is running on your network.
-
Run the Bank Server.
-
Run the Bank Client.
Return to the top-level examples page.