KEMBAR78
Future of Java EE with SE 8 (revised) | PPTX
hashtag: #j8fk
http://www.mushagaeshi.com
Java Community
@Fukuoka
hashtag: #j8fk
 Hirofumi Iwasaki
 twitter: @HirofumiIwasaki (English)
 Carrier
 Planning, designing & implements for many huge enterprise
systems for financial, manufacturer, public systems with
enterprise middleware, especially Java EE & .NET in Japan for
about 16 years.
 Opus, Lectures, etc.
 Lectures: Java Day Tokyo 2014, JJUG CCC 2014 Spring,
WebLogic key person roundtable (2012-2013), etc.
 Magazine: @IT (2005-2010), CIO Magazine (2009), IT Architect
(2005-2009), Web+DB Press (2005), Java World (2001-2004),
DB Magazine (2000), etc.
2
hashtag: #j8fk
1. Status of Adapting Java 8
in EE Servers
2. Java SE 8 Updating
- Basic Topics for EE 7
3. Java SE 8 Updating
- Advanced Topics for EE 7
3
hashtag: #j8fk
4
hashtag: #j8fk
5
hashtag: #j8fk
 Standard specifications for application servers
Commercial
Open Source
etc.
Java EE
Specification
Liberty Profile etc.
+
6
hashtag: #j8fk
 For ENTERPRISE systems (Enterprise Edition)
specifications (full profile)
 'Enterprise' means transactional.
 Core architecture is EJB (JTA & CMT) with auto transaction
systems.
 Transactional connectivity for other systems with JPA (JDBC),
JMS, RMI-IIOP.
 Web architecture with JSF (Servlet & Facelet), JAX.
 Each Java EE specification covers general enterprise
requirements.
 Not for personal usage.  Use Java SE only.
 Not for build-in usage.  Use Java ME.
 For your enterprise system  Use Java EE with Java SE.
