• 検索結果がありません。

WebLogic Server 12c is Java SE 7 Java EE 6 Readiness

N/A
N/A
Protected

Academic year: 2021

シェア "WebLogic Server 12c is Java SE 7 Java EE 6 Readiness"

Copied!
83
0
0

読み込み中.... (全文を見る)

全文

(1)

Java EE developer’s report

HASUNUMA Kenji

Vice president of GlassFish Japan Users Group

E-mail: k.hasunuma@miracle.ocn.ne.jp

Twitter: @btnrouge

(2)

WebLogic Server 12c

is

Java SE 7

Java EE 6

(3)

Running WebLogic on JDK7

(4)

2012年4月26日

Java SE 7 Update 4

Java SE 6に替わる標準

Mac OS X 正式対応

(5)
(6)

HotSpotとJRockitの統合

(7)

JITコンパイラー

ヒープ領域管理

(8)
(9)

HotSpot VM

JRockit VM

設計思想 ネイティブコンパイル 汎用性重視 サーバーサイドに特化 実行頻度の高いコード コードの初回実行時 ネイティブコード最適化 概ね最適化されている 最適化されない場合あり インタープリター実行 実行頻度の低いコード インタープリターなし

(10)
(11)

Eden

Survive Survive

Old

Permanent Heap Permanent New Old

Nursery

Old

Heap New Old

Sun HotSpot VM

BEA JRockit VM

(12)

Eden

Survive Survive

Old

Heap New Old

Nursery

Old

Heap New Old

Oracle HotSpot VM (HotRockit)

(13)

ガベージ

(14)

JRockit VM HotSpot VM Concurrent GC レスポンス重視 Parallel GC スループット重視 Parallel GC Parallel Old GC Concurrent GC Garbage First GC Parallel GC Mostly Concurrent GC Deterministic GC Deterministic GC 移植予定

(15)

JDK7 Update 4

HotSpot v23

(16)

HotRockit最初の機能プレビュー

jcmd

Java Flight Recorder

(17)
(18)

JRockitの

jrcmd

HotSpotに移植

コマンド書式は同じ:

jcmd <pid> <command...>

コマンド名は

すべて変更

:

(19)

jcmd/jrcmd コマンド対応表(1/2)

jcmd jrcmd

ManagementAgent.stop kill_management_server

ManagementAgent.start_local start_management_server local ManagementAgent.start start_management_server remote Thread.print print_threads GC.class_histogram print_object_summary GC.heap_dump hprofdump GC.run_finalization runfinalization GC.run runsystemgc help help

(20)

jcmd/jrcmd コマンド対応表(2/2)

jcmd jrcmd VM.uptime timestamp VM.flags list_vmflags VM.system_properties print_properties VM.command_line command_line VM.version version VM.commercial_features ----JFR.stop stop_flightrecording JFR.start start_flightrecording JFR.dump dump_flightrecording JFR.check check_flightrecording

(21)

Java Flight Recorder

(22)

HotSpot版 JRockit Flight Recorder

フライト記録は

JRockit互換

JRockit

Mission Controlで読み込み可

(23)

Usage:

2つのVMオプションを設定

-XX:+UnlockCommercialFeatures

-XX:+FlightRecorder

jcmdのJFR.*コマンドで開始・停

止・ダンプ取得などが可能

(24)

New JMX Agent

(MBean)

(25)

JRockit互換のMBeanを装備

HotSpotの状態を

JRockit Mission

Control

で監視可能

(26)
(27)
(28)
(29)
(30)

Java SE 7

JSR 336

(31)
(32)

• [VM] JSR 292: Support for dynamically-typed languages (InvokeDynamic)

• [VM] JSR 202: Strict class-file checking

• [Lang] JSR 334: Small language enhancements (Project Coin)

• [Core] Upgrade class-loader architecture • [Core] Method to close a URLClassLoader

• [Core] JSR 166y: Concurrency and collections updates (fork/join framework)

• [I18N] Unicode 6.0

(33)

• [I18N] Separate user locale and user-interface locale

• [I/O] JSR 203: More new I/O APIs for the Java platform (NIO.2)

• [I/O] TLS 1.2 - RFC 5246 • [DB] JSR 221: JDBC 4.1

• [Client] Create new platform APIs for 6u10 graphics features

• [Client] Nimbus look-and-feel for Swing • [Client] Swing JLayer component

• [Web] Upgrade the XML stack - JAXP (JSR 206), JAXB (JSR 222) and JAX-WS (JSR 224)

(34)

More New I/O (NIO.2)

(35)

More new I/O

(a.k.a. NIO.2)

JSR 203

(36)
(37)
(38)
(39)
(40)
(41)
(42)
(43)

Project Coin

JSR 334

(44)
(45)

try-with-resources構文

multi-catch構文

安全な例外再スロー

ダイヤモンド演算子

switch構文の拡張

リテラル表現の改善

(46)

// try-with-resources サンプル

