@HirofumiIwasaki #jdt2016_5A
Java EE 7 for Real Enterprise Systems
実システムのためのJava EE 7
May 24, 2016
Hirofumi Iwasaki
Financial Service Department, DU, Rakuten, Inc.
@HirofumiIwasaki #jdt2016_5A 2
Speaker Biography
 Hirofumi Iwasaki
– Group Manager, Technology Manager
– Financial Service Department, Development Unit, Rakuten, Inc.
 Carrier
– 17 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 2015, 2014, Oracle OpenWorld 2014, Java Day Tokyo
2015, 2014, JJUG CCC Spring & Fall (2014), WebLogic roundtable (2012-
2013), Rakuten Tech Conference 2015 – 2013, etc.
– Book: デベロッパーのキャリアと働き方を語ろうVol.1 (2016)
– Magazine: 日経コンピュータ 2015年8月号 @IT (2005-2010), CIO Magazine
(2009), IT Architect (2005-2009), Web+DB Press (2005), Java World (2001-
2004), etc.
@HirofumiIwasaki #jdt2016_5A 3
On JavaOne 2015
Key Note Speech
Session "Real world batch processing using Java EE"
@HirofumiIwasaki #jdt2016_5A
Consider EE 8 for future-prove
@HirofumiIwasaki #jdt2016_5A
UpdateYour Knowledge
JavaEE 7
For
of
@HirofumiIwasaki #jdt2016_5A 6
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
@HirofumiIwasaki #jdt2016_5A 7
Recommendation
Apply
Standard APIs
@HirofumiIwasaki #jdt2016_5A 8
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
…
@HirofumiIwasaki #jdt2016_5A 9
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
…
Today's
Big Topic 2
EJB to CDI
Today's
Big Topic 1
JSF 2.1  2.2
@HirofumiIwasaki #jdt2016_5A
Java EE 7, For Your Real Systems
@HirofumiIwasaki #jdt2016_5A 11
Basic Strategy for Applying Java EE 7
 Continuous upgrading recommended.
– J2EE 1.2  1.3  1.4  Java EE 5  6  7 (on every two – four years)
– Wait migrations until the application server matured.
 Big jump: huge risk
– Some APIs were already terminated completely.
 EJB Entity Bean (1.1, 2.x)
 Older deployment descriptor (XML files) DTD or XML schema.
– Some Application servers were already terminated or stopped development.
 Silverstream
 Macromedia JRun
 Oracle Application Server (Orion, iAS, OC4J)
 Netscape (iPlanet) Application Server
 JOnAS
 Apache Geronimo
@HirofumiIwasaki #jdt2016_5A
1999 2001 2003 2006 2009 2013
Java EE 7 Servers
J2EE 1.2 Servers
Pre-J2EE Serv
J2EE 1.3 Servers
J2EE 1.4 Servers
Java EE 5 Servers
Java EE 6 Servers
2017?
@HirofumiIwasaki #jdt2016_5A 13
Update Your Systems Based on Java EE 6 to EE 7
 Typical Java EE 6 system configuration (2009 - )
– Oracle WebLogic 12.1, IBM WebSphere 8.x, JBoss 6, 7, other minor products.
– JDK 7  JDK 8 (super small jump).
– No need to migrate, super easy, just try it.
 Web front-end
– JSF 2.1 or Struts 2.x based  JSF 2.2 (jump!)
 From Struts 2, complete rewrite required from action to page.
 From JSF 2.1, apply HTML friendly markups, change backing bean to CDI (see next
chapter for more details)
 Back-end
