How do I run the Bank application example using an applet?
Question:
How do I run the Bank application example using an applet?
Answer:
Running this example
To run the examples, first make sure that the VisiBroker Smart Agent (osagent executable) is running on your network. prompt> osagent & (osagent -c on Windows)
Then start the bank server using the command: prompt> vbj Server & (start vbj Server on Windows) // make the server run in the background
Next, open a user's bank account and query the balance in the account using the command prompt> vbj Client john
or prompt> vbj Client // uses a default name
or
If you are using a webserver
1) Start OSagent as above
2) Start gatekeeper in any directory and copy the gatekeeper ior to the root directory of your webserver. (alternatively you can code your applet's html file to find the gatekeeper ior as follows
- /gatekeeper.ior>
See page 16 of the VB 3.2 gatekeeper guide for more information.
3) Start Server
prompt> vbj Server &
4) Point your Java enabled browser to the URL (do not use a local file) of your ClientApplet http:///ClientApplet.html
Note:
Your webserver must be able to serve up the vbjorb.jar classes and the ClientApplet.class ad it's stub classes. You may wish to unjar these or use the ARCHIVE tag in your applet.html file for the applet to be able to find the appropriate classes
The gatekeeper can be used as a webserver for test/development purposes.
The VBJ 3.2 gatekeeper guide page 1-11 warns that the gatekeeper should not be used as a web server in high performance environments. This is an understatement. The Gatekeeper was not intended to be a robust web server in a deployed environment. It should never be used as a general purpose web server on the internet. It is always advised to use a real web server and limit the gatekeeper to being an IIOP proxy. The gatekeeper should only be used as a web server in three situations:
1. for development as a convenience to the developer
2. as a web server for its own ior file
3. in special situations where the gatekeeper web server function will be limited to only serving the CORBA based applets/html. This sometimes is necessary to work around overly restrictive client side firewall situations where the gatekeeper must use port 80 on the exterior
Article originally contributed by Thomas Moyles