7
hashtag: #j8fk
J2EE
1.2
(1999)
J2EE
1.3
(2001)
J2EE
1.4
(2003)
Java EE
5
(2006)
Java EE
6
(2009)
Java EE
7
(2013)
Born! Pandemic
Era
Unite to Single
Standard
Again!
8
hashtag: #j8fk
J2EE
1.2
(1999)
J2EE
1.3
(2001)
J2EE
1.4
(2003)
Java
EE 5
(2006)
Java
EE 6
(2009)
Java
EE 7
(2013)
J2SE
1.2
(1998)
J2SE
1.3
(2000)
J2SE
1.4
(2002)
J2SE
5
(2004)
Java
SE 6
(2006)
Java
SE 7
(2011)
Java
SE 8
(2014)
Java EE 7 is not fit perfectly for SE 8 improved functions
9
hashtag: #j8fk
Vendor App Server EE 1.4
(2003-)
EE 5
(2006-)
EE 6
(2009-)
EE 7
(2013-)
Open Source GlassFish - 2.x 3.x 4.0
Oracle WebLogic 9.x 10.x 12.x -
IBM WebSphere 5.1 6.x, 7.x 8.x -
IBM Liberty Profile - - 8.5 -
Open Source Geronimo - 2.x 3.x -
Open Source TomEE+ - - 1.x -
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 -
Hitachi Cosminexus 7.x 8.x 9.x -
10
hashtag: #j8fk
Vendor App Server EE 6 (2009 -) EE 7 (2013-)
Ver. SE Ver. Ver. SE Ver.
Open Source GlassFish 3.x SE 7 4.0 SE 7
Oracle WebLogic 12.1.x SE 6, SE 7 - -
IBM WebSphere 8.x SE 6, SE 7 - -
Open Source Geronimo 3.x SE 6, SE 7 - -
Open Source TomEE+ 1.x SE 7 - -
Red Hat JBoss 7.x SE 6, SE 7 - -
Red Hat WildFly - - 8.0 SE 7, SE 8
Fujitsu Interstage 11.1 SE 6, SE 7 - -
Hitachi Cosminexus 9.x SE 7 - -
*
* WebLogic 12.1.1 only
11
hashtag: #j8fk
12
hashtag: #j8fk
Nice!
13
hashtag: #j8fk
Excellent!
14
hashtag: #j8fk
15
hashtag: #j8fk
16
hashtag: #j8fk
17
hashtag: #j8fk
List<String> aList
= Arrays.asList(new String[]{"a", "b", "c", "d", "e"});
// Normal
for (String x : aList) {
System.out.println(x);
}
// Lambda with parallel stream
aList.parallelStream().forEachOrdered(x -> System.out.println(x));
Stream API
(auto parallel threading)
Lambda Expression
(just a syntax sugar)
18
hashtag: #j8fk
Automatic Conversion
19
hashtag: #j8fk
// Calendar.
Calendar cal = Calendar.getInstance();
// Date.
int year = cal.get(Calendar.YEAR);
int month = cal.get(Calendar.MONTH) + 1;
int day = cal.get(Calendar.DAY_OF_MONTH);
// Time.
int hour = cal.get(Calendar.HOUR);
int minutes = cal.get(Calendar.MINUTE);
int second = cal.get(Calendar.SECOND);
int millisecond =
cal.get(Calendar.MILLISECOND);
// Local Date Time.
LocalDateTime dateTime =
LocalDateTime.now();
// Local Date.
LocalDate date = dateTime.toLocalDate();
int year = date.getYear();
int month = date.getMonthValue();
int day = date.getDayOfMonth();
DayOfWeek dayOfWeek = date.getDayOfWeek();
// Local Time.
LocalTime time = dateTime.toLocalTime();
int hour = time.getHour();
int minute = time.getMinute();
int second = time.getSecond();
int nanoSecond = time.getNano();
Java 8 –
-1
From Millisecond to Nanosecond
(.000  .000000000)
20
hashtag: #j8fk
// Date Calculation
Calendar threeWAfter = Calendar.getInstance();
threeWAfter.setLenient(false);
threeWAfter.add(Calendar.DAY_OF_MONTH, 7 * 3);
Calendar fourMBefore = Calendar.getInstance();
fourMBefore.setLenient(false);
fourMBefore.add(Calendar.MONTH, -4);
// Time Calculation
Calendar sevenHAfter = Calendar.getInstance();
sevenHAfter.setLenient(false);
sevenHAfter.add(Calendar.HOUR, 7);
Calendar threeMBefore = Calendar.getInstance();
threeMBefore.setLenient(false);
threeMBefore.add(Calendar.MINUTE, -3);
// Local Date Time.
LocalDateTime dateTime = LocalDateTime.now();
LocalDate date = dateTime.toLocalDate();
LocalTime time = dateTime.toLocalTime();
// Date Calculation
LocalDate threeWAfter = date.plusWeeks(3);
LocalDate fourMBefore = date.minusMonths(4);
// Time calculation
LocalTime sevenHAfter = time.plusHours(7);
LocalTime threeMBefore = time.minusMinutes(3);
Java 8 –
Simplified, sophisticated style!
21
hashtag: #j8fk
ANSI SQL Java SE 8
DATE java.time.LocalDate
TIME java.time.LocalDate
TIMESTAMP java.time.LocalDateTime
TIME WITH TIMEZONE java.time.OffsetTime
TIMESTAMP WITH TIMEZONE java.time.OffsetDateTime
http://www.oracle.com/technetwork/articles/java/jf14-date-time-2125367.html
22
hashtag: #j8fk
23
hashtag: #j8fk
24
hashtag: #j8fk
25
hashtag: #j8fk
Rich Internet Apps
(no business logics)
Web Presentation
(no business logics)
Business Logic
(no presentations)
Data Access
DBs
Automatic
Transaction
Messaging
MQ
Connection
Other
Servers
EMail
MTA
Main stage is here!
26
hashtag: #j8fk
 EE 7 didn’t consider the SE 8 in their
specification.
 EE 7 spec don’t know the SE 8.
 Many SE 8 new functions might be work
correctly if the app server supported the SE 8
as their VM.
 Lambda expressions
 Stream APIs (limited)
 New date time APIs (limited)
 etc.
27
hashtag: #j8fk
 But some conflicted specs might not be
