All Examples  This Package

package examples.event.stocks

Class Index

  • EvaluateStocks
  • MailStockInfo
  • Register
  • SendEvents
  • about this package

    This package contains a small stock-price application that is driven by WebLogic Events. There are four Java files:

    how to use this package

    1. Set up your development environment as describe in Setting your development environment.

    2. Compile the EvaluateStocks.java and MailStockInfo.java classes to your SERVER_CLASSES directory, with a command like this one for Windows NT:
        $ javac -d %SERVER_CLASSES% EvaluateStocks.java MailStockInfo.java

    3. Compile the Register.java and SendEvents.java classes to your CLIENT_CLASSES directory with a command like this one for Windows NT:
        $ javac -d %CLIENT_CLASSES% Register.java SendEvents.java

    4. Start WebLogic Server in your server shell.

    5. Register an interest in some stocks by calling the Register class from a development shell. (Use a real email account -- your own -- and supply a valid SMTP server.) Here's an example that registers an interest in Sun Microsystems stock at $75 share for an interested party foo@bar.com, using the SMTP server at bigisp.com:
       $ java examples.event.stocks.Register t3://localhost:7001 SUNW 75 smtp.bigisp.com foo@bar.com

    6. Generate some stock traffic by calling the SendEvents class from your development shell. Here's an example that generates matching traffic for the registration above, with a series of prices that start at 105 and fall to 70:
       $ java examples.event.stocks.SendEvents t3://localhost:7001 SUNW 70 105

    7. Check your email.

    there's more . . .

    Check out the Developers Guide Using WebLogic Events for more about writing event-driven applications.