Open-source implementation of EJB, part of Apache TomEE.
Download OpenEJB Standalone at https://tomee.apache.org/download-ng.html
https://d3s.mff.cuni.cz/files/teaching/nswi080/labs/Files/sources-5.zip.
EJB application consisting of remotely accessible session beans and persistent entity beans.
The client application shows how to call methods of the remote session beans, then using another session bean, creates and queries the entities.
mwy/ExampleStateless.java
:
mwy/ExampleStatelessBean.java
:
mwy/ExampleStateful.java
:
mwy/ExampleStatefulBean.java
:
mwy/Director.java
, mwy/Movie.java
:
mwy/ExampleEntities.java
:
mwy/ExampleEntityBeans.java
:
EntityManager
accesses a persistence contextclasses/META-INF/persistence.xml
Director
and Movie
entity beans$OPENEJB_HOME/conf/openejb.xml
$OPENEJB_HOME/data/hsqldb
ExampleClient.java
:
ExampleEntities
bean, creates persistent entities, then prints their contentScripts:
make.sh
:
run-server.sh
:
stop-server.sh
:
run-deploy.sh
:
run-client.sh
:
Download OpenEJB Standalone from https://archive.apache.org/dist/tomee/tomee-8.0.6/openejb-standalone-8.0.6.tar.gz, or a choose different version from https://tomee.apache.org/download-ng.html.
Extract openejb-standalone-8.0.6.tar.gz
.
Configure OPENEJB_HOME as the path to OpenEJB in setenv.sh
.
Compile source codes (the beans and the client):
bash make.sh
Run the server:
bash run-server.sh
Deploy the beans to the running server:
bash run-deploy.sh
Run a client:
bash run-client.sh
Stop the server:
bash stop-server.sh
If you change the application, after compilation use bash run-deploy.sh -u
to undeploy the old version and deploy the new version.
Run the example as described above, but run the client two times. Look at and send the following by e-mail to the teaching assistant.
https://d3s.mff.cuni.cz/files/teaching/nswi080/labs/Files/task-5-en.html.
mwy/Node.java
mwy/Searcher.java
mwy/SearcherImpl.java
Searcher
which stores nodes in a local Map
Main.java