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's 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).
PauWare_Java_EE
NetBeans project or PauWare_Java_EE.jar
directly versus Java ME: PauWare_Java_ME
NetBeans project or PauWare_Java_ME.jar
directly) to the project as follows: in NetBeans, project's right click ->Properties->Libraries->ADD Project...
or ->Properties->Libraries->ADD JAR/Folder
.R1 & R2 railcars are approaching the T4 terminal while R3 does the same in the reverse direction. The 100 and 80 milestones impose crossing coordination between approached terminals and concerned railcars.
The Railcar control system database must be configured and accessible from a Java EE application server (GlassFish in NetBeans). The name of the data source must be set to jdbc/Railcar_control_system
within the server.
Database SQL scripts
For example, how to proceed in NetBeans with GlassFish and Java DB?
- First create the database in NetBeans (Services tab.) as follows:
- Next connect to the database in order to execute the Railcar control system database SQL script:
- Next create in GlassFish a “JDBC connection pool” as follows (1st step):
- 2nd step (please, try pinging the pool to test its accessibility):
- Next create in GlassFish a “JDBC resource” as follows:
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
as follows:
- Next create a JMS queue named
jms/Control_center_queue
as follows:
Running the application with
Railcar_control_system_simple_test
This client-side app. is an Enterprise Application Client, which performs a simple test (look at
main
program).
- First run (or deploy)
Railcar_control_system_Java_EE_6
,- 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 NetBeans.
- Re-link the
Railcar_control_system_client
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_6
,- 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.