worked correctly
 Stream API (multithreading with EJB 3.2, e.g. parallel
stream)
 New date time APIs (JDBC new mappings with JPA
2.1)
 etc.
 Wait the Java EE 8 for the full support of SE 8
28
hashtag: #j8fk
29
hashtag: #j8fk
30
hashtag: #j8fk
31
hashtag: #j8fk
Downloaded from here.
32
hashtag: #j8fk
NetBeans 8
detected 4.0.1
33
hashtag: #j8fk
NetBeans 8
supported JDK 8
34
hashtag: #j8fk
Startup succeeded
with NetBeans 8.
35
hashtag: #j8fk
<EJB>
LambdaLogic.java
<CDI Bean> *
IndexBean.java
<JSF Facelet> *
index.xhtml
*This is just a workaround due to
not working Web Services / REST tester
in GlassFish 4.0.1b5.
36
hashtag: #j8fk
37
hashtag: #j8fk
38
hashtag: #j8fk
39
hashtag: #j8fk
Both Succeeded.
40
hashtag: #j8fk
41
hashtag: #j8fk
42
hashtag: #j8fk
43
hashtag: #j8fk
44
hashtag: #j8fk
Just a kidding
code…
45
hashtag: #j8fk
Unknown
Implementation
Error ???
46
hashtag: #j8fk
Just removed
the EJB annotation,
turn to POJO
47
hashtag: #j8fk
Works !?
Why?????
48
hashtag: #j8fk
49
hashtag: #j8fk
Still not allowed.
Oh…
50
hashtag: #j8fk
 Fork/Join framework was introduced in Java SE 7
 Not supported in EJB container.
 Parallel Stream uses fork/join framework in its
implementation
 Might not be supported in EJB 3.2 container in EE 7
 Some complicated case might not be worked correctly
 Exception management case
 JTA with container managed transaction in parallel loop case
 @Asynchronous method call in parallel loop
 Differed transaction isolation level method calling
 Security management
 etc.
51
hashtag: #j8fk
 All Java EE 7 app servers are
not supported SE 8 yet, but
some simple case are
usable with 8.
 Many limitation are still
existing for applying SE to
EE 7, but useful new
functions must be improve
the stage of your enterprise.
Anyway,
Ready to apply SE 8
for the Java EE!
52
hashtag: #j8fk
Approved My
Submissions!
53
hashtag: #j8fk
54
September 28 – October 2, 2014
San Francisco
Conference: Oracle
OpenWorld Session ID:
CON2820 Session Title: Case
Study of Financial Web System
Development and Operations
with Oracle WebLogic
12c Conference: JavaOne Sessi
on ID: CON2789 Session Title:
Java EE 6 adoption in one of the
world’s largest online financial
systems
Come and Join Us!
hashtag: #j8fk
55
hashtag: #j8fk
56

