org.objectweb.speedo.j2eedo

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » Speedo_1.4.5 » org.objectweb.speedo.j2eedo 
org.objectweb.speedo.j2eedo
J2EEDO APPLICATION description

This package contains a web application base on JDO facilities ; This application is named "J2EEDO". It's a sample of a Web application to be depoyed on a J2EE server.

Package description

This package contains two JUnit test case classes:

  • TestJ2eedoApplication allows to test the application in standalone mode directly form JUnit.
  • TestJ2eedoJ2ee allows to test the application deployed on a J2EE application server form JUnit.

The J2EEDO application

Introduction

It's a sample of a Web application to be depoyed on a J2EE server.

Application's description

This application provides with 16 types of action:
Action Description
ping Returns a fixed string to ensure the j2ee application is started.
newDept Creates a new department and some new employees (random number defined between 10 and 70).
newProj Creates a new project and affect few employees (random number defined between 5 and 20).
newEmp Selects one of the known departments and creates a new employee.
setDeptBoss Selects one of the known departments and sets the manager for the department's employees.
delEmployee Removes an employee.
delProject Removes a project.
splitProject Selects one of the known departments, creates a new project and duplicates the member list from the former project.
splitDepartment Selects one of the known departments, creates a new department and affect the 50% of the former employees and project to the latter department.
mergeDept Removes a department and adds all projects and employees to an other project.
incSalary Increase an employee's salary.
getDepartment Gets a department by id.
getProject Gets a project by id.
getEmployee Gets an employee by id.
queryEmployees Performs one of the four queries:
  • Get employee by its id,
  • Get employees between min and max,
  • Get employees having the same manager,
  • Get employees member of a project.
queryProjects Performs one of the two queries:
  • Get project by it's id,
  • Get projects by members.

All those actions can be called directly form a batch file or through an HTTP call to a servlet.

The called servlets (see Servlet detail), depending of HTTP parameters, can directly call the requested action, or call it using a Session bean container.

J2EEDO Application implementation

Database modele overview

This application implements the following data model built on 4 tables:

  • Department
  • Employee
  • Address
  • Project
Here is a visual representation of the j2eedo database schema.

Packages content

The application is made of 7 main java packages:

  • org.objectweb.speedo.j2eedo: contains two JUnit test case classes:

    • TestJ2eedoApplication allows to test the application in standalone mode directly form JUnit.
    • TestJ2eedoJ2ee allows to test the application deployed on a J2EE application server form JUnit.

  • org.objectweb.speedo.j2eedo.bo: contains all business object class handling the data modele.

    • DatabaseImpl is the main class and implements all defined actions. This class defines 3 static vectors used to store known department, employee and project. Those 3 local vectors must decrease the number of access to database object, they are also called the static polls.
      Remark:Those pool contents are update by the Synchronization class PollsSynchronizations each time a department, an employee or a project is added or removed. This task is performed while the current action is commited (when a transaction is required) otherwise, this treatment is done when the current Persistence Manager is closed.
    • PollsSynchronizations defines the Synchronization Object used to update DatabaseImpl's static polls content.
    • DepartmentFactory, EmployeeFactory and ProjectFactory classes define the different treatment on Department, Employee and Project

  • org.objectweb.speedo.j2eedo.common: contains is a tool box, it contains all common class used by the application.

  • org.objectweb.speedo.j2eedo.database: contains all classes to be enhanced used to access to the database content.

  • org.objectweb.speedo.j2eedo.ejb: contains is the EJB session definition.

    • StoreServices implements the interface to perform DatabaseImpl action in a Session Container.

  • org.objectweb.speedo.j2eedo.test: contains all test class use to highlight errors or behaviours.

    • MainLauncher is used for basic test implementation. The developper needs to create a new class extended of this class and writes its own test method doTest().
    • BasicTest executes 20 times all DatabaseImpl actions.
    • ShowConcurrencyErrors allows to highlight some conccurent access deadlocks and issues.

  • org.objectweb.speedo.j2eedo.web: contains the servlets classes' definition.

    • MainServlet executes current request:
      • Gets the Persistence manager when required (false by default),
      • Starts a local transaction when requested (false by default),
      • Calls the dedicated action directly or through a Session Bean Container (direct call by default),
      • Close the PM when initialized at the servlet level.
    • ApplicationServlet is an extended of the former servlet MainServlet. This class implements the two methods used to execute the resquest through a Session Bean or directly from the DataBaseImpl class.
Java Source File NameTypeComment
TestJ2eedoApplication.javaClass This class implements Junit test case.
TestJ2eedoJ2ee.javaClass This class defines junit application tests.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.