JOnAS v2.4 Tutorial | ||
---|---|---|
<<< Previous | Next >>> |
Alarm is a simple J2EETM application developed on top of JOnAS. This application is delivered with the JOnAS distribution (in the $JONAS_ROOT/example/alarm directory), and illustrates the use of the different EJB components (Session Bean, Entity Bean, Message Driven Bean), as well as some other J2EE components such as servlets and JSPs (the Web container associated with the JOnAS EJB container is Tomcat in this example).
This application is issued from the "System Management" area, it simulates an administration console receiving alarms from some managed devices. The console is of course an HTML client visualising the alarms received and maintained in database by the application server.
This application intends to show you how to use JOnAS, Tomcat, and Joram together to get a complete application using EJBs, servlets, html, JSPs, and message driven beans. Moreover, a JOnAS "service" is run inside the EJBServer. It is composed of the following parts:
AlarmGenerator: this is a servlet that generates alarms by publishing messages on a JMS topic. Once the EJBServer is running, this servlet may be used to feed the Message Driven Bean listening on the topic.
AlarmService: this is a JOnAS service running inside the EJBServer, and used to manage the different alarms received on different devices. This part is not an EJB because it is used locally in the EJBServer (no remote visibility), and has no persistence; this also illustrates the JOnAS services facility.
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 of the Alarm Manager.
Entity Bean AlarmRecord: Alarms are persistently represented by AlarmRecord entity bean instances. When a new alarm type is received, an entity bean instance 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 alarms sent by AlarmGenerator. It will then inform the AlarmService that will process it.
<<< Previous | Home | Next >>> |
Accessing a bean from a JSP | Finding the alarm application |