java developer workshop #2
DESCRIPTION
TRANSCRIPT
1 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java SE/EE の今後について 日本オラクル Fusion Middleware 製品事業統括本部 寺田 佳央 (http://yoshio3.com)
2 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
以下の事項は、弊社の一般的な製品の方向性に関する概要を説明するものです。また、情報提供を唯一の目的とするものであり、いかなる契約にも組み込むことはできません。以下の事項は、マテリアルやコード、機能を提供することをコミットメント(確約)するものではないため、購買決定を行う際の判断材料になさらないで下さい。オラクル製品に関して記載されている機能の開発、リリースおよび時期については、弊社の裁量により決定されます。
Oracleは、米国オラクルコーポレーション及びその子会社、関連会社の米国及びその他の国における登録商標です。文中の社名、商品名等は各社の商標または登録商標である場合があります。
3 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java SE の今後
4 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java Platform の優先事項
5 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
7革命 進化
1996 1997 1998 2000 2002 2004 2006 2011
1.0
1.1
1.2
1.3 1.4
5.0
6
Java の歴史
6 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
JSR- 337 : Java SE 8 2013 年 夏リリース予定
7 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Nashorn (JavaScript Engine in JDK)
8 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
HotRockit ‒ Java VMの統合
9 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Project Lambda
10 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
ハードウェアのトレンド
Image Herb Sutter
11 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
マルチコア時代 ‒ サーバ
12 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
マルチコア時代 ‒ クライアント
2002 2004 2006 2008 2010
2 ... 4 ..... 8 ..... 携帯電話 ... タブレット ... デスクトップ
2012
13 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
ここで登場 Lambda
14 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
class Student { String name; int gradYear; double score; } Collection<Student> students = ...;
学生のコレクション
15 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Collection<Student> students = ...; double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); }
同一学年の最大スコアの取得(逐次処理)
16 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
同一学年の最大スコアの取得(コンカレント) Collection<Student> students = ...; max = students.filter(new Predicate<Student>() { public boolean op(Student s) { return s.gradYear == 2011; } }).map(new Extractor<Student, Double>() { public Double extract(Student s) { return s.score; } }).reduce(0.0, new Reducer<Double, Double>() { public Double reduce(Double max, Double score) { return Math.max(max, score); } }); 並列処理は可能だが可読性が低下
17 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Collection<Student> students = ...; max = students.filter((Student s) -> s.gradYear == 2011) .map((Student s) -> s.score) .reduce(0.0, (Double max, Double score) -> Math.max(max, score));
max = students.filter(s -> s.gradYear == 2011) .map(s -> s.score) .reduce(0.0, Math#max); コンカレント処理 max = students.parallel() .filter(s -> s.gradYear == 2011) .map(s -> s.score) .reduce(0.0, Math#max); パラレル処理
同一学年の最大スコアの取得
18 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Project Jigsaw
• jar の地獄からの解放 – クラスパスの排除 – 自動ダウンロード・インストール – ネィティブ・パッケージ (dev, rpm,ips, etc …)
• パフォーマンス向上(起動時、実行時) – 増分ダウンロード (高速クラスロード) – 必須モジュールの記録
• 小型機器への適用 – Java SE のサブセット提供
Java 標準モジュールシステム
19 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
JavaFX 3.0 Codename : Lombard
20 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java SE 9 以降のビジョン (変更の可能性有)
Mark Reinhold
21 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java SE 9 以降のビジョン
相互運用性 • マルチ言語対応の JVM • Java/ネィティブ統合の改良
クラウド • マルチ・テナンシーのサポート • リソース管理
操作性の向上 • セルフチューニング JVM • 言語の拡張
高度な最適化 • ユニファイド型システム • データ構造の最適化
動作環境 • 組み込み機器から大規模サーバへの適用 • ヘテロジニアス・コンピューティング・モデル対応
22 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
相互運用性 • 動的言語サポートの改善
– Invokedynamic (JDK 7 完了) – Java/JavaScript の相互運用 (JDK 8 Nashornで実装中) – Meta Object プロトコル (JDK 9) – Long list の最適化 (JDK 9+)
• Java/Native – JNI 不要で Java から Native コード呼び出し (JDK 9)
23 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
クラウド • マルチテナンシー (JDK 8 +)
– 同一 OS 上で稼働する Java VM 間の共有の改善 – スレッド/スレッドグループ毎のリソース管理・監視
• Hypervisor対応 Java VM (JDK 9+) – 共通操作メモリページの共有 – 共通操作ライフサイクル、マイグレーション
24 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
言語仕様の機能 • 巨大データのサポート (JDK 9)
– 巨大配列 (64ビットサポート) • ユニファイド型システム (JDK 10+)
– primitive 型の排除、完全にオブジェクトだけで実装 • 型の具体化 (JDK 10+)
– ジェネリクス – 関数型
• データ構造の最適化 (JDK 10+)
25 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
様々な動作環境のサポート • 新しいデバイスへの対応 (JDK 8+)
– マルチタッチ (JDK 8) – 位置情報 (JDK 8) – センサー対応:コンパス、加速度、温度、圧力など
• ヘテロ・コンピューティング・モデル (JDK 9+) – GPU (Graphics Processing Unit) – FPGA (Field-Programmable Gate Array) – Offload Engine – リモート PL/SQL など
26 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
2年周期で提供予定
JDK 7 JDK 8 JDK 9 JDK 10 JDK 11 JDK 12
2011 2019 2021 2013 2015 2017
27 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java EE の今後
28 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java EE の状況 Cameron Purdy
29 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
30 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java EE 7 ‒ PaaS にフォーカス • サービス・プロビジョニング • QoS, 伸縮性 • アプリケーションとリソースの共有 • 再設定、カスタマイズ機能 Linda DeMichie
(Java EE Spec Lead)
31 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java EE 7 ‒ Elasticity (伸縮性) • リソース状況に応じた増減 • 自立サービスレベル管理 • 1台から IaaS まで配備対象管理
継続的な伸縮性
シングルノードNon-Elastic 動的な自己調整
SLA Driven Elasticity Java EE マルチノード
マルチインスタンス クラスタ化
Java EE 7 のフォーカス
Java EE Cluster
Capacity on Demand
Elastic Cluster
Cameron Purdy
32 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
GlassFish v4.0 ‒ PaaS コンソール (New)
33 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
GlassFish v4.0 ‒ PaaS 環境へデプロイ
34 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
GlassFish v4.0 ‒ サービスリソース設定
35 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
GlassFish v4.0 ‒ オート・スケール設定
CPU使用状況 メモリ使用状況 レスポンスタイム 日付指定
36 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
GlassFish v4.0 ‒ PaaS 環境の監視
37 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
マルチテナンシー
38 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Web コンテナ・マルチテナンシー • テナント毎に1アプリケーション・インスタンス
• 同一アプリケーションの複数の独立したテナントをサポート Rajiv Mordani
(Servlet Spec Lead)
• コンテナによるマッピング テナント毎に仮想サーバの割り当て
• テナント毎のカスタムリソースの読み込み Web アプリケーションの表示デザインを変更可能
39 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
JPA 2.1 マルチテナンシー • インスタンス・レベル • スキーマ・レベル • レコード(同一テーブル)・レベル
Linda DeMichie (Java EE Spec Lead)
40 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Eclipse Link 2.3 (Indigo) Multi Tenancy Support
@Multitenant @TenantDiscriminatorColumn
41 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
テナントID : Oracle テナントID : Foo
JPA におけるマルチテナンシーの1例
同一アプリケーション
42 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Entity クラス
43 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
アプリケーションのコピー&テナントIDの変更
テナント A 用の設定
テナント B 用の設定 アプリケーションの実装コードは 一切変更無し
44 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved. 44
Java EE 7
Multi-Tenancy
Service Definition & Orchestration
Elasticity
New Roles
JMS 2.0
Caching API
JSON API
Expanded CDI & REST Support
Broad Industry Participation
Build on EE 6 Momentum
Java EE 7
45 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
GlassFish v3 • Java EE 6 Support • Single Instance • GlassFish Enterprise Mgr
2009 2010 2011 2012
GlassFish Server 3.0.1 • Oracle Branding • Oracle Platform Support • Oracle Interoperability
GlassFish Server 3.1 • Centralized administration • Clustering / HA • GlassFish Server Control
GlassFish Server 3.1.2 • Bug Fixes • Minor Features
GlassFish Server 3.1.1 • Bug Fixes • Updated Components • Minor Features
GlassFish Server 4 • Java EE 7 • Multitenancy • PaaS-enablement
Java EE 7/GlassFish Roadmap
46 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java EE 7 に含まれる JSR • Platform 7 / Web Profile 7 • JPA 2.1 • JAX-RS 2.0 • EJB 3.2 • JMS 2.0 • Servlet 3.1 • EL 3.0 • JSF 2.2 • CDI 1.1 • Bean Validation 1.1
• JCache 1.0 (JSR 107) • Concurrency Utilities 1.0 • State Management 1.0 • Batch Processing 1.0 • JSON 1.0 • Common Annotations 1.2 MR • JAX-WS 2.3 MR • JTA 1.2 MR • JSP 2.3 MR • JASPIC 1.2 MR
47 | Copyright © 2011, Oracle and/or it’s affiliates. All rights reserved.
Java SE/EE の今後について 日本オラクル Fusion Middleware 製品事業統括本部 寺田 佳央 (http://yoshio3.com)