Your SlideShare is downloading. ×
0
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Java EE 6 to Java EE 7
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Java EE 6 to Java EE 7

9,438

Published on

Published in: Technology
0 Comments
13 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
9,438
On Slideshare
0
From Embeds
0
Number of Embeds
14
Actions
Shares
0
Downloads
117
Comments
0
Likes
13
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • 本日は、エンタープライズ環境における並列処理の実装方法についてと題して、Java EE 環境で利用可能な並列処理の実装方法の歴史的背景から最新のJava EE 7 で含まれる Concurrency Utilities for EE についてもご紹介します。
  • Transcript

    • 1. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.1Yoshio TeradaJava Evangelisthttp://yoshio3.com,Twitter : @yoshioterada【H-1】
    • 2. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.2以下の事項は、弊社の一般的な製品の方向性に関する概要を説明するものです。また、情報提供を唯一の目的とするものであり、いかなる契約にも組み込むことはできません。以下の事項は、マテリアルやコード、機能を提供することをコミットメント(確約)するものではないため、購買決定を行う際の判断材料になさらないで下さい。オラクル製品に関して記載されている機能の開発、リリースおよび時期については、弊社の裁量により決定されます。Oracleは、米国オラクルコーポレーション及びその子会社、関連会社の米国及びその他の国における登録商標です。文中の社名、商品名等は各社の商標または登録商標である場合があります。
    • 3. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.3はじめに
    • 4. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.42009年12月9日Java EE 6 リリース
    • 5. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.51998年5 月エンタープライズアプリケーション1999年12月10 specs堅牢スケーラブル2001年9月13 specsWeb サービス2003年11月20 specsかんたん開発2006年5月23 specs軽量化2009年12月28 specsProjectJPEJ2EE 1.3CMP,ConnectorArchitectureJava EE 5EaseofDevelopment,Annotations,EJB3.0, JPA,JSF, UpdatedWebServicesJ2EE 1.4WebServicesMgmt,Deployment,AsyncConnectorJava EE 6Pruning,ExtensibilityEase of Dev,CDI, JAX-RSWebProfileServlet 3.0,EJB 3.1 LiteJ2EE 1.2Servlet, JSP,EJB, JMSRMI/IIOPJava EE の歴史
    • 6. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.6Connector1.6JPA 2.1 JTA 1.2 JMSManaged Bean 1.0 EJB 3.1CommonAnnotations 1.1Interceptors 1.1 CDI 1.0PortableExtensionsServlet 3.1JSP JSF 2.0 JAX-RS ELBeanValidationJava EE 6 に含まれる技術
    • 7. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.72010年1月27日
    • 8. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.8
    • 9. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.9拡張性プロファイル仕様の削減かんたん開発Java EE 6 のテーマ開発生産性の大幅向上
    • 10. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.10web.xml<web-app>フレームワーク Aフレームワーク Bフレームワーク Cフレームワーク D</web-app>外部フレームワークの設定が容易フレームワークA<web-fragment>….</web-fragment>フレームワークB<web-fragment>….</web-fragment>web.xml<web-app><absolute-ordering><name>B</name><name>A</name><absolute-ordering></web-app>拡張性
    • 11. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.11プロファイルFull Java EE 6 (Enterprise Platform)Web ProfileJava EE のサブセットを提供Web 開発に特化 & 軽量
    • 12. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.12Pruning (枝きり、剪定) → 仕様の削減古く使われなくなって仕様の整理次期バージョンで削除JAX-RPCEJB Entity BeanJAX-Rなど→ JAX-WS→ JPA
    • 13. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.13Java EE 対応統合開発環境
    • 14. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.14開発効率が悪いテストも大変J2EE の全技術は不要複雑なパッケージングXML 設定地獄実行環境も重量
    • 15. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.15JSF 2.0 : コンポーネント・ベース開発
    • 16. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.16Webページ作成者(デザイナー)アプリケーション開発者コンポーネント開発者DBBackEndJSF 2.0 : 役割に応じて疎で開発が可能
    • 17. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.17EJB 3.1• パッケージの簡略化• EJB 3.1 “Lite” の提供• ローカルビジネスインタフェースのオプション化• 標準化された Global JNDI名• Java SEに組み込み可能なEJBコンテナ• その他の新機能
    • 18. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.18JPA 2.0• パッケージの簡略化JPA 2.0 = JPA 1.0 + α• モデリングの強化• JPQL新しい構文の追加• Criteria API の提供• メタモデルAPIの提供• 悲観的ロックの追加• バリデーションのサポート• 設定オプションの標準化
    • 19. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.19テストも大変開発効率が悪いJ2EE の全技術は不要複雑なパッケージングXML 設定地獄実行環境も重量
    • 20. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.20Java EEApplication ServerWeb ContainerEJB テストリモート・lookupJSP Servlet JSFEJB ContainerEJB EJB EJBDBJava SEEJB 3.0 までの単体テストは困難アプリケーション・サーバへのデプロイが必要
    • 21. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.21EJBテストEJB ContainerEJB EJB EJBJava SEDBEJB 3.1 組み込み可能コンテナアプリケーション・サーバへのデプロイは不要EJBContainer container =EJBContainer.createEJBContainer();Java SE のアプリケーションから EJB コンテナを起動
    • 22. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.22組み込み可能コンテナを利用したテストpublic void testSayHello() {EJBContainer container = EJBContainer.createEJBContainer();try{Hello hello = (Hello)container.getContext().lookup("java:global/classes/Hello");System.out.println(hello.sayHello());}catch(Exception e){e.printStackTrace();}}
    • 23. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.23J2EE の全技術は不要開発効率が悪いテストも大変複雑なパッケージングXML 設定地獄実行環境も重量
    • 24. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.24Java EE 5 まではフル・スペックを提供Java EE 5 SpecificationJSP Servlet JSF EJB JMSJTA Java Mail JAXP JAX-WSJPAJAXB JAXR JDBC JAASJNDI・・・頻繁に使用しない機能もフル・セットで提供不要モジュールもロードしメモリ消費実行環境の起動、再起動も遅い
    • 25. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.25Java EE 6 : プロファイルFull Java EE 6 (Enterprise Platform)Web Profile全機能のサブセット版を提供Web の開発に特化 (これさえあれば Web 開発は十分)軽量
    • 26. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.26Web プロファイルに含まれる仕様Servlet 3.0 JPA 2.0JSP 2.2/EL JTA 1.1JSTL DI 1.0/CDI 1.0JSF 2.0 Managed Bean 1.0Bean Validation 1.0 Interceptors 1.1EJB 3.1 Lite Common AnnotationsJava EE 6 Web Profileこれさえあれば Web 開発は十分
    • 27. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.27複雑なパッケージング開発効率が悪いテストも大変J2EE の全技術は不要XML 設定地獄実行環境も重量
    • 28. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.28WEB-INF/web.xmlWEB-INF/resourcesWEB-INF/classes/FooServlet.classcom/oracle/FooBean.classcom/oracle/Foo.classfoo_web.warfoo_ejb.jarfoo.earcom/oracle/Foo.classlib/foo_common.jarfoo.earWEB-INF/web.xmlWEB-INF/classes/FooServlet.classfoo_web.warcom/oracle/FooBean.classfoo_ejb.jarJava EE 5 までのパッケージの手間適切なアーカイブファイル(ear, jar, war)へのパッケージングが必要
    • 29. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.29Java EE 6 のパッケージングWEB-INF/web.xmlWEB-INF/resourcesWEB-INF/classes/FooServlet.classWEB-INF/classes/com/oracle/FooBean.class(EJB)WEB-INF/classes/com/oracle/Foo.classfoo.warEJB も war ファイルへ !!配備記述子は不要 !!
    • 30. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.30XML 設定地獄開発効率が悪いテストも大変J2EE の全技術は不要複雑なパッケージング実行環境も重量
    • 31. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.31Java EE 5 以降の設定Configuration by Exception必要に応じてデフォルト設定値を上書きする設定手法アノテーションによる設定
    • 32. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.32import javax.servlet.annotation.InitParam;import javax.servlet.annotation.WebServlet;@WebServlet( name = "SimpleServlet",urlPatterns = {"/simple"},initParams = {@InitParam(name = "param1", value = "value1"),@InitParam(name = "param2", value = "value2")} )public class SimpleServlet { }Servlet 3.0 のアノテーション
    • 33. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.33JSF 2.0 のアノテーションimport javax.faces.bean.ManagedBean;@ManagedBean(name="user")@SessionScopedpublic class UserBean {private String name="";private String password;}
    • 34. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.34EJB 3.1 のアノテーション@Statelesspublic class HelloBean {public String sayHello(){return “Hello”;}}ローカル・ビジネス・インタフェースの実装も不要
    • 35. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.35実行環境も重量開発効率が悪いテストも大変J2EE の全技術は不要複雑なパッケージングXML 設定地獄
    • 36. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.36アプリケーション・サーバも軽量化Web Profile 版の起動時間:3〜4秒不要サービスの未初期化再起動時間の大幅短縮小メモリで稼働開発効率・運用管理コストの大幅向上
    • 37. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.37シンプル化HTML 5 対応Java EE 7 のテーマJava EE 6 のプラスα
    • 38. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.38Java EE 7 へ含まれる予定の JSR 一覧Connector1.6JPA 2.1 JTA 1.2 JMS 2.0Managed Bean 1.0 EJB 3.2CommonAnnotations 1.1Interceptors 1.1 CDI 1.1PortableExtensionsServlet 3.1JSP 2.2 JSF 2.2JAX-RS2.0EL 3.0BeanValidation1.1ConcurrencyUtilities for EEBatchApplication(JSR-352)Java API forJSON(JSR-353)Java API forWebSocket(JSR-356)新規追加 大幅な更新 通常の更新
    • 39. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.39Java EE 7の新機能詳細は火曜日にJava API forWebSocket(JSR-356)BatchApplication(JSR-352)ConcurrencyUtilities for EE(JSR-236)
    • 40. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.40JSR 353 :Java API forProcessing JSONJava API forJSON(JSR-353)
    • 41. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.41RFC 4627 The application/json Media Type forJavaScript Object Notation軽量、テキストベース、プログラミング言語に非依存移植性が高く、構造化されたデータ交換フォーマット{“name”:”Bob”,”age”:20,”phone”:[“276 1234”,”124 4567”]}JSON とは
    • 42. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.42JSR 353 : Java API for Processing JSON Streaming API– 低レベル– JSON の解析や生成の効率的な方法 Object Model API– 高レベル– Streaming よりもかんたんに実装可能– Streaming API 上に実装Streaming & Object Model
    • 43. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.43JSON API のアーキテクチャJSON プロバイダSPIStreaming APIObject ModelAPIAPP1 APP2 APP n・・・便利な機能低レベルAPI
    • 44. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.44{"firstName": "John", "lastName": "Smith", "age": 25,"phoneNumber": [{ "type": "home", "number": "212 555-1234" },{ "type": "fax", "number": "646 555-4567" }]}JSON データのサンプル
    • 45. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.45Streaming API(低レベル : StAXライクな実装)
    • 46. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.46JsonParser インスタンスの生成方法(読み込み2通り)JsonParser parser = javax.json.Json#createParser()JsonParser parser = Json#createParserFactory()#createParser()
    • 47. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.47{"firstName": ”Taro", "lastName": ”Yamada", "age": 25,"phoneNumber": [{ "type": "home", "number": "212 555-1234" },{ "type": "fax", "number": "646 555-4567" }]}START_OBJECTStreaming API – JsonParser (低レベル操作)
    • 48. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.48{"firstName": ”Taro", "lastName": ”Yamada", "age": 25,"phoneNumber": [{ "type": "home", "number": "212 555-1234" },{ "type": "fax", "number": "646 555-4567" }]}KEY_NAMEStreaming API – JsonParser (低レベル操作)
    • 49. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.49{"firstName": ”Taro", "lastName": ”Yamada", "age": 25,"phoneNumber": [{ "type": "home", "number": "212 555-1234" },{ "type": "fax", "number": "646 555-4567" }]}VALUE_STRINGStreaming API – JsonParser (低レベル操作)
    • 50. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.50{"firstName": ”Taro", "lastName": ”Yamada", "age": 25,"phoneNumber": [{ "type": "home", "number": "212 555-1234" },{ "type": "fax", "number": "646 555-4567" }]}VALUE_NUMBERStreaming API – JsonParser (低レベル操作)
    • 51. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.51{"firstName": ”Taro", "lastName": ”Yamada", "age": 25,"phoneNumber": [{ "type": "home", "number": "212 555-1234" },{ "type": "fax", "number": "646 555-4567" }]}START_ARRAYStreaming API – JsonParser (低レベル操作)
    • 52. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.52{"firstName": ”Taro", "lastName": ”Yamada", "age": 25,"phoneNumber": [{ "type": "home", "number": "212 555-1234" },{ "type": "fax", "number": "646 555-4567" }]}END_ARRAYStreaming API – JsonParser (低レベル操作)
    • 53. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.53{"firstName": ”Taro", "lastName": ”Yamada", "age": 25,"phoneNumber": [{ "type": "home", "number": "212 555-1234" },{ "type": "fax", "number": "646 555-4567" }]} END_OBJECTStreaming API – JsonParser (低レベル操作)
    • 54. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.54{"firstName": ”Taro", "lastName": ”Yamada", "age": 25,"phoneNumber": [{ "type": "home", "number": "212 555-1234" },{ "type": "fax", "number": "646 555-4567" }]}例 – 値 “John” の取得方法 (低レベル)
    • 55. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.55 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.55try (Reader reader =new FileReader(”~/json.dat");) {JsonParser parser = Json.createParser(reader);JsonParser.Event event = null;event = parser.next(); //START_OBJECT の取得event = parser.next(); //KEY_NAME “firstName” の取得System.out.println(parser.getString());} catch (IOException ioe) {logger.log(Level.SEVERE, null ,ioe);}{"firstName": ”Taro"
    • 56. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.56Object Model API(扱い易い : DOM ライクな実装)
    • 57. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.57try (JsonReader jsonReader = Json.createReader(reader)) {JsonObject jObj = jsonReader.readObject();if(jObj.containsKey("firstName")){String value = jObj.getString("firstName");System.out.println(value); // Taro}}JSonObject から特定 Key の Value を取得Key と Value の型が分かっている場合に有効{ "firstName": ”Taro", ……}
    • 58. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.58if(jObj.containsKey("phoneNumber")){JsonArray array = jObj.getJsonArray("phoneNumber");for(JsonValue phoneValue : array){if(phoneValue.getValueType() ==JsonValue.ValueType.OBJECT){JsonObject arrayElem =array.getJsonObject(array.indexOf(phoneValue));if(arrayElem.containsKey("type")){ }"phoneNumber": [{ "type": "home”, ..}, { "type": "home”, ..} …… ]JSonObject から特定 Array を取得
    • 59. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.59Builder からJsonObject の生成JsonObject jsonObject = Json.createObjectBuilder(). // {add(”KEY1", ”VALUE1"). //”KEY1": ”VALUE1”add(”KEY2", //”KEY2":Json.createArrayBuilder(). // [add(Json.createObjectBuilder(). //{add(”KEY3", ”VALUE3"))). //”KEY3": ”VALUE3" }build();{"KEY1":"VALUE1","KEY2":[{"KEY3","VALUE3”}]}
    • 60. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.60try (BufferedReader br =new BufferedReader(new FileReader(”~/json.dat"));JsonReader jsonReader = Json.createReader(br)) {JsonObject jObj = jsonReader.readObject();...} catch (IOException ex) {logger.log(Level.SEVERE, null, ex);}I/O から JSonObject の読み込み
    • 61. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.61JSR 341:Expression Language 3.0EL 3.0
    • 62. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.62 Lambda 式対応– Array, List, Map の構成 コレクションに対するクエリ演算子(LINQ式) Java SE 環境で利用するためのAPIを提供 デフォルトの EL 実行環境マネージャの追加 クラス(static)変数、クラス(static)メソッド、enum 定数対応 クラス、パッケージのインポート新機能の一覧EL 3.0
    • 63. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.63 名前空間を持つ Name– reference, import 関数定義 コンストラクタ 新しい演算子– 文字列連結演算子、変数割当用演算子 型変換 表記の評価用のリスナー新機能の一覧EL 3.0
    • 64. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.64<h:dataTable id="tabledata" value=”#{afilter =indexManagedBean.ageFileter ;indexManagedBean.data.stream().filter(p-> p.age >= afilter).toList()}" var="person" border="1"><h:column><f:facet name="header"><h:outputText value="名前"/></f:facet><h:outputText value="#{person.name}"/></h:column>EL 式内で Lambda 式を記述 (コレクション操作)
    • 65. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.65JSR 343:Java™ Message Service 2.0JMS 2.0
    • 66. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.66 かんたんに実装できるようになったAPI– JMSContext, JMSProducer, JMSConsumer の追加 例外の実装方法の変更 既存 API に対する改善 CDI を利用した冗長コードの排除 クラウド機能は Java EE 8 へ新機能の一覧JMS 2.0
    • 67. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.67 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.67@Statelesspublic class MailRegJMSSendQueueEJB {@Resource(mappedName = "java:comp/DefaultJMSConnectionFactory")ConnectionFactory conn;@Resource(mappedName = "jms/mailRegistQueue")Queue queue;public void registEmailAddress(String emailAddress) {try (JMSContext context = conn.createContext()) {context.createProducer().send(queue,emailAddress);}}}送信コード(Java EE 7)
    • 68. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.68 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.68@MessageDriven(mappedName = "jms/mailRegistQueue")public class SendMessageMDB implements MessageListener {@InjectMailSender mailSender;@Overridepublic void onMessage(Message message) {try {TextMessage msg = (TextMessage) message;mailSender.sendMessage(msg.getText());} catch (JMSException jmse) {logger.log(Level.SEVERE, …);}}}受信コード MDB(Java EE 7)
    • 69. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.69Java EE 7の新機能詳細は火曜日にJava API forWebSocket(JSR-356)BatchApplication(JSR-352)ConcurrencyUtilities for EE(JSR-236)
    • 70. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.70
    • 71. Copyright © 2013, Oracle and/or its affiliates. All rights reserved.71

    ×