Future of Java EE with SE 8 (revised)

  • 1.
  • 2.
    hashtag: #j8fk  HirofumiIwasaki  twitter: @HirofumiIwasaki (English)  Carrier  Planning, designing & implements for many huge enterprise systems for financial, manufacturer, public systems with enterprise middleware, especially Java EE & .NET in Japan for about 16 years.  Opus, Lectures, etc.  Lectures: Java Day Tokyo 2014, JJUG CCC 2014 Spring, WebLogic key person roundtable (2012-2013), etc.  Magazine: @IT (2005-2010), CIO Magazine (2009), IT Architect (2005-2009), Web+DB Press (2005), Java World (2001-2004), DB Magazine (2000), etc. 2
  • 3.
    hashtag: #j8fk 1. Statusof Adapting Java 8 in EE Servers 2. Java SE 8 Updating - Basic Topics for EE 7 3. Java SE 8 Updating - Advanced Topics for EE 7 3
  • 4.
  • 5.
  • 6.
    hashtag: #j8fk  Standardspecifications for application servers Commercial Open Source etc. Java EE Specification Liberty Profile etc. + 6
  • 7.
    hashtag: #j8fk  ForENTERPRISE systems (Enterprise Edition) specifications (full profile)  'Enterprise' means transactional.  Core architecture is EJB (JTA & CMT) with auto transaction systems.  Transactional connectivity for other systems with JPA (JDBC), JMS, RMI-IIOP.  Web architecture with JSF (Servlet & Facelet), JAX.  Each Java EE specification covers general enterprise requirements.  Not for personal usage.  Use Java SE only.  Not for build-in usage.  Use Java ME.  For your enterprise system  Use Java EE with Java SE. 7
  • 8.
    hashtag: #j8fk J2EE 1.2 (1999) J2EE 1.3 (2001) J2EE 1.4 (2003) Java EE 5 (2006) JavaEE 6 (2009) Java EE 7 (2013) Born! Pandemic Era Unite to Single Standard Again! 8
  • 9.
    hashtag: #j8fk J2EE 1.2 (1999) J2EE 1.3 (2001) J2EE 1.4 (2003) Java EE 5 (2006) Java EE6 (2009) Java EE 7 (2013) J2SE 1.2 (1998) J2SE 1.3 (2000) J2SE 1.4 (2002) J2SE 5 (2004) Java SE 6 (2006) Java SE 7 (2011) Java SE 8 (2014) Java EE 7 is not fit perfectly for SE 8 improved functions 9
  • 10.
    hashtag: #j8fk Vendor AppServer EE 1.4 (2003-) EE 5 (2006-) EE 6 (2009-) EE 7 (2013-) Open Source GlassFish - 2.x 3.x 4.0 Oracle WebLogic 9.x 10.x 12.x - IBM WebSphere 5.1 6.x, 7.x 8.x - IBM Liberty Profile - - 8.5 - Open Source Geronimo - 2.x 3.x - Open Source TomEE+ - - 1.x - 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 - Hitachi Cosminexus 7.x 8.x 9.x - 10
  • 11.
    hashtag: #j8fk Vendor AppServer EE 6 (2009 -) EE 7 (2013-) Ver. SE Ver. Ver. SE Ver. Open Source GlassFish 3.x SE 7 4.0 SE 7 Oracle WebLogic 12.1.x SE 6, SE 7 - - IBM WebSphere 8.x SE 6, SE 7 - - Open Source Geronimo 3.x SE 6, SE 7 - - Open Source TomEE+ 1.x SE 7 - - Red Hat JBoss 7.x SE 6, SE 7 - - Red Hat WildFly - - 8.0 SE 7, SE 8 Fujitsu Interstage 11.1 SE 6, SE 7 - - Hitachi Cosminexus 9.x SE 7 - - * * WebLogic 12.1.1 only 11
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
    hashtag: #j8fk List<String> aList =Arrays.asList(new String[]{"a", "b", "c", "d", "e"}); // Normal for (String x : aList) { System.out.println(x); } // Lambda with parallel stream aList.parallelStream().forEachOrdered(x -> System.out.println(x)); Stream API (auto parallel threading) Lambda Expression (just a syntax sugar) 18
  • 19.
  • 20.
    hashtag: #j8fk // Calendar. Calendarcal = Calendar.getInstance(); // Date. int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONTH) + 1; int day = cal.get(Calendar.DAY_OF_MONTH); // Time. int hour = cal.get(Calendar.HOUR); int minutes = cal.get(Calendar.MINUTE); int second = cal.get(Calendar.SECOND); int millisecond = cal.get(Calendar.MILLISECOND); // Local Date Time. LocalDateTime dateTime = LocalDateTime.now(); // Local Date. LocalDate date = dateTime.toLocalDate(); int year = date.getYear(); int month = date.getMonthValue(); int day = date.getDayOfMonth(); DayOfWeek dayOfWeek = date.getDayOfWeek(); // Local Time. LocalTime time = dateTime.toLocalTime(); int hour = time.getHour(); int minute = time.getMinute(); int second = time.getSecond(); int nanoSecond = time.getNano(); Java 8 – -1 From Millisecond to Nanosecond (.000  .000000000) 20
  • 21.
    hashtag: #j8fk // DateCalculation Calendar threeWAfter = Calendar.getInstance(); threeWAfter.setLenient(false); threeWAfter.add(Calendar.DAY_OF_MONTH, 7 * 3); Calendar fourMBefore = Calendar.getInstance(); fourMBefore.setLenient(false); fourMBefore.add(Calendar.MONTH, -4); // Time Calculation Calendar sevenHAfter = Calendar.getInstance(); sevenHAfter.setLenient(false); sevenHAfter.add(Calendar.HOUR, 7); Calendar threeMBefore = Calendar.getInstance(); threeMBefore.setLenient(false); threeMBefore.add(Calendar.MINUTE, -3); // Local Date Time. LocalDateTime dateTime = LocalDateTime.now(); LocalDate date = dateTime.toLocalDate(); LocalTime time = dateTime.toLocalTime(); // Date Calculation LocalDate threeWAfter = date.plusWeeks(3); LocalDate fourMBefore = date.minusMonths(4); // Time calculation LocalTime sevenHAfter = time.plusHours(7); LocalTime threeMBefore = time.minusMinutes(3); Java 8 – Simplified, sophisticated style! 21
  • 22.
    hashtag: #j8fk ANSI SQLJava SE 8 DATE java.time.LocalDate TIME java.time.LocalDate TIMESTAMP java.time.LocalDateTime TIME WITH TIMEZONE java.time.OffsetTime TIMESTAMP WITH TIMEZONE java.time.OffsetDateTime http://www.oracle.com/technetwork/articles/java/jf14-date-time-2125367.html 22
  • 23.
  • 24.
  • 25.
  • 26.
    hashtag: #j8fk Rich InternetApps (no business logics) Web Presentation (no business logics) Business Logic (no presentations) Data Access DBs Automatic Transaction Messaging MQ Connection Other Servers EMail MTA Main stage is here! 26
  • 27.
    hashtag: #j8fk  EE7 didn’t consider the SE 8 in their specification.  EE 7 spec don’t know the SE 8.  Many SE 8 new functions might be work correctly if the app server supported the SE 8 as their VM.  Lambda expressions  Stream APIs (limited)  New date time APIs (limited)  etc. 27
  • 28.
    hashtag: #j8fk  Butsome conflicted specs might not be worked correctly  Stream API (multithreading with EJB 3.2, e.g. parallel stream)  New date time APIs (JDBC new mappings with JPA 2.1)  etc.  Wait the Java EE 8 for the full support of SE 8 28
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
    hashtag: #j8fk <EJB> LambdaLogic.java <CDI Bean>* IndexBean.java <JSF Facelet> * index.xhtml *This is just a workaround due to not working Web Services / REST tester in GlassFish 4.0.1b5. 36
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
    hashtag: #j8fk Just akidding code… 45
  • 46.
  • 47.
    hashtag: #j8fk Just removed theEJB annotation, turn to POJO 47
  • 48.
  • 49.
  • 50.
    hashtag: #j8fk Still notallowed. Oh… 50
  • 51.
    hashtag: #j8fk  Fork/Joinframework was introduced in Java SE 7  Not supported in EJB container.  Parallel Stream uses fork/join framework in its implementation  Might not be supported in EJB 3.2 container in EE 7  Some complicated case might not be worked correctly  Exception management case  JTA with container managed transaction in parallel loop case  @Asynchronous method call in parallel loop  Differed transaction isolation level method calling  Security management  etc. 51
  • 52.
    hashtag: #j8fk  AllJava EE 7 app servers are not supported SE 8 yet, but some simple case are usable with 8.  Many limitation are still existing for applying SE to EE 7, but useful new functions must be improve the stage of your enterprise. Anyway, Ready to apply SE 8 for the Java EE! 52
  • 53.
  • 54.
    hashtag: #j8fk 54 September 28– October 2, 2014 San Francisco Conference: Oracle OpenWorld Session ID: CON2820 Session Title: Case Study of Financial Web System Development and Operations with Oracle WebLogic 12c Conference: JavaOne Sessi on ID: CON2789 Session Title: Java EE 6 adoption in one of the world’s largest online financial systems Come and Join Us!
  • 55.
  • 56.

Editor's Notes

  • #53 Java EE 6 is suitable for huge financial systems. And we made new financial architecture with many education and measurements. Make our enterprise future with Java EE.