– EJB 3 session bean  CDI 1.1 (jump!)
 If you use RMI-IIOP (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.
 Almost all codes are usable, but need rewritten using JPA for data persistence.
 Change EJB annotations to CDI annotations. (See more details on next chapter)
– JPA 2.0  JPA 2.1 (super small change)
 Almost no changed.
@HirofumiIwasaki #jdt2016_5A 14
Update Your Systems Based on Java EE 5 to EE 7
 Typical Java EE 5 system configuration (2006 - )
– Oracle WebLogic 10.x, 11, IBM WebSphere 7, JBoss 5.1, other minor products.
– JDK 6  JDK 8 (super small jump).
– Complete EOL, start migration today!
 Web front-end
– JSF 1.2 or Struts 2.x based  JSF 2.2 (jump!)
 From Struts 2, complete rewrite required from action to page.
 From JSF 1.2, apply Facelet instead of JSP, change backing bean to CDI (see next chapter
for more details)
 Back-end
– EJB 3 session bean  CDI 1.1 (jump!)
 If you use RMI-IIOP (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.
 Almost all codes are usable, but need rewritten using JPA for data persistence.
 Change EJB annotations to CDI annotations. (See more details on next chapter)
– JPA 1.0  JPA 2.1 (small jump!)
 Consider apply "PESSIMISTIC_READ" for "FOR UPDATE" SQL locking.
@HirofumiIwasaki #jdt2016_5A 15
Update Your Systems Based on J2EE 1.4 to EE 7
 Typical J2EE 1.4 system configuration (2003 - )
– BEA WebLogic 8.1, 9, IBM WebSphere 5.1, 6.x, JBoss 4.3, other minor products.
– JDK 1.4  JDK 8 (big jump!) , apply annotations.
– Complete EOL, start migration today!
 Web front-end
– Struts 1.x based  JSF 2.2 (big jump!)
 Complete rewrite required.
 Back-end
– EJB 2.1 session bean or Spring framework 1.x  CDI 1.1 (big jump!)
 If you use RMI-IIOP (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.
 Almost all codes are usable, but need rewritten using JPA for data persistence.
 ejb-jar.xml or applicationContext.xml  CDI annotations, remove home interface, etc.
– EJB 2.1 entity bean (CMP) or Hibernate 2.x, 3.x  JPA 2.1 (big jump from EJB!)
 Regenerate from RDB as "Entity" completely.
 From EJB, ejb-jar.xml  persistence.xml, EJB home interface  entity manager, etc.
 From Hibernate, small changes.
@HirofumiIwasaki #jdt2016_5A 16
Update Your Systems Based on J2EE 1.3 to EE 7
 Typical J2EE 1.3 system configuration (2001 - )
– BEA WebLogic 7.0, IBM WebSphere 5.0, other minor products.
– JDK 1.3, 1.4  JDK 8 (big jump!) , apply annotations.
– Complete EOL, start migration today!
 Web front-end
– Struts 1.x based  JSF 2.2 (big jump!)
 Complete rewrite required.
 Back-end
– EJB 2.0 session bean  CDI 1.1 (big jump!)
 If you use RMI-IIOP (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.
 Almost all codes are usable, but need rewritten using JPA for data persistence.
 ejb-jar.xml  CDI annotations, remove home & remote interface, etc.
– EJB 2.0 entity bean (CMP)  JPA 2.1 (big jump!)
 Regenerate from RDB as "Entity" completely.
 ejb-jar.xml  persistence.xml, change home interface to DAO.
 EJB home interface  entity manager, etc.
@HirofumiIwasaki #jdt2016_5A 17
Update Your Systems Based on J2EE 1.2 to EE 7
 Typical J2EE 1.2 system configuration (1999 - )
– BEA WebLogic 5.1, 6.0, 6.1, IBM WebSphere 4.0, other minor products.
– JDK 1.1, 1.2, 1.3  JDK 8 (big jump!) , apply collection framework, annotations.
– Complete EOL, start migration today!
 Web front-end
– Struts 1.x based  JSF 2.2 (big jump!)
 Complete rewrite required.
 Back-end
– EJB 1.1 session bean  CDI 1.1 (big jump!)
 If you use RMI-IIOP (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.
 Almost all codes are usable, but need rewritten using JPA for data persistence.
 ejb-jar.xml  CDI annotations, remove home & remote interface, etc.
– EJB 1.1 entity bean (CMP)  JPA 2.1 (big jump!)
 Regenerate from RDB as "Entity" completely.
 ejb-jar.xml  persistence.xml, change home interface to DAO.
 EJB home interface  entity manager, etc.
@HirofumiIwasaki #jdt2016_5A 18
Update Your Systems Based on pre-J2EE Era to EE 7
 Typical pre-J2EE 1.2 system configuration (1997 - )
– WebLogic Tengah 3.0, 4.51, Netscape Application Server (Kiva), IBM WebSphere 3.5,
Apache HTTPD + Apache JServ, other minor products.
– JDK 1.1  JDK 8 (super big jump!), apply collection framework, annotations.
– Perfect EOL, start migration today!
 Web front-end
– WebLogic JHTML, Netscape Application Builder (NAB)-based, JavaSoft Servlet 2.0, etc.
 JSF 2.2 (ultra big jump!)
 Complete rewrite required.
 Back-end
– WebLogic EJB, EJB 1.0 session bean  CDI 1.1 (big jump!)
 If you use T3 (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.
 Almost all codes are usable, but need rewritten using JPA for data persistence.
 Deployment descriptor (prop)  CDI annotations, etc.
– WebLogic EJB, EJB 1.0 entity bean  JPA 2.1 (ultra big jump!)
 Regenerate from RDB completely.
 Deployment descriptor (prop)  persistence.xml
 EJB home interface  EntityManager, etc.
WebLogic EJB DD
@HirofumiIwasaki #jdt2016_5A
Web Front-End: JSF 2.1  2.2 for EE 7
@HirofumiIwasaki #jdt2016_5A 20
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
@HirofumiIwasaki #jdt2016_5A 21
<Facelet>
View 1
Backing1
- fields
+ load()
+ action()
<Facelet>
View 2
Backing2
- fields
+ load()
+ action()
<Facelet>
View 3
Backing3
- fields
+ load()
+ action()
Front View
&
Backing Bean
Almost no changed in big
architecture view
in EE 6 (JSF 2.1) to EE 7 (JSF 2.2).
@HirofumiIwasaki #jdt2016_5A 22
<Facelet>
View 1
Backing1
- fields
+ load()
+ action()
Front View
&
Backing Bean
Two big changes:
1. HTML friendly markup in Facelet
2. JSF backing bean to CDI
1. HTML friendly markup
<h:xxxxxx> JSF special element to
normal HTML elements.
2. JSF original backing bean to
normal CDI.
@HirofumiIwasaki #jdt2016_5A 23
HTML Friendly Markups
<input type="text”
jsf:value="#{bean.property}" />
Java EE 7 (JSF 2.2)
Java EE 6 (JSF 2.1)
Simplified
<input type="text"
jsfc="h:inputText"
name="id"
value="#{bean.property}" />
Nice Relationship
with HTML
Design Tools
@HirofumiIwasaki #jdt2016_5A 24
HTML Friendly Markups
HTML JSF 2.2 HTML Friendly Tags Older JSF Tags
<a> <a jsf:action=“#{cdi.prop}”>~~~</a> <h:commandLink>
<input
type=“button”>
<input
type=“submit”>
<input type=“button” jsf:value=“#{cdi.prop}”/>
<input type=“submit” jsf:value=“#{cdi.prop}”/>
<h:commandButton>
<input type=“file”> <input type=“file” jsf:value=“#{cdi.prop}”/> <h:inputFile>
<input
type=“hidden”>
<input type=“hidden” jsf:value=“#{cdi.prop}”/> <h:inputHidden>
<input
type=“password”>
<input type=“password” jsf:value=“#{cdi.prop}”/> <h:inputSecret>
<textarea> <textarea jsf:value=“#{cdi.prop}”/> <h:inputTextArea>
<input
type=“checkbox”>
<input type=“checkbox” jsf:value=“#{cdi.prop}”/> <h:selectBooleanCheck
box>・・・
etc.
@HirofumiIwasaki #jdt2016_5A 25
Java EE 6: Cannot Access from Outside to JSF Managed Bean
Filter
Faces
Servlet
Phase
Listeners
Facelet
Facelet
Facelet
@View
Scoped
@View
Scoped
@View
Scoped
Managed
Bean
@Session
Scoped
Java EE 6 (JSF 2.1)
JSF Managed Bean
World
Cannot Access!
@HirofumiIwasaki #jdt2016_5A 26
Java EE 6: Cannot Use ViewScoped CDIs, or Use JSF Backing Bean
Filter
Faces
Servlet
Phase
Listeners
Facelet
Facelet
Facelet
CDI
don't have
@View
Scoped
CDI
don't have
@View
Scoped
CDI
don't have
@View
ScopedManaged
Bean
@Session
Scoped
Java EE 6 (JSF 2.1)
CDI World
OK!
Cannot Use "View Scoped"
@HirofumiIwasaki #jdt2016_5A 27
Java EE 7: All Integrated CDI with JSF
Filter
Faces
Servlet
Phase
Listeners
Facelet
Facelet
Facelet
New CDI
@View
Scoped
New CDI
@View
Scoped
New CDI
@View
Scoped
CDI
@Session
Scoped
Java EE 7 (JSF 2.2)
CDI WorldOK!
OK!
Perfect!
@HirofumiIwasaki #jdt2016_5A 28
Consideration Points for Applying CDI in JSF Backing Bean
 Now CDI can be accessible on Filter.
– Consider applying @ApplicationScoped, @SessionScoped for some hacking techs.
 Migration from raw static objects to @ApplicationScoped CDI bean
– For easy management especially for controlling initialization timing.
 Migration from raw HttpSession to @SessionScoped CDI bean
– Don't use both HttpSession and @SessionScoped for avoiding confusing on production.
– Apply @SessionScoped only for managing session data.
 Migration from JSF management bean @ViewScoped to CDI @ViewScoped
– Same name but in different package (javax.faces.view.ViewScoped)
– Just change the package import from javax.faces.bean.ViewScoped.
28
@HirofumiIwasaki #jdt2016_5A 29
Summary: Recommendation for the Java EE 7 Front-End
Use For your web front-end,
Apply HTML-Friendly Markups.
Implement with Facelet,
@HirofumiIwasaki #jdt2016_5A
Back-End: EJB to CDI for future prove
@HirofumiIwasaki #jdt2016_5A 31
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
@HirofumiIwasaki #jdt2016_5A 32
Java EE 6: What’s EJB? Why EJB? – The Core of Java EE
EJBClient
1. Remote Invocation
EJB
2. Automatic Transaction Management
Database
(BEGIN)
(COMMIT)
EJB
EJB
EJB
EJB
Instance
Pool
Activate
3. Instance Pooling for Faster Operation
RMI-IIOP
SOAP
REST
Web Socket
EJB
Client
4. Security Management
@HirofumiIwasaki #jdt2016_5A 33
Embedded Container
Java EE 6: 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
@HirofumiIwasaki #jdt2016_5A 34
On Java EE 8 and Beyond: EJB to CDI
 Why EJB should go out?
1. Super old implementation in each Java
EE compliant application server.
2. Old-style pre-compile required, need
much time to deploy.
3. Ultra tight related with EJB container,
difficult to test easily (although using EJB
embedded server).
4. Decreasing RMI-IIOP (T3) protocol users,
less compliant with CORBA specs.
5. Duplicated specification with latest CDI
with directly supported automatic
transaction with JTA specifications.
Good-bye
guys…
@HirofumiIwasaki #jdt2016_5A 35
Java EE 7 - EJB to CDI: Supporting half functions
EJB
↓
CDI
Client
1. Remote Invocation
EJB
↓
CDI
2. Automatic Transaction Management
Database
(BEGIN)
(COMMIT)
EJB
EJB
EJB
EJB
Instance
Pool
Activate
3. Instance Pooling for Faster Operation
RMI-IIOP
SOAP
REST
Web Socket
EJB
Client
4. Security Management
Not
supported Not
supported
@HirofumiIwasaki #jdt2016_5A 36
Supported protocols of Java EE 7 in CDI
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
@HirofumiIwasaki #jdt2016_5A 37
NOT SUPPORTED:
Global Transaction
Management
with XA Protocol
Java EE 7 - Limitation of CDI: RMI-IIOP with XA is not supported
CDI
Client REST, Web Socket
Other
System’s
EJB
Database
Other
Enterprise
Information
Systems
IIOP
AUTO
BEGIN
AUTO
COMMIT
Not
supported
Not
supported
@HirofumiIwasaki #jdt2016_5A 38
EE7 - Limitation of CDI: For light-weight usage, or simplified architecture
Local Transaction
Management
CDI
Client REST, Web Socket
Database
AUTO
BEGIN
AUTO
COMMIT
Enough for almost small architecture.
Other
System
REST
* No XA
@HirofumiIwasaki #jdt2016_5A
How to convert EJB to CDI
For From (EJB) To (CDI)
Declaration @Stateless @Dependent
@Transactional
Injection @EJB @Inject
Transaction control @TransactionAttibute
(TransactionAttibuteType
.REQUIRES_NEW)
@Transactional
(Transactional.TxType
.REQUIRES_NEW)
Self transaction
management
@TransactionManagement(
TransactionManagementType.BEAN)
(delete)
Transaction rollback @ApplicationException(
rollback = true)
@Transactional(
rollbackOn = Exception.class)
Remote protocol @WebServices,
@GET or @POST,
@ServerEndpoint, or
@Remote in remote interface,
@WebServices,
@GET, @POST or
@ServerEndpoint
@HirofumiIwasaki #jdt2016_5A
EJB to CDI Code – Super Simple Case
40
From (EJB CMT Session Bean) To (CDI)
And delete ejb-jar.xml (and weblogic-ejb-jar.xml etc.),
@HirofumiIwasaki #jdt2016_5A 41
Consideration Points for Applying CDI
 Merging JSF backing bean (CDI) view with business logics (CDI)
– Logically acceptable, but some difficulty for managing.
 Difficult to visualize transaction boundary with @Transactional.
 Super tight relationship between view and logics - Less code reusability.
– Not recommended for enterprise production, just apply for quick prototyping only.
 Incompatible points
– RMI-IIOP (or T3) with XA (global transaction)
 Keep using EJB remote interface on communication point only.
 Plan to change other lightweight protocol like REST+JSON.
– EJB Timer
 Change other products like job scheduler like IBM Tiboli, HITACHI JP1, etc.
– Asynchronous operations (@Asynchronous, or EJB Message-Driven bean with JMS)
 Wait next CDI spec (on EE 8), or keep using EJB.
41
@HirofumiIwasaki #jdt2016_5A 42
Summary: EJB to CDI
Apply simplified architecture,
use CDI with JTA automatic transaction
management.
Migrate EJB to CDI as applying easy replacement
rules.
Recognize incompatible points,
check EE 8 spec candidate,
design your next app.
@HirofumiIwasaki #jdt2016_5A 43
Summary
is the world
open specification De-Facto standard.
“Standard” has many
pros & cons, but it can keep
your assets and knowledge.
@HirofumiIwasaki #jdt2016_5A
Java EE has
many world-wide
people and company support.
your application will have
long-life guaranteed.
@HirofumiIwasaki #jdt2016_5A
Apply Java EE 7
today and
be
ready for EE 8.
@HirofumiIwasaki #jdt2016_5A

More Related Content

PPTX
Future of Java EE with Java SE 8
PDF
Whats New In Java Ee 6
PDF
What's new in Java EE 6
PPTX
Top 50 java ee 7 best practices [con5669]
PDF
50 New Features of Java EE 7 in 50 minutes
PDF
Fifty Features of Java EE 7 in 50 Minutes
PDF
Java EE 7 - Overview and Status
PPT
Java & J2EE Struts with Hibernate Framework
Future of Java EE with Java SE 8
Whats New In Java Ee 6
What's new in Java EE 6
Top 50 java ee 7 best practices [con5669]
50 New Features of Java EE 7 in 50 minutes
Fifty Features of Java EE 7 in 50 Minutes
Java EE 7 - Overview and Status
Java & J2EE Struts with Hibernate Framework

What's hot (20)

PDF
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
PDF
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
PDF
JavaOne 2011: Migrating Spring Applications to Java EE 6
PDF
Running your Java EE applications in the Cloud
PDF
Java 9 / Jigsaw - LJC / VJUG session (hackday session)
PDF
Understanding
PDF
Java interview questions
PPT
Have You Seen Java EE Lately?
PDF
Bea weblogic job_interview_preparation_guide
PDF
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
PDF
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
DOCX
Java 7 Dolphin manjula kollipara
ODP
Javaee6 Overview
PDF
Glass Fishv3 March2010
PDF
Java 7 Modularity: a View from the Gallery
PDF
Java 9 / Jigsaw - AJUG/VJUG session
PDF
Android and the Seven Dwarfs from Devox'15
PPT
Java interview-questions-and-answers
PPTX
HotSpotコトハジメ
DOCX
Hibernate3 q&a
OSGi-enabled Java EE Applications using GlassFish at JCertif 2011
The Java EE 7 Platform: Productivity &amp; HTML5 at San Francisco JUG
JavaOne 2011: Migrating Spring Applications to Java EE 6
Running your Java EE applications in the Cloud
Java 9 / Jigsaw - LJC / VJUG session (hackday session)
Understanding
Java interview questions
Have You Seen Java EE Lately?
Bea weblogic job_interview_preparation_guide
Arun Gupta: London Java Community: Java EE 6 and GlassFish 3
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java 7 Dolphin manjula kollipara
Javaee6 Overview
Glass Fishv3 March2010
Java 7 Modularity: a View from the Gallery
Java 9 / Jigsaw - AJUG/VJUG session
Android and the Seven Dwarfs from Devox'15
Java interview-questions-and-answers
HotSpotコトハジメ
Hibernate3 q&a
Ad

Viewers also liked (20)

PDF
JetBrains IDEハンズオン
PDF
JBoss.org – SwitchYardコミュニティ開発者の日常 - JJUG CCC 2014 Spring - R1-4 - #ccc_r14
PPTX
Seven Points for Applying Java EE 7
PDF
CDI2.0アップデート&クックブック #JavaDayTokyo #jdt2016_4c
PDF
Java Küche 2016 LT 在室状況自動通知ボット #JavaKueche
PDF
What's New in Java SE 9
PPTX
JavaOne2015報告会 Java EE アップデート #j1jp
PPT
Java EE Introduction
PDF
複雑さに挑む!カンバンによるプロジェクト マネジメント
PPTX
プレゼン基礎講座 2016.11
PDF
JavaOne 2016 - Photo Edition -
PDF
これまでのJava これからのJava
PDF
PDF
Java EE 8 - An instant snapshot
PPT
Java EE 7 (Hamed Hatami)
PDF
Java EE 6 & GlassFish 3
PDF
Java in the Past, Java in the Future
PPTX
Java EE 6 Adoption in One of the World's Largest Online Financial Systems (fo...
PPTX
Future of Java EE with SE 8 (revised)
PDF
Dependency Injection with CDI in 15 minutes
JetBrains IDEハンズオン
JBoss.org – SwitchYardコミュニティ開発者の日常 - JJUG CCC 2014 Spring - R1-4 - #ccc_r14
Seven Points for Applying Java EE 7
CDI2.0アップデート&クックブック #JavaDayTokyo #jdt2016_4c
Java Küche 2016 LT 在室状況自動通知ボット #JavaKueche
What's New in Java SE 9
JavaOne2015報告会 Java EE アップデート #j1jp
Java EE Introduction
複雑さに挑む!カンバンによるプロジェクト マネジメント
プレゼン基礎講座 2016.11
JavaOne 2016 - Photo Edition -
これまでのJava これからのJava
Java EE 8 - An instant snapshot
Java EE 7 (Hamed Hatami)
Java EE 6 & GlassFish 3
Java in the Past, Java in the Future
Java EE 6 Adoption in One of the World's Largest Online Financial Systems (fo...
Future of Java EE with SE 8 (revised)
Dependency Injection with CDI in 15 minutes
Ad

Similar to Java EE 7 for Real Enterprise Systems (20)

PPTX
Move from J2EE to Java EE
PDF
Huge Enterprise Systems Architecture Design with Java EE
PPTX
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
PDF
The Java Ee 6 Platform Normandy Jug
PPT
JDO Presentation given at Java User Group Switzerland (JUGS) on 31.03.05
PDF
Java EE 6 workshop at Dallas Tech Fest 2011
PDF
Retour JavaOne 2009
PDF
MicroProfile and Jakarta EE - What's Next?
PDF
Case Study of Financial Web System Development and Operations with Oracle Web...
PDF
NLOUG 2018 - Future of JSF and ADF
PDF
Case Study of Financial Web System Development and Operations with Oracle Web...
PDF
Powering the Next Generation Services with Java Platform - Spark IT 2010
PDF
Application Architecture Trends
PDF
The Java alternative to Javascript
PDF
The Magnificent java EE 7 in Wildfly-O-Rama
PPTX
J2EE Struts with Hibernate Framework
PPT
Jsf 2.0 Overview
PDF
Java one 2015 [con3339]
PDF
Java EE 6 Aquarium Paris
PDF
Web Applications of the future: Combining JEE6 & JavaFX
Move from J2EE to Java EE
Huge Enterprise Systems Architecture Design with Java EE
[RakutenTechConf2013] [E-3] Financial Web System with Java EE 6
The Java Ee 6 Platform Normandy Jug
JDO Presentation given at Java User Group Switzerland (JUGS) on 31.03.05
Java EE 6 workshop at Dallas Tech Fest 2011
Retour JavaOne 2009
MicroProfile and Jakarta EE - What's Next?
Case Study of Financial Web System Development and Operations with Oracle Web...
NLOUG 2018 - Future of JSF and ADF
Case Study of Financial Web System Development and Operations with Oracle Web...
Powering the Next Generation Services with Java Platform - Spark IT 2010
Application Architecture Trends
The Java alternative to Javascript
The Magnificent java EE 7 in Wildfly-O-Rama
J2EE Struts with Hibernate Framework
Jsf 2.0 Overview
Java one 2015 [con3339]
Java EE 6 Aquarium Paris
Web Applications of the future: Combining JEE6 & JavaFX

More from Hirofumi Iwasaki (9)

PPTX
MicroProfileの正しい使い方 (Java Developer Summit 2023)
PPTX
MicroProfile 5で超手軽に始める今どきのクラウド完全対応エンタープライズシステム
PDF
Jakarta EEとMicroprofileの上手な付き合い方と使い方 - JakartaOne Livestream Japan 2020
PPTX
Jakarta EE + MicroProfile との付き合い方
PPTX
45分で作る Java EE 8 システム
PPTX
Java EE 7 with Apache Spark for the World’s Largest Credit Card Core Systems ...
PPTX
Case Study: Credit Card Core System with Exalogic, Exadata, Oracle Cloud Mach...
PDF
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems [Ja...
PPTX
Java EE 7技術アップデート & 逆引き JSF 2.2
MicroProfileの正しい使い方 (Java Developer Summit 2023)
MicroProfile 5で超手軽に始める今どきのクラウド完全対応エンタープライズシステム
Jakarta EEとMicroprofileの上手な付き合い方と使い方 - JakartaOne Livestream Japan 2020
Jakarta EE + MicroProfile との付き合い方
45分で作る Java EE 8 システム
Java EE 7 with Apache Spark for the World’s Largest Credit Card Core Systems ...
Case Study: Credit Card Core System with Exalogic, Exadata, Oracle Cloud Mach...
Java EE 6 Adoption in One of the World’s Largest Online Financial Systems [Ja...
Java EE 7技術アップデート & 逆引き JSF 2.2

Recently uploaded (20)

PDF
IDM Crack Activation Key 2025 Free Download
PPT
ch03 data adnd signals- data communications and networks ppt
PDF
How to Set Realistic Project Milestones and Deadlines
PPTX
Greedy best-first search algorithm always selects the path which appears best...
PPTX
Presentation - Summer Internship at Samatrix.io_template_2.pptx
PDF
OpenTimelineIO Virtual Town Hall - August 2025
PDF
DOWNLOAD—IOBit Uninstaller Pro Crack Download Free
PDF
MaterialX Virtual Town Hall - August 2025
PDF
solman-7.0-ehp1-sp21-incident-management
PDF
Enscape 3D Crack + With 2025 Activation Key free
PDF
KidsTale AI Review - Create Magical Kids’ Story Videos in 2 Minutes.pdf
PDF
Difference Between Website and Web Application.pdf
PPTX
oracle_ebs_12.2_project_cutoveroutage.pptx
PPTX
Beige and Black Minimalist Project Deck Presentation (1).pptx
PDF
IObit Driver Booster Pro Crack Latest Version Download
PDF
OpenAssetIO Virtual Town Hall - August 2025.pdf
PPTX
opentower introduction and the digital twin
PDF
10 Mistakes Agile Project Managers Still Make
PPTX
Hexagone difital twin solution in the desgining
PDF
OpenEXR Virtual Town Hall - August 2025
IDM Crack Activation Key 2025 Free Download
ch03 data adnd signals- data communications and networks ppt
How to Set Realistic Project Milestones and Deadlines
Greedy best-first search algorithm always selects the path which appears best...
Presentation - Summer Internship at Samatrix.io_template_2.pptx
OpenTimelineIO Virtual Town Hall - August 2025
DOWNLOAD—IOBit Uninstaller Pro Crack Download Free
MaterialX Virtual Town Hall - August 2025
solman-7.0-ehp1-sp21-incident-management
Enscape 3D Crack + With 2025 Activation Key free
KidsTale AI Review - Create Magical Kids’ Story Videos in 2 Minutes.pdf
Difference Between Website and Web Application.pdf
oracle_ebs_12.2_project_cutoveroutage.pptx
Beige and Black Minimalist Project Deck Presentation (1).pptx
IObit Driver Booster Pro Crack Latest Version Download
OpenAssetIO Virtual Town Hall - August 2025.pdf
opentower introduction and the digital twin
10 Mistakes Agile Project Managers Still Make
Hexagone difital twin solution in the desgining
OpenEXR Virtual Town Hall - August 2025

Java EE 7 for Real Enterprise Systems

  • 1. @HirofumiIwasaki #jdt2016_5A Java EE 7 for Real Enterprise Systems 実システムのためのJava EE 7 May 24, 2016 Hirofumi Iwasaki Financial Service Department, DU, Rakuten, Inc.
  • 2. @HirofumiIwasaki #jdt2016_5A 2 Speaker Biography  Hirofumi Iwasaki – Group Manager, Technology Manager – Financial Service Department, Development Unit, Rakuten, Inc.  Carrier – 17 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 2015, 2014, Oracle OpenWorld 2014, Java Day Tokyo 2015, 2014, JJUG CCC Spring & Fall (2014), WebLogic roundtable (2012- 2013), Rakuten Tech Conference 2015 – 2013, etc. – Book: デベロッパーのキャリアと働き方を語ろうVol.1 (2016) – Magazine: 日経コンピュータ 2015年8月号 @IT (2005-2010), CIO Magazine (2009), IT Architect (2005-2009), Web+DB Press (2005), Java World (2001- 2004), etc.
  • 3. @HirofumiIwasaki #jdt2016_5A 3 On JavaOne 2015 Key Note Speech Session "Real world batch processing using Java EE"
  • 6. @HirofumiIwasaki #jdt2016_5A 6 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
  • 8. @HirofumiIwasaki #jdt2016_5A 8 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 …
  • 9. @HirofumiIwasaki #jdt2016_5A 9 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 … Today's Big Topic 2 EJB to CDI Today's Big Topic 1 JSF 2.1  2.2
  • 10. @HirofumiIwasaki #jdt2016_5A Java EE 7, For Your Real Systems
  • 11. @HirofumiIwasaki #jdt2016_5A 11 Basic Strategy for Applying Java EE 7  Continuous upgrading recommended. – J2EE 1.2  1.3  1.4  Java EE 5  6  7 (on every two – four years) – Wait migrations until the application server matured.  Big jump: huge risk – Some APIs were already terminated completely.  EJB Entity Bean (1.1, 2.x)  Older deployment descriptor (XML files) DTD or XML schema. – Some Application servers were already terminated or stopped development.  Silverstream  Macromedia JRun  Oracle Application Server (Orion, iAS, OC4J)  Netscape (iPlanet) Application Server  JOnAS  Apache Geronimo
  • 12. @HirofumiIwasaki #jdt2016_5A 1999 2001 2003 2006 2009 2013 Java EE 7 Servers J2EE 1.2 Servers Pre-J2EE Serv J2EE 1.3 Servers J2EE 1.4 Servers Java EE 5 Servers Java EE 6 Servers 2017?
  • 13. @HirofumiIwasaki #jdt2016_5A 13 Update Your Systems Based on Java EE 6 to EE 7  Typical Java EE 6 system configuration (2009 - ) – Oracle WebLogic 12.1, IBM WebSphere 8.x, JBoss 6, 7, other minor products. – JDK 7  JDK 8 (super small jump). – No need to migrate, super easy, just try it.  Web front-end – JSF 2.1 or Struts 2.x based  JSF 2.2 (jump!)  From Struts 2, complete rewrite required from action to page.  From JSF 2.1, apply HTML friendly markups, change backing bean to CDI (see next chapter for more details)  Back-end – EJB 3 session bean  CDI 1.1 (jump!)  If you use RMI-IIOP (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.  Almost all codes are usable, but need rewritten using JPA for data persistence.  Change EJB annotations to CDI annotations. (See more details on next chapter) – JPA 2.0  JPA 2.1 (super small change)  Almost no changed.
  • 14. @HirofumiIwasaki #jdt2016_5A 14 Update Your Systems Based on Java EE 5 to EE 7  Typical Java EE 5 system configuration (2006 - ) – Oracle WebLogic 10.x, 11, IBM WebSphere 7, JBoss 5.1, other minor products. – JDK 6  JDK 8 (super small jump). – Complete EOL, start migration today!  Web front-end – JSF 1.2 or Struts 2.x based  JSF 2.2 (jump!)  From Struts 2, complete rewrite required from action to page.  From JSF 1.2, apply Facelet instead of JSP, change backing bean to CDI (see next chapter for more details)  Back-end – EJB 3 session bean  CDI 1.1 (jump!)  If you use RMI-IIOP (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.  Almost all codes are usable, but need rewritten using JPA for data persistence.  Change EJB annotations to CDI annotations. (See more details on next chapter) – JPA 1.0  JPA 2.1 (small jump!)  Consider apply "PESSIMISTIC_READ" for "FOR UPDATE" SQL locking.
  • 15. @HirofumiIwasaki #jdt2016_5A 15 Update Your Systems Based on J2EE 1.4 to EE 7  Typical J2EE 1.4 system configuration (2003 - ) – BEA WebLogic 8.1, 9, IBM WebSphere 5.1, 6.x, JBoss 4.3, other minor products. – JDK 1.4  JDK 8 (big jump!) , apply annotations. – Complete EOL, start migration today!  Web front-end – Struts 1.x based  JSF 2.2 (big jump!)  Complete rewrite required.  Back-end – EJB 2.1 session bean or Spring framework 1.x  CDI 1.1 (big jump!)  If you use RMI-IIOP (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.  Almost all codes are usable, but need rewritten using JPA for data persistence.  ejb-jar.xml or applicationContext.xml  CDI annotations, remove home interface, etc. – EJB 2.1 entity bean (CMP) or Hibernate 2.x, 3.x  JPA 2.1 (big jump from EJB!)  Regenerate from RDB as "Entity" completely.  From EJB, ejb-jar.xml  persistence.xml, EJB home interface  entity manager, etc.  From Hibernate, small changes.
  • 16. @HirofumiIwasaki #jdt2016_5A 16 Update Your Systems Based on J2EE 1.3 to EE 7  Typical J2EE 1.3 system configuration (2001 - ) – BEA WebLogic 7.0, IBM WebSphere 5.0, other minor products. – JDK 1.3, 1.4  JDK 8 (big jump!) , apply annotations. – Complete EOL, start migration today!  Web front-end – Struts 1.x based  JSF 2.2 (big jump!)  Complete rewrite required.  Back-end – EJB 2.0 session bean  CDI 1.1 (big jump!)  If you use RMI-IIOP (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.  Almost all codes are usable, but need rewritten using JPA for data persistence.  ejb-jar.xml  CDI annotations, remove home & remote interface, etc. – EJB 2.0 entity bean (CMP)  JPA 2.1 (big jump!)  Regenerate from RDB as "Entity" completely.  ejb-jar.xml  persistence.xml, change home interface to DAO.  EJB home interface  entity manager, etc.
  • 17. @HirofumiIwasaki #jdt2016_5A 17 Update Your Systems Based on J2EE 1.2 to EE 7  Typical J2EE 1.2 system configuration (1999 - ) – BEA WebLogic 5.1, 6.0, 6.1, IBM WebSphere 4.0, other minor products. – JDK 1.1, 1.2, 1.3  JDK 8 (big jump!) , apply collection framework, annotations. – Complete EOL, start migration today!  Web front-end – Struts 1.x based  JSF 2.2 (big jump!)  Complete rewrite required.  Back-end – EJB 1.1 session bean  CDI 1.1 (big jump!)  If you use RMI-IIOP (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.  Almost all codes are usable, but need rewritten using JPA for data persistence.  ejb-jar.xml  CDI annotations, remove home & remote interface, etc. – EJB 1.1 entity bean (CMP)  JPA 2.1 (big jump!)  Regenerate from RDB as "Entity" completely.  ejb-jar.xml  persistence.xml, change home interface to DAO.  EJB home interface  entity manager, etc.
  • 18. @HirofumiIwasaki #jdt2016_5A 18 Update Your Systems Based on pre-J2EE Era to EE 7  Typical pre-J2EE 1.2 system configuration (1997 - ) – WebLogic Tengah 3.0, 4.51, Netscape Application Server (Kiva), IBM WebSphere 3.5, Apache HTTPD + Apache JServ, other minor products. – JDK 1.1  JDK 8 (super big jump!), apply collection framework, annotations. – Perfect EOL, start migration today!  Web front-end – WebLogic JHTML, Netscape Application Builder (NAB)-based, JavaSoft Servlet 2.0, etc.  JSF 2.2 (ultra big jump!)  Complete rewrite required.  Back-end – WebLogic EJB, EJB 1.0 session bean  CDI 1.1 (big jump!)  If you use T3 (with XA) for remote connection, consider apply EJB 3.2 instead of CDI.  Almost all codes are usable, but need rewritten using JPA for data persistence.  Deployment descriptor (prop)  CDI annotations, etc. – WebLogic EJB, EJB 1.0 entity bean  JPA 2.1 (ultra big jump!)  Regenerate from RDB completely.  Deployment descriptor (prop)  persistence.xml  EJB home interface  EntityManager, etc. WebLogic EJB DD
  • 20. @HirofumiIwasaki #jdt2016_5A 20 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
  • 21. @HirofumiIwasaki #jdt2016_5A 21 <Facelet> View 1 Backing1 - fields + load() + action() <Facelet> View 2 Backing2 - fields + load() + action() <Facelet> View 3 Backing3 - fields + load() + action() Front View & Backing Bean Almost no changed in big architecture view in EE 6 (JSF 2.1) to EE 7 (JSF 2.2).
  • 22. @HirofumiIwasaki #jdt2016_5A 22 <Facelet> View 1 Backing1 - fields + load() + action() Front View & Backing Bean Two big changes: 1. HTML friendly markup in Facelet 2. JSF backing bean to CDI 1. HTML friendly markup <h:xxxxxx> JSF special element to normal HTML elements. 2. JSF original backing bean to normal CDI.
  • 23. @HirofumiIwasaki #jdt2016_5A 23 HTML Friendly Markups <input type="text” jsf:value="#{bean.property}" /> Java EE 7 (JSF 2.2) Java EE 6 (JSF 2.1) Simplified <input type="text" jsfc="h:inputText" name="id" value="#{bean.property}" /> Nice Relationship with HTML Design Tools
  • 24. @HirofumiIwasaki #jdt2016_5A 24 HTML Friendly Markups HTML JSF 2.2 HTML Friendly Tags Older JSF Tags <a> <a jsf:action=“#{cdi.prop}”>~~~</a> <h:commandLink> <input type=“button”> <input type=“submit”> <input type=“button” jsf:value=“#{cdi.prop}”/> <input type=“submit” jsf:value=“#{cdi.prop}”/> <h:commandButton> <input type=“file”> <input type=“file” jsf:value=“#{cdi.prop}”/> <h:inputFile> <input type=“hidden”> <input type=“hidden” jsf:value=“#{cdi.prop}”/> <h:inputHidden> <input type=“password”> <input type=“password” jsf:value=“#{cdi.prop}”/> <h:inputSecret> <textarea> <textarea jsf:value=“#{cdi.prop}”/> <h:inputTextArea> <input type=“checkbox”> <input type=“checkbox” jsf:value=“#{cdi.prop}”/> <h:selectBooleanCheck box>・・・ etc.
  • 25. @HirofumiIwasaki #jdt2016_5A 25 Java EE 6: Cannot Access from Outside to JSF Managed Bean Filter Faces Servlet Phase Listeners Facelet Facelet Facelet @View Scoped @View Scoped @View Scoped Managed Bean @Session Scoped Java EE 6 (JSF 2.1) JSF Managed Bean World Cannot Access!
  • 26. @HirofumiIwasaki #jdt2016_5A 26 Java EE 6: Cannot Use ViewScoped CDIs, or Use JSF Backing Bean Filter Faces Servlet Phase Listeners Facelet Facelet Facelet CDI don't have @View Scoped CDI don't have @View Scoped CDI don't have @View ScopedManaged Bean @Session Scoped Java EE 6 (JSF 2.1) CDI World OK! Cannot Use "View Scoped"
  • 27. @HirofumiIwasaki #jdt2016_5A 27 Java EE 7: All Integrated CDI with JSF Filter Faces Servlet Phase Listeners Facelet Facelet Facelet New CDI @View Scoped New CDI @View Scoped New CDI @View Scoped CDI @Session Scoped Java EE 7 (JSF 2.2) CDI WorldOK! OK! Perfect!
  • 28. @HirofumiIwasaki #jdt2016_5A 28 Consideration Points for Applying CDI in JSF Backing Bean  Now CDI can be accessible on Filter. – Consider applying @ApplicationScoped, @SessionScoped for some hacking techs.  Migration from raw static objects to @ApplicationScoped CDI bean – For easy management especially for controlling initialization timing.  Migration from raw HttpSession to @SessionScoped CDI bean – Don't use both HttpSession and @SessionScoped for avoiding confusing on production. – Apply @SessionScoped only for managing session data.  Migration from JSF management bean @ViewScoped to CDI @ViewScoped – Same name but in different package (javax.faces.view.ViewScoped) – Just change the package import from javax.faces.bean.ViewScoped. 28
  • 29. @HirofumiIwasaki #jdt2016_5A 29 Summary: Recommendation for the Java EE 7 Front-End Use For your web front-end, Apply HTML-Friendly Markups. Implement with Facelet,
  • 31. @HirofumiIwasaki #jdt2016_5A 31 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
  • 32. @HirofumiIwasaki #jdt2016_5A 32 Java EE 6: What’s EJB? Why EJB? – The Core of Java EE EJBClient 1. Remote Invocation EJB 2. Automatic Transaction Management Database (BEGIN) (COMMIT) EJB EJB EJB EJB Instance Pool Activate 3. Instance Pooling for Faster Operation RMI-IIOP SOAP REST Web Socket EJB Client 4. Security Management
  • 33. @HirofumiIwasaki #jdt2016_5A 33 Embedded Container Java EE 6: 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
  • 34. @HirofumiIwasaki #jdt2016_5A 34 On Java EE 8 and Beyond: EJB to CDI  Why EJB should go out? 1. Super old implementation in each Java EE compliant application server. 2. Old-style pre-compile required, need much time to deploy. 3. Ultra tight related with EJB container, difficult to test easily (although using EJB embedded server). 4. Decreasing RMI-IIOP (T3) protocol users, less compliant with CORBA specs. 5. Duplicated specification with latest CDI with directly supported automatic transaction with JTA specifications. Good-bye guys…
  • 35. @HirofumiIwasaki #jdt2016_5A 35 Java EE 7 - EJB to CDI: Supporting half functions EJB ↓ CDI Client 1. Remote Invocation EJB ↓ CDI 2. Automatic Transaction Management Database (BEGIN) (COMMIT) EJB EJB EJB EJB Instance Pool Activate 3. Instance Pooling for Faster Operation RMI-IIOP SOAP REST Web Socket EJB Client 4. Security Management Not supported Not supported
  • 36. @HirofumiIwasaki #jdt2016_5A 36 Supported protocols of Java EE 7 in CDI 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
  • 37. @HirofumiIwasaki #jdt2016_5A 37 NOT SUPPORTED: Global Transaction Management with XA Protocol Java EE 7 - Limitation of CDI: RMI-IIOP with XA is not supported CDI Client REST, Web Socket Other System’s EJB Database Other Enterprise Information Systems IIOP AUTO BEGIN AUTO COMMIT Not supported Not supported
  • 38. @HirofumiIwasaki #jdt2016_5A 38 EE7 - Limitation of CDI: For light-weight usage, or simplified architecture Local Transaction Management CDI Client REST, Web Socket Database AUTO BEGIN AUTO COMMIT Enough for almost small architecture. Other System REST * No XA
  • 39. @HirofumiIwasaki #jdt2016_5A How to convert EJB to CDI For From (EJB) To (CDI) Declaration @Stateless @Dependent @Transactional Injection @EJB @Inject Transaction control @TransactionAttibute (TransactionAttibuteType .REQUIRES_NEW) @Transactional (Transactional.TxType .REQUIRES_NEW) Self transaction management @TransactionManagement( TransactionManagementType.BEAN) (delete) Transaction rollback @ApplicationException( rollback = true) @Transactional( rollbackOn = Exception.class) Remote protocol @WebServices, @GET or @POST, @ServerEndpoint, or @Remote in remote interface, @WebServices, @GET, @POST or @ServerEndpoint
  • 40. @HirofumiIwasaki #jdt2016_5A EJB to CDI Code – Super Simple Case 40 From (EJB CMT Session Bean) To (CDI) And delete ejb-jar.xml (and weblogic-ejb-jar.xml etc.),
  • 41. @HirofumiIwasaki #jdt2016_5A 41 Consideration Points for Applying CDI  Merging JSF backing bean (CDI) view with business logics (CDI) – Logically acceptable, but some difficulty for managing.  Difficult to visualize transaction boundary with @Transactional.  Super tight relationship between view and logics - Less code reusability. – Not recommended for enterprise production, just apply for quick prototyping only.  Incompatible points – RMI-IIOP (or T3) with XA (global transaction)  Keep using EJB remote interface on communication point only.  Plan to change other lightweight protocol like REST+JSON. – EJB Timer  Change other products like job scheduler like IBM Tiboli, HITACHI JP1, etc. – Asynchronous operations (@Asynchronous, or EJB Message-Driven bean with JMS)  Wait next CDI spec (on EE 8), or keep using EJB. 41
  • 42. @HirofumiIwasaki #jdt2016_5A 42 Summary: EJB to CDI Apply simplified architecture, use CDI with JTA automatic transaction management. Migrate EJB to CDI as applying easy replacement rules. Recognize incompatible points, check EE 8 spec candidate, design your next app.
  • 43. @HirofumiIwasaki #jdt2016_5A 43 Summary is the world open specification De-Facto standard. “Standard” has many pros & cons, but it can keep your assets and knowledge.
  • 44. @HirofumiIwasaki #jdt2016_5A Java EE has many world-wide people and company support. your application will have long-life guaranteed.
  • 45. @HirofumiIwasaki #jdt2016_5A Apply Java EE 7 today and be ready for EE 8.

Editor's Notes

  • #3: 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.
  • #21: 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.
  • #32: 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.