![]() |
Railcar control system
|
© Franck.Barbier@FranckBarbier.com |
Railcar control system is a software case study, which is implemented in State Chart XML -SCXML- ☛ and PauWare. PauWare is a Java engine for executing Harel Statecharts ☛ in general. This case study is inspired by the following paper: “Executable Object Modeling with Statecharts” ☛. Railcar control system is a Java Enterprise Edition -Java EE- application i.e., state machines are embedded in Stateful Session Enterprise JavaBeans -EJBs-
After downloading the source code, the link to the PauWare software (and possibly other libraries) may be broken. In order to successfully run the Apache NetBeans project, please (re-)link the appropriate JAR files (Java SE:
PauWare_Java_EE
Apache NetBeans project orPauWare_Java_EE.jar
directly versus Java ME:PauWare_Java_ME
Apache NetBeans project orPauWare_Java_ME.jar
directly) to the project as follows: in Apache NetBeans, project's right click->Properties->Libraries->ADD Project...
or->Properties->Libraries->ADD JAR/Folder
The Railcar control system database must be configured and accessible from a Java EE application server (GlassFish in Apache NetBeans). The name of the data source must be set to
jdbc/Railcar_control_system
within the serverDatabase SQL scripts
How to proceed in Apache NetBeans with GlassFish and Java DB?
- First create the database in Apache NetBeans (Services tab.)
![]()
- Next connect to the database in order to execute the Railcar control system database SQL script
![]()
- Next create in GlassFish a “JDBC connection pool” (1st step)
![]()
- 2nd step (ping the pool to test its accessibility)
![]()
- Next create in GlassFish a “JDBC resource”
![]()
Java Message Service -JMS- resources
The server-side app. requires JMS resources on the GlassFish server
- First create a JMS queue factory named
jms/Control_center_queue_factory
![]()
- Next create a JMS queue named
jms/Control_center_queue
![]()
This client-side app. is an Enterprise Application Client, which performs a test (look at
main
program)
- First run (or deploy)
Railcar_control_system_Java_EE_server
- Next run
Railcar_control_system_simple_test
- Check the new state of the database (running again this app. requires to reset the data in the database, look at
main
program for instructions)Running the application with
Railcar_control_system_client
This client-side app. is a common Java SE application, which required enhanced adjustments in Apache NetBeans.
- Re-link the
Railcar_control_system_client
Apache NetBeans project to local libraries:
- Java EE from Glassfish (this library may be easily found by clicking on the
Add library...
button)appserv-rt.jar
(it is normally located in<GlassFish installation directory>/glassfish/lib
)- Next run (or deploy)
Railcar_control_system_Java_EE_server
- Next run
Railcar_control_system_client
- In case of success (I hope so!), you are now able to watch the user interface as shown above.