This sample implements a simple polling application.
You can create polls and then vote (+1 or -1) for each poll (called Subject).
The front is a JAX-RS front and the backend uses EJBs and JPA.
The application contains several modules:
The front layer contains a MBean managed by CDI (VoteCounter) which is used by REST services to update information you can retrieve through JMX protocol (JConsole client is fine to see it ;)).
It manages a dynamic datasource too. It manages in the example configuration 2 clients.
It is a simple round robin by request. That's why from the client if you simply create a poll then find it you'll not find the persisted poll, you need to do it once again.
It lets you create poll, retrieve them, find the best poll and vote for any poll.
Please type help for more information.
svn co http://svn.apache.org/repos/asf/tomee/tomee//examples/polling-parent cd polling-parent mvn clean install
All edits are reviewed before going live, so feel free to do much more than fix typos or links. If you see a page that could benefit from an entire rewrite, we'd be thrilled to review it. Don't be surprised if we like it so much we ask you for help with other pages :)NOTICE: unless indicated otherwise on the pages in question, all editable content available from apache.org is presumed to be licensed under the Apache License (AL) version 2.0 and hence all submissions to apache.org treated as formal Contributions under the license terms.