try (BufferedReader reader = Files.newBufferedReader( Paths.get("C:", "Windows", "win.ini"),

Charset.defaultCharset()) ) { while (reader.ready()) { System.out.println(reader.readLine()); } } catch (IOException e) { e.printStackTrace(); } reader.close() は不要 自動的に解放するリソースを書く finally も不要

(47)

// multi-catch サンプル // Paths は NIO.2 で追加されたクラス try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder();

Document document = builder.parse(

Paths.get("C:", "eclipse", "artifacts.xml").toFile()); System.out.println( document.getDocumentElement().getNodeName()); } catch (ParserConfigurationException | SAXException | IOException e ) { e.printStackTrace(); } 複数の例外をまとめてキャッチ&処理

(48)

// 安全な再スローのサンプル

// 前提:以下の例外が throws に指定されている

// ParserConfigurationException, SAXException, IOException try {

DocumentBuilderFactory factory =

DocumentBuilderFactory.newInstance(); DocumentBuilder builder =

factory.newDocumentBuilder();

Document document = builder.parse(

Paths.get("C:", "eclipse", "artifacts.xml").toFile()); System.out.println(

document.getDocumentElement().getNodeName()); } catch (final Exception e) {

throw e; }

(49)

Java SE 6 まで

List<

String

> strings = new ArrayList<

String

>();

Java SE 7 から

List<

String

> strings = new ArrayList

<>

();

( 省略できるよ! ) (どうせ同じなのに…)

(50)

// switch 構文の仕様拡張(文字列による分岐)

switch (crossroad) {

case "ABLE": // 分岐条件に文字列が使える!

System.out.println("ABLE test was done in July 1st, 1946.");

break;

case "BAKER":

System.out.println("BAKER test was done in July 25th, 1946.");

break;

case "CHARLIE":

System.out.println("CHARLIE test is cancelled.");

break;

default:

System.out.println("N/A");

break; }

(51)

リテラル表現の改善

アンダーバーによる桁区切り:

1_200_000, 0xff_99_66

二進数リテラルの導入:

0b1000, 0B01100001

組み合わせもOK:

0b1000_0100_0110_0011

(52)

Java SE 7

…多数の

細かい変更

WebLogic開発者には不要な機能も…

有益な機能

は積極的に活用しよう!!

NIO.2のファイルシステムAPI

(使ってみると意外と便利)

Project Coin

(より使いやすくなった

Java文法)

(53)

WebLogic powered by

Java EE 6

(54)

Java EE 6

JSR 316

(55)
(56)
(57)
(58)
(59)
(60)

JAX-RS 1.1

JSR 311

(61)

RESTの三原則

リソース

メソッド (リソースの操作)

URI (リソースの識別)

静的なWebサイトはRESTである 事実上SOAPと対立する概念

(62)
(63)
(64)
(65)

HTML5 & JavaScript

リッチクライアントの復権

スマートフォン

タブレット端末

JavaFX

(66)

EJB 3.1

JSR 318

(67)
(68)

@Stateless , @Stateful , @Singleton

トランザクション管理が不要

WARファイル

に入れられる

(69)

JPA 2.0

JSR 317

(70)
(71)
(72)

JDBCより効率が良い

キャッシュメモリー

(L1/L2)

トランザクション最適化

(73)

JDBCトランザクション

executeUpdateの度にJDBCがSQL発行

(74)

JPAトランザクション

最終的に辻褄が合えば過程はどうでもよい

(75)

CDI 1.0

JSR 299

(76)
(77)
(78)
(79)
(80)
(81)

Java SE 7/Java EE 6を阻むもの

未知の技術に対する恐怖

外圧 :

政治的要因

無能なアーキテクトの存在

自社ツール・フレームワークの強要

(82)

Java SE 7/Java EE 6

(83)

Java EE Developer’s report

HASUNUMA Kenji

参照

関連したドキュメント

New Bounds for Ternary Covering Arrays Using a Parallel Simulated Annealing.. Himer Avila-George, 1 Jose Torres-Jimenez, 2 and Vicente Hern

Another new aspect of our proof lies in Section 9, where a certain uniform integrability is used to prove convergence of normalized cost functions associated with the sequence

We study parallel algorithms for addition of numbers having finite representation in a positional numeration system defined by a base β in C and a finite digit set A of

It turned out that the propositional part of our D- translation uses the same construction as de Paiva’s dialectica category GC and we show how our D-translation extends GC to

8, and Peng and Yao 9, 10 introduced some iterative schemes for finding a common element of the set of solutions of the mixed equilibrium problem 1.4 and the set of common fixed

From this figure it is clear that the counter-propagation network is composed of three layers: an input layer that reads input patterns from the training set and forwards them to

However, a more intriguing result is that, when one combines the condition of having a parallel null spinor with the condition of being Ricci-flat, the (4, 3)-metrics with this

While early experiments with algebraic multigrid solvers have shown promising results [2], herein we focus on a domain decomposition approach based on the finite element tearing