} }
Files Prepare Run Troubleshooting Related Topics
This example is a simulated stock information system application. It includes two standalone publishers and an embedded publisher running in a Web module that are responsible for generating simulated trade information and publishing the information to WebLogic HTTP Pub/Sub Server, and a Web module to service the requests from users' browsers to provide the stock trade information published by the client.
The example demonstrates the usage of the WebLogic HTTP Pub/Sub Server utilizing the Dojo Toolkits, which provides the support of the Bayeux protocol.
After you run the example, a page including a stock table and a chart will be displayed in your browser. Select the stock that you would like to view from the list box and click the "Subscribe" button to add the stock to the table. Click the "X" icon at the end of row of the stock to remove the stock from the table. Select the checkbox at the beginning of the row of the stock to add/remove the stock to/from the chart below.
Directory Location:
MW_HOME/wlserver_10.3/samples/server/examples/src/examples/webapp/pubsub/stock/
(where MW_HOME is the directory containing your Oracle WebLogic Server installation)
File Click source files to view code. |
Description |
---|---|
application.xml | J2EE standard enterprise application deployment descriptor. |
build.xml | Ant build file that contains targets for building and running the example. |
createUsers.py | WLST script used to create users for this example. |
web.xml | Web application deployment descriptor. |
weblogic.xml | Oracle WebLogic Server-specific Web application deployment descriptor. |
weblogic-pubsub.xml | WebLogic HTTP Pub/Sub Server deployment descriptor. |
weblogic-pubsub.xml | WebLogic HTTP Pub/Sub Server deployment descriptor using the JMS Handler. |
index.jsp | JSP file for displaying the stock table and chart. |
publisher.jsp | JSP file for starting and stopping the publisher running in the Web module. |
DataProviderServlet.java | Servlet which provides the list of stock symbols that matched the passed parameter. |
ApiBasedClient.java | Client implementation which publishes messages through Pub/Sub server side APIs. |
InWebPublisher.java | Publisher running in the Web module. |
InWebPublisherControllerServlet.java | Servlet initializing the InWebPublisher. |
SymbolsProvider.java | Class which provides the list of available stock symbols. |
Client.java | Interface of client. |
TradeSimulator.java | Class simulating the stock trade information. |
AbstractPublisher.java | Abstract class for all publishers. |
HttpBasedClient.java | Client implementation which publishes messages through HTTP protocol. |
JmsBasedClient.java | Client implementation which publishes messages through JMS topic. |
StandalonePublisher.java | Main class which invokes HttpBasedClient or JmsBasedClient to publish messages to server. |
Before working with this example:
No special configuration is required for this example.
To build the example, follow these steps:
Username | Password |
---|---|
Publisher | Publisher |
Subscriber | Subscriber |
You will not see any trade information prior to executing this command. As previously described, the example includes publishers to generate the simulated trade information. This command launches the default publisher.
(Internet connection required.)