Alarm is a simple J2EETM application developed on top of JOnAS. This application is delivered with the JOnAS distribution and resides in the $JONAS_ROOT/examples/alarm directory. This example illustrates how to use JOnAS, Tomcat, and Joram together to create a complete application using EJBs, servlets, html, JSPs, and message driven beans.
This application is run from the "System Management" area. It simulates an administration console receiving alarms from some managed devices. The console is of course an HTML client visualizing the alarms received and maintained in the database by the application server.
This application shows how to use JOnAS, Tomcat, and Joram together in a complete application using EJBs, servlets, html, JSPs, and message driven beans. Moreover, a JOnAS "service" is run inside the J2EE server. It is composed of the following parts:
AlarmGenerator: AlarmGenerator is a servlet that generates alarms by publishing messages on a topic. Once the JOnAS Server is running, this servlet may be used to feed the Message Driven Bean listening on the topic.
Session bean View: A Session bean is used to provide a remote access to the Alarm Service. Each user will create its own session that will be reached from JSP pages or servlets.
Entity Bean AlarmRecord: When a new alarm type is received, an entity bean is created. If the Alarm is already known, its count is incremented only.
Message Driven Bean: JMS is used to access asynchronously to the service. A Message Driven Bean is used to collect Alarm sent by AlarmGenerator. It will then inform the AlarmManager that will process it.