jjug ccc 2013 fall key note presentation
DESCRIPTION
This presentation was used at the keynote of JJUG CCC 2013 conference.TRANSCRIPT
2013 エンタープライズ Java 最前線
Yoshio Terada Java Evangelist http://yoshio3.com
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 2
以下の事項は、弊社の一般的な製品の方向性に関する概要を説明するものです。また、情報提供を唯一の目的とするものであり、いかなる契約にも組み込むことはできません。以下の事項は、マテリアルやコード、機能を提供することをコミットメント(確約)するものではないため、購買決定を行う際の判断材料になさらないで下さい。オラクル製品に関して記載されている機能の開発、リリースおよび時期については、弊社の裁量により決定されます。
Oracleは、米国オラクルコーポレーション及びその子会社、関連会社の米国及びその他の国における登録商標です。文中の社名、商品名等は各社の商標または登録商標である場合があります。
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 3
GlassFish について
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 4
GlassFish Server 製品提供プランの変更 § Oracle GlassFish Server 商用ライセンスおよびサポートの提供
– GlassFish Server 3.1.2.2までで終了 § GlassFish Server 3.1.x以降の商用ライセンス・サポート提供はありません § プライスリストへの掲載は継続
– GlassFish Server ver.4およびそれ以降は「オープンソース版」のみ提供 § 商用ライセンスおよびサポートは提供されません
– GlassFish 3.1.2.2のサポートタイムライン: § Premier Support: 2016/3; Extended Support: 2019/3
§ 今後のJava EEに対応するApp Server製品で、商用ライセンスおよびサポート
が提供されるのはOracle WebLogic Serverのみとなります
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 5
[ご参考] Oracle GlassFish Server Lifetime Support Policy
商用ライセンス リリースバージョン
GA Date Premier Support 終了
Extended Support 終了
Sustaining Support 終了
Sun GlassFish Enterprise Server 2.1.1
Jan 2009 Jan 2014 Jan 2017 Indefinite
Oracle GlassFish Server 3.0.x
Dec 2009 Dec 2014 Dec 2017 Indefinite
Oracle GlassFish Server 3.1.x
March 2011 March 2016 March 2019 Indefinite
現在提供されている商用ライセンスについては、お客様へのサポート提供を継続
既存製品については、お客様はライセンス購入できます。 上記のLifetime Support Policyは維持されます。
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 6
GlassFish Server 製品リリースプラン
§ 製品名称:GlassFish Server Open Source Edition – オープンソースで開発、オープンソース製品として提供 – 現在の最新版はver. 4.0 (Java EE 7 準拠) – 商用ライセンス・製品サポートは提供されません – 位置づけ:Java EE の” Reference Implementation” – 今後のリリース予定
§ GlassFish Server Open Source Edition 4.1: 2014年提供予定 § Java EE仕様の進捗に伴う機能追加を予定 § 定期アップデートパッチ提供予定
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 7
2005-2006年 Bill Shannon
Photo by Sakuraba san
J2EE から Java EE へ
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 8
2009 年 12 月 10 日 Java EE 6 リリース
かんたん開発の集大成
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 9
Now Available Java Platform, Enterprise Edition 7
The standard in community-driven enterprise software
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 10
Java EE の歴史
Java EE 7
2005-2012
かんたん開発
軽量化
開発生産性 & HTML5
1998-2004
エンタープライズ プラットフォーム
堅牢性
Web サービス
2013 - Future
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 11
Java EE 7 へ含まれる予定の JSR 一覧
Connector 1.6 JPA 2.1 JTA 1.2 JMS 2.0
Managed Bean 1.0 EJB 3.2
Common Annotations 1.1 Interceptors 1.1 CDI 1.1
Portable Extensions
Servlet 3.1
JSP 2.2 JSF 2.2 JAX-RS 2.0
EL 3.0
Bean Validation 1.1
Concurrency Utilities for EE (JSR-236) Batch
Application (JSR-352)
Java API for JSON
(JSR-353)
Java API for WebSocket (JSR-356)
新規追加 大幅な更新 通常の更新
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 12
Java: 幅広い業界への適用
9,000,000 JAVA 開発者
18 社による Java EE 準拠アプリケーション・サーバの提供
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 13
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 14
GlassFish v4
NetBeans 7.3.1 Java EE SDK
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 15
Java EE 7 のどの機能に興味がありますか? ブログのアンケート結果より
テクノロジー
WebSocket バッチ JAX-RS JSON-P 並列処理
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 16
Java EE 7 のテーマ
開発生産性
Java EE 7
HTML5 エンタープライズニーズへの対応
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 17
Java EE 7
JSON 1.0 WebSocket 1.0 JAX-RS 2 JSF 2.2 Servlet 3.1
Expression Language 3.0
EJB 3.2 CDI 1.1 JTA 1.2
Interceptors 1.2 Bean Validation 1.1
Batch 1.0 Concurrency 1.0
JMS 2.0 JPA 2.1
各カテゴリに含まれる機能
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 18
次世代の HTML 5 対応アプリケーション
次世代 HTML5 対応のアプリケーションの基盤 § WebSockets : 低レイテンシ、レスポンスタイムの改善 § JSON : シンプルなデータ・フォーマットで移植性の高いアプリケーション § RESTful : 同期・非同期、スケーラブル、高パフォーマンス
WebSockets
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 19
開発生産性の向上
§ 簡単なアプリケーション・アーキテクチャ § オールインワンの統合プラットフォーム § 冗長的なコード記述の削減による効率化 § アノテーション・ベース開発の拡大による効率化
§ アプリケーションの移植性の向上
Java EE 7
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 20
開発生産性の向上
§ Java SE 7 対応 § try-with-resource への対応
§ 冗長的なコード排除 § 冗長的なインスタンス生成の抑制
§ 完全整理されたプラットフォーム § 頻繁に利用される JAX-RS の Web Profile 対応
Java EE 7
JMSContext
Connection Session
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 21
エンタープライズ・ニーズへの対応
§ バッチ処理 : OLTP のパフォーマンス改善 § マルチスレッド並列タスク:スケーラビリティの改善
§ JMS の実装方法の改善
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 22
エンタープライズ・ニーズへの対応
§ Java EE 環境における並列処理実装方法の提供 § バッチ・アプリケーションに対する標準化ニーズへの対応 § JMS における開発生産性の向上
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 23
Java EE ハンズオンの概要
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 24
メッセージプロバイダ
WebSocket
WSサーバエンドポイント Message Driven Bean
Web アプリケーション JMS
LB
社内システム
情報提供者
情報受信者
Java EE ハンズオンの概要
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 25
DOWNLOAD Java EE 7 SDK oracle.com/javaee
GlassFish 4.0 Full Platform or Web Profile glassfish.org
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 26
Project Avatar
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 27
Open Sourcing Project Avatar avatar.java.net
Download and try now! Get involved!
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 28
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 29
§ 先進的な HTML 5 アプリ構築フレームワーク – WebSocket, Server-Sent Event, RESTful に対応
§ モジュール化対応 JavaScript フレームワーク § 軽量なサーバ・アーキテクチャ (Thin-Server Architecture)
コンセプト
Project Avatar とは
§ Avatar のメリット – サーバ・サイドJavaScript と Java EE アプリの融合 – Java VM 上で稼働する JavaScrip のスケーラビリテイ・信頼性・運用保守性
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 30
Thin-Server アーキテクチャ (TSA)
今まで アプリ View
Model サーバ側でマージ
HTTP/JS
TSA View
Service
アプリ
クライアント側でマージ
HTTP/JS
JSON
View
Model
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 31
Avatar の概念 (クライアント側: View)
ブラウザ(JavaScript/DOM)
View (UI Node) Avatar (Controller)
HTML 5 JavaScript EL
• データ・ バインディング
• ナビゲーション • ローカル・ ストレージ
アクセス方法を提供 • ローカル • RESTful • SSE • WebSocket
Model
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 32
Avatar の概念 (サーバ側 : Service)
Nashorn (JavaVMで稼働するJavaScriptエンジン)
Service Avatar アクセス方法を提供 • RESTful • SSE • WebSocket
ルーティング JSON のシリアライズ
利用可能なデータソース • ファイル • DB(JPA) • インメモリ • JMS
Data プロバイダ
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 33
Avatar のアーキテクチャ
UI
Avatar アプリ (HTML 5/JS/CSS) Avatar 実行環境
HTML 5 DOM
ローカルストレージ
Avatar アプリ (HTML5/JavaScript)
Avatar コンパイラ
Nashorn (JavaScript エンジン)
ブラウザ App サーバ Java EE アプリ
View
アプリ サービス
Java EE サービス
HTTP
HTTP・ SSE・
WebSocket
HTTP/ WebSocket
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 34
Avatar のアーキテクチャ
UI
Avatar アプリ (HTML 5/JS/CSS) Avatar 実行環境
HTML 5 DOM
ローカルストレージ
Avatar コンパイラ
Nashorn (JavaScript エンジン)
ブラウザ App サーバ Java EE アプリ
View サービス Data サービス
Java EE サービス
HTTP
HTTP/ WebSocket
HTTP/ WebSocket
① Avatar アプリの作成
Avatar アプリ (HTML5/JavaScript)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 35
Avatar アプリの作成
# avatar new [project-name]
Avatar のプロジェクトの作成
※ デフォルトで View のみ生成
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 36
Avatar のアーキテクチャ
UI
Avatar アプリ (HTML 5/JS/CSS) Avatar 実行環境
HTML 5 DOM
ローカルストレージ
Avatar アプリ (XML/JavaScript)
Avatar コンパイラ
Nashorn (JavaScript エンジン)
ブラウザ App サーバ Java EE アプリ Java EE
サービス
HTTP
HTTP/ WebSocket
HTTP/ WebSocket
② Viewとサービスを実装
View
アプリ サービス
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 37
View(クライアント) と Serivce(サーバ) の実装 ディレクトリ構成
html, xhtml, xml ファイル
Avatar 用 JavaScriptファイル
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 38
!var avatar = require("org/glassfish/avatar");!var message = 'The Server Time is ';!var getTime = function(){! var current = new Date();! return{! msg: message,! h: current.getHours(),! m: current.getMinutes(),! s: current.getSeconds()! };!};!!… 続く Service (サーバ) の実装
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 39
… 続き !avatar.registerPushService({ url:"data/time"},! function(){! this.$onOpen = this.$onTimeout = function(context){! context.$setTimeout(1000); //1秒後に配信! return context.$sendMessage(getTime());! };! } !);!
Service (サーバ) の実装 Server-Sent Event のサーバ・サイドの実装コード
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 40
<!DOCTYPE html>!<html><head>…</head>! <body>! <script data-model="push">! var Time = function(){! this.msg = this.h = this.m = this.s ='';! };! </script>! <script data-type="Time" data-instance="time" ! data-url="data/time"></script>! <output class="time">! #{time.msg}#{time.h}:#{time.m}:#{time.s}! </output>!</body></html>!
View(クライアント) の実装
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 41
Avatar のアーキテクチャ
UI
Avatar アプリ (HTML 5/JS/CSS) Avatar 実行環境
HTML 5 DOM
ローカルストレージ
Avatar アプリ (XML/JavaScript)
Avatar コンパイラ
Nashorn (JavaScript エンジン)
ブラウザ App サーバ Java EE アプリ Java EE
サービス
HTTP
HTTP/ WebSocket
HTTP/ WebSocket
③ Viewとサービスを コンパイル
View
アプリ サービス
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 42
Avatar のコンパイル
# avatar compile project-name! Compiled: project-name!
Avatar アプリケーションのコンパイル
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 43
コンパイル後の ディレクトリ構成 サーバ側の実行ファイル
クライアント側の実行ファイル
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 44
Avatar アプリケーションのデプロイ
# asadmin deploy project-name! Application deployed with name project-name.! Command deploy executed successfully.!
GlassFish にアプリケーションをデプロイ
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 45
Avatar アプリケーションのダウンロード
UI
Avatar アプリ (HTML 5/JS/CSS) Avatar 実行環境
HTML 5 DOM
ローカルストレージ
Avatar アプリ (XML/JavaScript)
Avatar コンパイラ
Nashorn (JavaScript エンジン)
ブラウザ App サーバ Java EE アプリ
View サービス Data サービス
Java EE サービス
HTTP
HTTP/ WebSocket
HTTP/ WebSocket
④ View サービスの 「複数ページの一括」 ダウンロード (※プラグインは不要)
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 46
Avatar サービスの呼び出し
UI
Avatar アプリ (HTML 5/JS/CSS) Avatar 実行環境
HTML 5 DOM
ローカルストレージ
Avatar アプリ (XML/JavaScript)
Avatar コンパイラ
Nashorn (JavaScript エンジン)
ブラウザ App サーバ Java EE アプリ
View サービス
Java EE サービス
HTTP
HTTP/ WebSocket
HTTP/ WebSocket
⑤ WebSocket/Server-Sent Event/ RESTful で Data サービスを利用
アプリ サービス
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 47
Java EE サービスの呼び出し
UI
Avatar アプリ (HTML 5/JS/CSS) Avatar 実行環境
HTML 5 DOM
ローカルストレージ
Avatar アプリ (XML/JavaScript)
Avatar コンパイラ
Nashorn (JavaScript エンジン)
ブラウザ App サーバ Java EE アプリ
View サービス Data サービス
Java EE サービス
HTTP
HTTP/ WebSocket
HTTP/ WebSocket
⑥ サーバ側はJava EE のサービスも利用可能
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 48
アプリケーション・サーバ側の リソースも利用可能
UI
Avatar アプリ (HTML 5/JS/CSS) Avatar 実行環境
HTML 5 DOM
ローカルストレージ
Avatar アプリ (XML/JavaScript)
Avatar コンパイラ
Nashorn (JavaScript エンジン)
ブラウザ App サーバ Java EE アプリ
View サービス アプリサービス
Java EE サービス
HTTP
HTTP/ WebSocket
⑦ JPA, JMS, NoSQL 等サーバリソースも 利用可能
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 49
Avatar のアーキテクチャ
UI
Avatar アプリ (HTML 5/JS/CSS) Avatar 実行環境
HTML 5 DOM
ローカルストレージ
Avatar アプリ (XML/JavaScript)
Avatar コンパイラ
Nashorn (JavaScript エンジン)
ブラウザ App サーバ Java EE アプリ
View サービス Data サービス
Java EE サービス
HTTP
HTTP/ WebSocket
HTTP/ WebSocket
⑧ クライアント側は HTML 5, DOM, ローカルストレージ 等を利用可能
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 50
JDK 8 (b103 移行) Avatar バンドル済 GlassFish v4
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 51
はじめての Project Avatar http://yoshio3.com/2013/10/10/beginning-of-project-avatar/
�
手始めにここから はじめてみてください
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 52
Java EE 7
State Management
PaaS
NoSQL JSON-B
Modularity
HTML5++
Caching
Cloud
Java EE 8 とその将来
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 53
Graphic Section Divider
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. 54