Applets

JMS client applets are written in exactly the same way as normal JMS client applications are written. Browser security restrictions allow uncertified applets to establish connections only with the machine from which the applet is downloaded, in other words, the web server machine. This requires that unlike normal applications (which can connect to a JMS server running on any machine), uncertified applets be allowed to connect only to the machine from which they are downloaded.

However, certified applets are allowed to connect to any host to which the web client has authorized access by the certificate provider. The web client can set different levels of permissions for certificates from different certificate vendors. An applet carrying a certificate automatically invokes a window on web clients that do not allow it requisite permissions, asking if the user is interested in granting the permissions. Using the advanced security options of popular browsers such as Netscape and Internet Explorer, one can explicitly set security parameters for all certificate holders.

The SalesOrder Applet

Messaging brokers provide a reduced run-time library for applet support. The run-time library may be architected to allow new components to be plugged in by simply modifying the classpath to include the additional archive.

The run-time archive used for developing this applet contains all the classes representing FioranoMQ's implementation of JMS. This archive is 100% JMS 1.0.2 compliant. It includes implementation of all the Pub/Sub and PTP functionality. You can therefore modify these applets to work with any other 100% JMS 1.0.2 compliant vendor product. While doing so, make sure that you substitute fmprtl.zip (the client runtime of FioranoMQ) with the client runtime of your specific vendor.

The following listing is for a simple web page demonstrating the usage of JMS APIs from within an applet hosted on a web page:

     <HEAD>      <BODY>       <CENTER>        <OBJECT         class         WIDTH = 400 HEIGHT = 310         codebase="http://Java.sun.com/products/plugin/1.3/jinstall-13-     Win32.cab#Version=1,3,0,0">         <PARAM NAME = CODE VALUE="pubsub.retailbrokerage.SalesOrderPanel.class">         <PARAM NAME = CODEBASE VALUE = "../../" >         <PARAM NAME = ARCHIVE VALUE = "fmprtl.zip, jndi.jar" >         <PARAM NAME="type" VALUE ="application/x-java-applet;version=1.3">         <PARAM NAME="scriptable" VALUE="false">        </OBJECT>       </CENTER>      </BODY>     </HEAD> 

Deploying the SalesOrder

Deploy the applet on a web server. Start up the web server and then start up the applications in turn as follows:

click to expand

The screenshot below shows the sales order applet executing in a browser served from a web server:

click to expand



Professional JMS
Professional JMS
ISBN: 1861004931
EAN: 2147483647
Year: 2000
Pages: 154

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net