The document discusses seven points for applying Java EE 7:
1. Select a Java EE 7 compliant application server like GlassFish or WildFly. Consider factors like commercial support needs.
2. Use a modern IDE like Eclipse, NetBeans or IntelliJ IDEA to build projects with Maven.
3. Apply JSF for the front-end framework and use Facelets for mark-up.
4. Apply EJBs for the back-end framework to benefit from features like automatic transactions.
5. Consider using RMI-IIOP for heavy transactions or WebSockets for lightweight and faster systems.
6. Apply JPA for database persistence.
7. Consider Java EE 8 for
2. @HirofumiIwasaki #jdt65 2
Speaker Biography
Hirofumi Iwasaki
– Group Manager, Technology Manager
– Financial Service Department, Development Unit,
Rakuten, Inc.
Carrier
– 16 Years of experience in planning, designing and implementation of Japanese financial,
manufacturing and public enterprise system with emphasis in Java EE and .NET enterprise
middleware.
Opus, Lectures, etc.
– Conferences: JavaOne 2014, Oracle OpenWorld 2014, Java Day Tokyo 2014, JJUG CCC
Spring & Fall (2014), WebLogic roundtable (2012-2013), Rakuten Tech Conference (2014,
2013) etc.
– Magazine: @IT (2005-2010), CIO Magazine (2009), IT Architect (2005-2009), Web+DB
Press (2005), Java World (2001-2004), etc.
5. @HirofumiIwasaki #jdt65 5
1. Select the Java EE 7 based application server
2. Use modern IDE to build with Maven instead of text editor
3. Apply JSF for front-end framework
4. Apply EJB for back-end framework
5. Consider remote connectivity
6. Apply JPA for database persistence
7. Consider EE 8 for future-prove
Agenda
7. @HirofumiIwasaki #jdt65 7
GlassFish &
Compatible Group
WebLogic World
Geronimo &
Compatible Group
JBoss World
Japan
Group
App
Engine
Copy
Java EE World and Others
Korea
Group
Apache
Group
Google
8. @HirofumiIwasaki #jdt65 8
Details of Java EE Application Servers
Vendor App Server EE 1.4
(2003-)
EE 5
(2006-)
EE 6
(2009-)
EE 7
(2013-)
Open Source GlassFish - 2.x 3.x 4.x
Oracle WebLogic 9.x 10.x 12.x - (Summer, 2015?)
IBM WebSphere 5.1 6.x, 7.x 8.x - (Summer, 2015?)
Red Hat JBoss 4.x 5.1 7.1 -
Red Hat WildFly - - - 8.0
Fujitsu Interstage 9.0,9.1 9.2,10.x,11.0 11.1 -
Apache Geronimo - 2.x 3.x -
Hitachi Cosminexus 7.x 8.x 9.x 10.0
TmaxSoft JEUS 5.0 6.0 7.0 8.0
Apache TomEE - - 1.x -
Few servers are
available
9. @HirofumiIwasaki #jdt65 9
Commercial or Free?
Is heavily
SLA required?
Is open source
NOT required?
Is some support
required?
Select Commercial Products Select Free Products
Is there few initial
cost limitation?
Is DIY not acceptable?Is long running
upgrading path required?
10. @HirofumiIwasaki #jdt65 10
Summary: Select Your Appropriate Server
Consider the policies for your application,
Determine the roadmap and resources,
Select the appropriate Java EE server.
12. @HirofumiIwasaki #jdt65 12
In 1990’s – early 2000’s
“Great Engineers” never
use such IDEs!
Instead, they use text editor!
*Is Japanese special habit not to use IDEs?
13. @HirofumiIwasaki #jdt65 13
“Great Engineer” never
use such IDEs!
Instead, use text editor!
We’re now living in 2010’s
NEVER
Apply the latest technologies!
*Is Japanese special habit not to use IDEs?
22. @HirofumiIwasaki #jdt65 22
Rich Clients
Web Presentation Business Logic
(no presentations)
Typical usage of Java EE 7
JPA
EJBJSF
DBs
Java FX JTA
Automatic
Transaction
JMS MQ
Connection
RMI-IIOP
Other
Servers
EMail
MTAJavaMail
JAX
Call
Call
Call
Call
Call
Call
Data Access
Messaging
23. @HirofumiIwasaki #jdt65 23
Selection of the front-end frameworks of server side Java
JavaServer Faces
– Genuine Java EE front-end framework
– Many additional components like “PrimeFaces”.
– View-based operation
Apache Struts
– 2000’s older front-end framework (especially 1.x)
– Many results in any industries
– Action-based operations
32. @HirofumiIwasaki #jdt65 32
Summary: Recommendation for the Java EE 7 Front-End
Use For your web front-end,
Apply HTML-Friendly Tags for mark-up.
Implement with Facelet,
37. @HirofumiIwasaki #jdt65 37
Embedded Container
EJB 3 and beyond – Improved dramatically
EJB
1. Introduced Annotations, POJO
@Stateless
EJB
2. Introduced Injections
@Inject
@EJB
Other
Instance
ejb-jar.xml
4. No Deployment Descriptor (optional)
EJB
EJB
5. Embedded EJB Container
for Testing & etc.
JPA
Database
3. Entity Bean JPA
38. @HirofumiIwasaki #jdt65 38
POJO
Java EE ServerJava EE Server
Java Batch
How Design the Batch Logics?
Choice 1: Use EJB,
Call via EJB Remote
from Outside
EJB
Batch
Batch
Kicker Call
Choice 2: Use
Java Batch Framework,
Call from Outside
Batch
Kicker Call
Choice 3: Don’t Use
Java EE Server
[NOT RECOMMENDED]
Batch
Kicker Call
Full automatic transaction,
Able to use embedded server.
If the standard templates
suitable for your app, try it.
Full manual transaction,
management, and everything.
39. @HirofumiIwasaki #jdt65 39
Limitation: Don’t Use Lambda Parallel Stream inside of the EJB
Java EE 7 spec is not supported
Java SE 8 new functions.
Tested Fork/Join Framework
(basement of the parallel stream) with
WebLogic Server 12.1 (yet Java EE 6)
Not worked.
“weblogic.ejb.container.compliance.
ComplianceException”
43. @HirofumiIwasaki #jdt65 43
Supported protocols of Java EE 7 (EJB)
Protocol Supported
From
Annotation Client Stub Value
Marshaling
Global
Transaction
RMI-IIOP J2EE 1.2 @Remote in
remote interface
Remote interface
with auto generate
Auto XA Supported
SOAP Java EE 5 @WebService Auto generate in
development
Auto N/A
REST Java EE 6 @GET, @POST,
etc.
(Nothing special) Work with JSON
or something
(string base)
N/A
Web Socket Java EE 7 @ServerEndpoint @ClientEndpoint
with auto generate
Work with JSON
or something
(string base)
N/A
44. @HirofumiIwasaki #jdt65 44
Global Transaction
Management
with XA Protocol
For heavy transaction: consider RMI-IIOP
EJB
Session BeanClient RMI-IIOP
Other
System’s
EJB
Database
Other
Enterprise
Information
Systems
IIOP
AUTO
BEGIN
AUTO
COMMIT
45. @HirofumiIwasaki #jdt65 45
For light-weight usage: consider Web Socket + JSON
Local Transaction
Management
EJB
Session BeanClient Web Socket
Database
AUTO
BEGIN
AUTO
COMMIT
Ultra-Fast,
Ease of Dev.
46. @HirofumiIwasaki #jdt65 46
EJB Session Bean with RMI-IIOP and Web Socket
@Stateless
@Remote
@ServerEndpoint(value = "/memberlogic")
public class MemberLogic implements MemberLogicRemote {
@OnMessage
public String register(String message, Session session) {
// WRITE TRANSACTIONAL LOGICS HERE!
return xxxx;
}
}
EJB
RMI-IIOP
Web Socket
Some Clients
Transactional
Processing
for RMI-IIOP
for Web Socket
for RMI-IIOP
for Web Socket
47. @HirofumiIwasaki #jdt65 47
Why do not use SOAP or REST?
SOAP REST
The improvements are almost stopped
in both specs and Java EE support.
Heavy auto generating codes.
Buggy interoperability.
Slower marshaling and unmarshaling.
It does not have good support
in Java EE, especially for client-side.
No marshaling and unmarshaling
support in Java EE.
Slower protocol than web socket.
48. @HirofumiIwasaki #jdt65 48
Summary: Recommendation of Protocols
Select the RMI-IIOP
for heavy transactional distributed systems.
Select the Web Socket
for system that requires light-weight and
faster speed.
52. @HirofumiIwasaki #jdt65 52
JPA – Simple Database Mapper
Relational Database
(E-R Diagram)
One by One
JPA Entity
(Class Diagram)
Auto Generate
With Bean Validation
53. @HirofumiIwasaki #jdt65 53
JPA – Simple Database Mapper
JPA Entity
JPA Data Access Object (DAO)
Auto CRUD
to Database
Access to RDB
54. @HirofumiIwasaki #jdt65 54
public List<Member> findMemberByName(String name) {
String queryString = "SELECT a FROM Member m " +
"WHERE m.name = LOWER(:name)";
Query query = getEntityManager().createQuery(queryString);
query.setParameter("name", name);
List<Member> result = query.getResultList();
}
JPA Custom Queries – JPQL and Criteria Query
JPQL:
Criteria Query:
public List<Member> findMemberByName(String name) {
CriteriaBuilder builder = this.em.getCriteriaBuilder();
CriteriaQuery query = builder.createQuery();
Root<Member> member = query.from(Member.class);
query.select(member);
query.where(builder.equal(member.get(”name"), name));
List<Member> result = this.em.createQuery(query).getResultList();
}
55. @HirofumiIwasaki #jdt65 55
JTA Transaction
Management
Java EE Application
EJB Business Logic
Why You Should Not Use Raw JDBC in Java EE?
Java EE Application Server
Java VM
Connection
Pool
EJB Object
Pool
Thread
Pool
Self-Managed
JDBC Connection
JPA
Entity Manager
JNDI
JDBC
Driver Manager
RAW
?
?
No Global Transaction
No Connection Management
56. @HirofumiIwasaki #jdt65 56
Combination with EJB Session Bean
Business Logic
(no presentations)
JPA
EJB
DBs
JTA
Automatic
Transaction
Call
Full automatic
transaction management
with EJB session bean
JPA entity manager
automatically join
the CMT of EJB
Data Access
59. @HirofumiIwasaki #jdt65 59
Beyond of the Java EE 7
CDI 2.0
JSON-B 1.0
JMS 2.1
Servlet4.0
JAX-RS2.1
MVC 1.0
JSF 2.3
Java EE Management API 1.0
JSON-P 1.1
Java EE Security API 1.0
61. @HirofumiIwasaki #jdt65 61
Standardization History of Java EE
J2EE 1.2
J2EE 1.3
J2EE 1.4
Java EE 5
Java EE 6
Java EE 7
Java EE 8
JDBC
EJB/JTA/XA/IIOP
Servlet/JSP
JMS
RMI
SOAP
JPA
JSF/Facelet
REST
CDI
JavaBatch
Project JPE
or earlier
WebSocket
MVC
…
62. @HirofumiIwasaki #jdt65 62
Terminated Technologies of Java EE
J2EE 1.2
J2EE 1.3
J2EE 1.4
Java EE 5
Java EE 6
Java EE 7
Java EE 8
JDBC
EJB
JSP
JMS
RMI
SOAP
JPA
JSF/Facelet
REST
CDI
JavaBatch
Project JPE
or earlier
WebSocket
EJBEntityBean
JSP
MVC
…
63. @HirofumiIwasaki #jdt65 63
Summary
is the world
open specification De-Facto standard.
“Standard” has many
pros & cons, but it can keep
your assets and knowledge.
This is Hirofumi Iwasaki speaking.
I'm a financial system group manager of Rakuten.
And a professional of enterprise financial system management, planning and development.
Then let's see the typical usage of Java EE 6 specs.
Almost all enterprise systems requires data source, and each source type requires suitable framework, JPA, JMS, RMI-IIOP and JAX, and Java Mail. And these data connectivity framework operated transactionaly by EJB.
Finally front-end frameworks like JSF & JavaFX call EJB. These are the basic Java EE structure.
Then let's see the typical usage of Java EE 6 specs.
Almost all enterprise systems requires data source, and each source type requires suitable framework, JPA, JMS, RMI-IIOP and JAX, and Java Mail. And these data connectivity framework operated transactionaly by EJB.
Finally front-end frameworks like JSF & JavaFX call EJB. These are the basic Java EE structure.
Then let's see the typical usage of Java EE 6 specs.
Almost all enterprise systems requires data source, and each source type requires suitable framework, JPA, JMS, RMI-IIOP and JAX, and Java Mail. And these data connectivity framework operated transactionaly by EJB.
Finally front-end frameworks like JSF & JavaFX call EJB. These are the basic Java EE structure.