Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Examples/Distributed

< EclipseLink‎ | Examples
Revision as of 10:36, 9 February 2011 by Michael.obrien.oracle.com (Talk | contribs) (New page: =Distributed Enterprise Applications using JEE6 API including JPA 2.0, JSF 2.0, JAX-RS 1.1, EJB 3.1 and Servlet 3.0= *This tutorial describes the analysis, design, implementation and deplo...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Distributed Enterprise Applications using JEE6 API including JPA 2.0, JSF 2.0, JAX-RS 1.1, EJB 3.1 and Servlet 3.0

  • This tutorial describes the analysis, design, implementation and deployment of a distributed JEE6 application that makes use of the EJB 3.1, JPA 2.0, JSF 2.0, Servlet 3.0 and JAX-RS API implemented as part of the Oracle GlassFish Server 3.1 distribution. The Java IDE used for this tutorial is the tightly integrated SUN NetBeans 7.0 release that will be in beta until April 2011.

Technology Summary

  • Normally we do not decide on what APIs will be in use before we analyse the requirements. However, here is the list of technologies we are using - as we finalize the implementation.

Problem

  • The Collatz conjecture or (3n + 1) problem is currently not proved. There have been attempts at verifying collatz up to 2^61 - however, massive amounts of scalar processing power is required to do this because the problem is non-linear and therefore must be brute force simulated even with optimizations.
  • The algorithm is as follows for the set of positive integers to infinity.

odd numbers are transformed by 3n + 1 even numbers are divided by 2

  • If you think in base 2, we see that for odd numbers we shift bits to the left, add the number to the result and set bit 0. For even numbers we shift bits to the right. We therefore have a simplified algorithm as follows.
odd: next binary = number << 1 + number + 1 
even: next binary = number >> 1 
  • 'Observation 1: the maximum value remains at or around 2x the number of bits in the start number - at least so far in my own simulations up to 640 billion.
  • We stop iteration and record the max path and max value when the sequence enters the 4-2-1 loop after the first 1 is reached. This sequence must be simulated for all positive integers up to the limit of the software being used. Fortunately, in Java (and .NET3) we can use BigInteger which supports unlimited length integers - as we would quickly overflow using a 64 bit long as soon as we started iterating numbers over 32 bits.
  • Observation 2: I have determined - via a week of simulation distributed among 16 different machines in parallel - that we will need native computation.

Requirements

Analysis

Use Cases

Design

Design Issue 1: Remote RMI/EJB communication

Remote Session Beans on WebLogic 10.3.4.0

Remote Session Beans on GlassFish 3.1

Data Model

  • The following UML class diagram details the data model for the business objects. We will be using JPA entities and mappedsuperclass artifacts.

References

Back to the top