{"id":389,"date":"2014-04-07T00:51:32","date_gmt":"2014-04-06T15:51:32","guid":{"rendered":"http:\/\/www.typea.info\/blog\/index.php\/2014\/04\/07\/java_ee_7_ejb\/"},"modified":"2014-04-07T00:51:32","modified_gmt":"2014-04-06T15:51:32","slug":"java_ee_7_ejb","status":"publish","type":"post","link":"https:\/\/www.typea.info\/blog\/index.php\/2014\/04\/07\/java_ee_7_ejb\/","title":{"rendered":"Java EE 7 \u691c\u8a3c\u74b0\u5883\u3092\u3064\u304f\u308b EJB\u7de8"},"content":{"rendered":"<p>\u3053\u3053\u307e\u3067\u3001<\/p>\n<ol>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2014\/03\/27\/java_ee_7_centos_glassfish\">Java EE 7 \u3092\u8a66\u3059\u305f\u3081\u306b CentOS \u306b GlassFish \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2014\/03\/27\/ubuntu_glassfish_v4_java_ee_7\">Ubuntu \u306b GlassFish v4 \u306b\u3088\u308b Java EE 7 \u691c\u8a3c\u74b0\u5883\u3092\u3064\u304f\u308b<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2014\/04\/02\/ubuntu_spring_tool_suite_java_ee_7\">Ubuntu \u306b Spring Tool Suite \u3092\u5165\u308c\u3066 Java EE 7 \u691c\u8a3c\u74b0\u5883\u3092\u3064\u304f\u308b<\/a>\n<li><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2014\/04\/06\/java_ee_7_rest_web\">Java EE 7 \u691c\u8a3c\u74b0\u5883\u3092\u3064\u304f\u308b REST Web\u30b5\u30fc\u30d3\u30b9<\/a><\/li>\n<\/ol>\n<p><a href=\"http:\/\/typea.info\/blg\/glob\/java-ee\/\">\u3053\u3093\u306a\u611f\u3058\u3067\u9032\u3093\u3067\u304d\u305f\u3002<\/a>  <\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2014\/04\/06\/java_ee_7_rest_web\">\u306a\u3093\u3068\u304b\u304b\u3093\u3068\u304b\u3001REST\u30b5\u30fc\u30d3\u30b9\u306e\u74b0\u5883\u304c\u3067\u304d\u305f<\/a>\u306e\u3067\u3001\u6b21\u306fEJB\u74b0\u5883\u3092\u8a2d\u5b9a\u3059\u308b\u3002<\/p>\n<p>EJB\u81ea\u4f53\u306f\u3001\u4eca\u304b\u308915\u5e74\u304f\u3089\u3044\u524d\u306b\u306a\u308b\u304b\u306a\u3002\u8a33\u3082\u308f\u304b\u3089\u305a\u4ed5\u4e8b\u3067\u89e6\u3063\u305f\u304d\u308a\u3001\u3084\u3084\u3053\u3057\u3044\u3001\u304a\u305d\u3044\u3001\u4f7f\u3048\u306a\u3044\u3068\u3044\u3046\u611f\u89e6\u3060\u3051\u6b8b\u3057\u3066\u305d\u308c\u304b\u3089\u89e6\u3063\u3066\u3044\u306a\u3044\u3002<\/p>\n<p><a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/4798124605\/ref=as_li_ss_il?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=4798124605&amp;linkCode=as2&amp;tag=typea09-22\"><img decoding=\"async\" border=\"0\" src=\"http:\/\/ws-fe.amazon-adsystem.com\/widgets\/q?_encoding=UTF8&amp;ASIN=4798124605&amp;Format=_SL160_&amp;ID=AsinImage&amp;MarketPlace=JP&amp;ServiceVersion=20070822&amp;WS=1&amp;tag=typea09-22\"><\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=4798124605\" width=\"1\" height=\"1\">  <\/p>\n<p>\u3057\u304b\u3057\u306a\u304c\u3089\u3001<a href=\"http:\/\/www.amazon.co.jp\/gp\/product\/4798124605\/ref=as_li_ss_tl?ie=UTF8&amp;camp=247&amp;creative=7399&amp;creativeASIN=4798124605&amp;linkCode=as2&amp;tag=typea09-22\">Beginning Java EE 6 GlassFish 3\u3067\u59cb\u3081\u308b\u30a8\u30f3\u30bf\u30fc\u30d7\u30e9\u30a4\u30baJava (Programmer\u2019s SELECTION)<\/a><img loading=\"lazy\" decoding=\"async\" style=\"border-top-style: none !important; border-left-style: none !important; border-bottom-style: none !important; border-right-style: none !important; margin: 0px\" border=\"0\" alt=\"\" src=\"http:\/\/ir-jp.amazon-adsystem.com\/e\/ir?t=typea09-22&amp;l=as2&amp;o=9&amp;a=4798124605\" width=\"1\" height=\"1\"> \u3092\u3056\u3063\u3068\u8aad\u3093\u3067\u307f\u305f\u3068\u3053\u308d\u3001\u3053\u306e15\u5e74\u306e\u9593\u306b\u7d50\u69cb\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u3088\u3046\u3060\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u6982\u8981\u3092\u4e0a\u8a18\u306e\u672c\u304b\u3089\u307e\u3068\u3081\u3066\u307f\u308b\u3002<\/p>\n<h2>1.EJB\u306e\u6982\u8981<\/h2>\n<p>EJB(Enterprise Java Beans)\u3068\u306f\u3001\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3092\u30ab\u30d7\u30bb\u30eb\u5316\u3057\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u6271\u3046\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3002<br \/>POJO\u306b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4ed8\u52a0\u3059\u308b\u3060\u3051\u3067\u4f7f\u7528\u53ef\u80fd\u306b\u306a\u308b\u3002  <\/p>\n<ul>\n<li>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u6c38\u7d9a\u6027\u30ec\u30a4\u30e4\u30fc\u3092\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u30fb\u30ec\u30a4\u30e4\u30fc\u304b\u3089\u5206\u96e2\u3059\u308b\u306b\u306f\u3001\u30d3\u30b8\u30cd\u30b9\u30fb\u30ec\u30a4\u30e4\u30fc\u304c\u5fc5\u8981\u3002\n<li>\u30d3\u30b8\u30cd\u30b9\u30fb\u30ec\u30a4\u30e4\u30fc\u306b\u3001\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3092\u5b9f\u88c5\u3057\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u7ba1\u7406\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3092\u8ffd\u52a0\u3059\u308b\u3002\n<li>Java EE\u3067\u306f\u3001\u30d3\u30b8\u30cd\u30b9\u30fb\u30ec\u30a4\u30e4\u30fc\u306e\u5b9f\u88c5\u306b Enterprise Java Beans(EJB)\u3092\u4f7f\u7528\u3059\u308b\u3002\n<li>\u30c9\u30e1\u30a4\u30f3\u30af\u30e9\u30b9\u306e\u30e2\u30c7\u30eb\u5316\u3067\u306f\u901a\u5e38\u540d\u8a5e\uff08Artist\u3001CD\u3001Book\u3001Customer\u306a\u3069\uff09\u3092\u5b9a\u7fa9\u3059\u308b\u3002\u3053\u306e\u30ec\u30a4\u30e4\u30fc\u306e\u4e0a\u4f4d\u306b\u30d3\u30b8\u30cd\u30b9\u30fb\u30ec\u30a4\u30e4\u30fc\u3092\u914d\u7f6e\u3057\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u51e6\u7406\u3092\u30e2\u30c7\u30eb\u5316\u3059\u308b\u3002\u3053\u308c\u3089\u306f\u901a\u5e38\u52d5\u8a5e(\u66f8\u7c4d\u3092\u8cfc\u5165\u3059\u308b\u3001\u66f8\u7c4d\u3092\u914d\u9001\u3059\u308b \u306a\u3069)\u3068\u3057\u3066\u5b9a\u7fa9\u3059\u308b\u3002\n<li>\u30d3\u30b8\u30cd\u30b9\u30fb\u30ec\u30a4\u30e4\u30fc\u306f\u5916\u90e8Web\u30b5\u30fc\u30d3\u30b9(SOAP Web\u30b5\u30fc\u30d3\u30b9\u3084\u3001REST Web\u30b5\u30fc\u30d3\u30b9)\u3068\u76f8\u4e92\u4f5c\u7528\u3057\u3001\u4ed6\u306e\u30b7\u30b9\u30c6\u30e0\u306b\u975e\u540c\u671f\u30e1\u30c3\u30bb\u30fc\u30b8\u306a\u3069\u3092\u9001\u3063\u305f\u308a\u3059\u308b\u3002\n<li>\u307e\u305f\u3001Web\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3084\u30d0\u30c3\u30c1\u51e6\u7406\u3001\u5916\u90e8\u30b7\u30b9\u30c6\u30e0\u306a\u3069\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3078\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3068\u3057\u3066\u6a5f\u80fd\u3059\u308b\u3060\u3051\u3067\u306f\u306a\u304f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b\u3089\u5916\u90e8\u30b7\u30b9\u30c6\u30e0\u306b\u304b\u3051\u3066\u8907\u6570\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u7d71\u5408\u3057\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u5883\u754c\u3068\u306a\u308b\u4e2d\u5fc3\u7684\u306a\u5834\u6240\u3068\u3057\u3066\u6a5f\u80fd\u3059\u308b\u3002\u300d<\/li>\n<\/ul>\n<h3>1.1 \u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6a5f\u80fd<\/h3>\n<ul>\n<li>\u30e1\u30c3\u30bb\u30fc\u30b8\u30f3\u30b0\n<li>\u30b9\u30b1\u30b8\u30e5\u30fc\u30ea\u30f3\u30b0\n<li>\u30ea\u30e2\u30fc\u30c8\u30a2\u30af\u30bb\u30b9\n<li>Web\u30b5\u30fc\u30d3\u30b9\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8(SOAP\u3068REST)\n<li>\u4f9d\u5b58\u6027\u6ce8\u5165\n<li>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\n<li>\u30a4\u30f3\u30bf\u30fc\u30bb\u30d7\u30bf\u306b\u3088\u308bAOP<\/li>\n<\/ul>\n<h3>1.2 \u307e\u305f\u3001\u4ee5\u4e0b\u306e\u69d8\u306aJava SE\u3001EE\u306e\u30c6\u30af\u30ce\u30ed\u30b8\u30fc\u3068\u30b7\u30fc\u30e0\u30ec\u30b9\u306b\u7d71\u5408<\/h3>\n<ul>\n<li>JDBC\n<li>JavaMail\n<li>Java\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3API(JTA)\n<li>Java\u30e1\u30c3\u30bb\u30fc\u30b8\u30f3\u30b0\u30b5\u30fc\u30d3\u30b9(JMS)\n<li>Java Authentication and Authorization Service(JAAS)\n<li>Java Naming and Directory Interface(JNDI)\n<li>Remote Method Invocation(RMI)<\/li>\n<\/ul>\n<p>\u3053\u3046\u3057\u305f\u6280\u8853\u7684\u306b\u8907\u96d1\u306a\u6a5f\u80fd\u306f\u30b3\u30f3\u30c6\u30ca\u304c\u51e6\u7406\u3059\u308b\u305f\u3081\u3001EJB\u958b\u767a\u8005\u306f\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u306e\u958b\u767a\u306b\u5c02\u5ff5\u3067\u304d\u308b\u3002  <\/p>\n<h2>2.\u30bb\u30c3\u30b7\u30e7\u30f3Bean<\/h2>\n<p>\u30bb\u30c3\u30b7\u30e7\u30f3Bean\u306f\u3001\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3001\u30d7\u30ed\u30bb\u30b9\u3001\u30ef\u30fc\u30af\u30d5\u30ed\u30fc\u3092\u5b9f\u88c5\u3059\u308b\u306e\u306b\u6700\u9069\u3002<br \/>\u305f\u3060\u3057\u3001\u4e8b\u524d\u306b\u7a2e\u985e\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<table cellspacing=\"0\" cellpadding=\"2\" width=\"485\" border=\"1\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"117\">\u7a2e\u985e<\/td>\n<td valign=\"top\" width=\"366\">\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"117\">\u30b9\u30c6\u30fc\u30c8\u30ec\u30b9<\/td>\n<td valign=\"top\" width=\"366\">\u8907\u6570\u306e\u30e1\u30bd\u30c3\u30c9\u9593\u3067\u5bfe\u8a71\u72b6\u614b\u3092\u4fdd\u6301\u3057\u306a\u3044\u30bb\u30c3\u30b7\u30e7\u30f3Bean\u3002\u4efb\u610f\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4efb\u610f\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u5229\u7528\u3067\u304d\u308b\u3002<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"117\">\u30b9\u30c6\u30fc\u30c8\u30d5\u30eb<\/td>\n<td valign=\"top\" width=\"366\">\u5bfe\u8a71\u72b6\u614b\u3092\u4fdd\u6301\u3059\u308b\u30bb\u30c3\u30b7\u30e7\u30f3Bean\u3002\u4e00\u4eba\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u95a2\u4e0e\u3059\u308b\u8907\u6570\u306e\u30e1\u30bd\u30c3\u30c9\u3067\u5bfe\u8a71\u72b6\u614b\u3092\u4fdd\u6301\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u3002<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"117\">\u30b7\u30f3\u30b0\u30eb\u30c8\u30f3<\/td>\n<td valign=\"top\" width=\"366\">\u8907\u6570\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u5171\u6709\u3057\u3001\u540c\u6642\u30a2\u30af\u30bb\u30b9\u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b1\u3064\u306e\u30bb\u30c3\u30b7\u30e7\u30f3Bean\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3053\u308c\u3089\u306e\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30e2\u30c7\u30eb\u306f\u5171\u901a\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u6301\u305f\u306a\u3044\u3053\u3068\u3082\u3001\u30ed\u30fc\u30ab\u30eb\u307e\u305f\u306f\u30ea\u30e2\u30fc\u30c8\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u6301\u3064\u3053\u3068\u3082\u53ef\u80fd\u3002\u30b3\u30f3\u30c6\u30ca\u7ba1\u7406\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306a\u306e\u3067\u3001\u30a2\u30fc\u30ab\u30a4\u30d6(jar\u3001war\u3001ear)\u306b\u30d1\u30c3\u30b1\u30fc\u30b8\u3057\u3066\u30b3\u30f3\u30c6\u30ca\u306b\u30c7\u30d7\u30ed\u30a4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u30b3\u30f3\u30c6\u30ca\u306f\u3001\u30e9\u30a4\u30d5\u30b5\u30a4\u30af\u30eb\u3001\u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u3001\u30a4\u30f3\u30bf\u30fc\u30bb\u30d7\u30bf\u30fc\u3092\u7ba1\u7406\u3002  <\/p>\n<h2>3.\u4f9d\u5b58\u6027\u6ce8\u5165<\/h2>\n<p>EJB\u306f\u4f9d\u5b58\u6027\u6ce8\u5165\u3092\u4f7f\u7528\u3057\u3066\u3001\u69d8\u3005\u306a\u7a2e\u985e\u306e\u30ea\u30bd\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<br \/>@EJB \u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u5229\u7528\u3057\u3066\u3001EJB\u306e\u53c2\u7167\u3092\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u6ce8\u5165\u3057\u307e\u3059\u3002<br \/>\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u306f\u30c7\u30d7\u30ed\u30a4\u6642\u306b\u884c\u308f\u308c\u307e\u3059\u3002  <\/p>\n<h2>4. \u5b9f\u969b\u306b\u4f5c\u6210<\/h2>\n<h3>4.1 EJB\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/h3>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u304b\u3089\u3001EJB \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/JavaEE7EJB_4D3\/ejb_project01.png\"><img loading=\"lazy\" decoding=\"async\" title=\"ejb_project01\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"ejb_project01\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/JavaEE7EJB_4D3\/ejb_project01_thumb.png\" width=\"311\" height=\"255\"><\/a> <\/p>\n<p>EAR membership \u306e Add project to an EAR \u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3066\u3001EAR\u306b\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/JavaEE7EJB_4D3\/ejb_project02.png\"><img loading=\"lazy\" decoding=\"async\" title=\"ejb_project02\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"ejb_project02\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/JavaEE7EJB_4D3\/ejb_project02_thumb.png\" width=\"247\" height=\"299\"><\/a> <\/p>\n<p>\u4f5c\u6210\u5f8c\u306e\u69d8\u5b50<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/JavaEE7EJB_4D3\/ejb_project03.png\"><img loading=\"lazy\" decoding=\"async\" title=\"ejb_project03\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"ejb_project03\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/JavaEE7EJB_4D3\/ejb_project03_thumb.png\" width=\"237\" height=\"306\"><\/a> <\/p>\n<p>EAR\u306e\u4e0b\u306eBundle Library \u306b EJB \u306e jar \u304c\u51fa\u73fe\u3002<\/p>\n<h3>4.2 EJB \u30af\u30e9\u30b9\u306e\u4f5c\u6210<\/h3>\n<p>\u6700\u521d\u306a\u306e\u3067\u30a6\u30a3\u30b6\u30fc\u30c9\u3092\u4f7f\u3063\u3066\u3001\u30bb\u30c3\u30b7\u30e7\u30f3Bean\u3092\u4f5c\u6210\u3057\u3066\u307f\u308b\u3002<\/p>\n<p>\uff33\uff54\uff41\uff54\uff45\uff4c\uff45\uff53\uff53 \u3000\u3092\u9078\u629e\u3057\u3066\u3001\u5f8c\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u307e\u307e\u3059\u3059\u3080\u3002<\/p>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/JavaEE7EJB_4D3\/create_session_bean01.png\"><img loading=\"lazy\" decoding=\"async\" title=\"create_session_bean01\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"create_session_bean01\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/JavaEE7EJB_4D3\/create_session_bean01_thumb.png\" width=\"319\" height=\"297\"><\/a> <\/p>\n<h3>4.3 EJB\u306e\u30b3\u30fc\u30c9<\/h3>\n<\/p>\n<\/p>\n<p>ejbModule \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306b\u3001\u30af\u30e9\u30b9\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"prettyprint linenums\">package info.typea.tallarico.ejb;\r\n\r\nimport javax.ejb.LocalBean;\r\nimport javax.ejb.Stateless;\r\n\r\n\/**\r\n * Session Bean implementation class GreetEjb\r\n *\/\r\n@Stateless\r\n@LocalBean\r\npublic class GreetEjb {\r\n\r\n    \/**\r\n     * Default constructor. \r\n     *\/\r\n    public GreetEjb() {\r\n        \/\/ TODO Auto-generated constructor stub\r\n    }\r\n    \r\n    public String getGreet() {\r\n    \treturn \"Hello EJB!\";\r\n    }\r\n}<\/pre>\n<h3>4.4 REST\u30b5\u30fc\u30d3\u30b9\u306e\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u304b\u3089\u547c\u3073\u51fa\u3059<\/h3>\n<p><a href=\"https:\/\/www.typea.info\/blog\/index.php\/2014\/04\/06\/java_ee_7_rest_web\">\u4f5c\u6210\u3057\u305f\u3001REST \u30b5\u30fc\u30d3\u30b9\u306e\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u304b\u3089\u3001EJB\u3092\u547c\u3073\u51fa\u3059\u3088\u3046\u306b\u5909\u66f4\u3059\u308b<\/a>\u3002<\/p>\n<p>REST\u30b5\u30fc\u30d3\u30b9\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d3\u30eb\u30c9\u30d1\u30b9\u3067\u3001EJB\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u53c2\u7167\u8a2d\u5b9a\u3092\u884c\u3044\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b3\u30fc\u30c9\u3092\u4fee\u6b63\u3002<\/p>\n<ul>\n<li>@Stateless \u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4ed8\u4e0e\u3059\u308b\u3053\u3068\u3067\u3001\u3053\u3044\u3064\u3082EJB\u306b(\u306a\u3044\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3002\u7406\u5c48\u306f\u4eca\u3072\u3068\u3064\u307e\u3060\u628a\u63e1\u3057\u3066\u3044\u306a\u3044)\n<li>\u4f5c\u6210\u3057\u305fEJB\u3092\u30e1\u30f3\u30d0\u30fc\u3068\u3057\u3066\u5ba3\u8a00\u3057\u3001@EJB\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u3051\u308b\u3002\u3053\u308c\u3067\u3001\u30b3\u30f3\u30c6\u30ca\u304c\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u3057\u3066\u304f\u308c\u308b\u3002\n<li>\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u5185\u5bb9\u3092EJB\u304b\u3089\u53d6\u5f97\u3059\u308b\u3088\u3046\u306b\u66f8\u304d\u63db\u3048\u308b\u3002<\/li>\n<\/ul>\n<pre class=\"prettyprint linenums\">package info.typea.tallarico.rest;\r\n\r\nimport info.typea.tallarico.ejb.GreetEjb;\r\n\r\nimport javax.ejb.EJB;\r\nimport javax.ejb.Stateless;\r\nimport javax.ws.rs.GET;\r\nimport javax.ws.rs.Path;\r\nimport javax.ws.rs.Produces;\r\nimport javax.ws.rs.core.MediaType;\r\n\r\n\r\n@Stateless\r\n@Path(\"\/hello\")\r\npublic class Hello {\r\n\r\n\t@EJB\r\n\tprivate GreetEjb greetEjb;\r\n\r\n\t@GET\r\n\t@Produces(MediaType.TEXT_HTML)\r\n\tpublic String greet() {\r\n\t\treturn \"&lt;html&gt;&lt;h1&gt;\" + greetEjb.getGreet() + \"&lt;\/h1&gt;\";\r\n\t}\r\n}<\/pre>\n<h3>4.5 \u5b9f\u884c<\/h3>\n<p><a href=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/JavaEE7EJB_4D3\/ejb_success.png\"><img loading=\"lazy\" decoding=\"async\" title=\"ejb_success\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"ejb_success\" src=\"https:\/\/www.typea.info\/blog\/wp-content\/uploads\/image\/JavaEE7EJB_4D3\/ejb_success_thumb.png\" width=\"466\" height=\"264\"><\/a> <\/p>\n<p>\u6210\u529f\uff01\uff01<\/p>\n<p>\u4eca\u56de\u306f\u3001\u4ee5\u5916\u3068\u7c21\u5358\u306b\u52d5\u3044\u3066\u304f\u308c\u305f\uff01\u307e\u305a\u306f\u52a9\u304b\u308b\u3002<\/p>\n<p>\u3053\u306e\u672c\u306f\u3001\u308f\u304b\u308a\u3084\u3059\u304f\u3066\u3044\u3044\uff01Java EE 6 \u306e\u672c\u3060\u304c\u3001Java EE 7 \u81ea\u4f53\u304c\u3001Java EE 6 + \u306a\u306b\u304c\u3057\u3001\u3068\u306e\u3053\u3068\u306a\u306e\u3067\u3001\u307e\u305a\u306f Java EE 6 \u3092\u304a\u307c\u3048\u308b\u3079\u3057\u3068\u3001\u4e2d\u306e\u4eba\u3082\u3044\u3063\u3066\u3044\u305f\u3002<\/p>\n<p><iframe style=\"height: 240px; width: 120px\" marginheight=\"0\" src=\"http:\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&amp;bc1=FFFFFF&amp;IS2=1&amp;bg1=FFFFFF&amp;fc1=000000&amp;lc1=0000FF&amp;t=typea09-22&amp;o=9&amp;p=8&amp;l=as4&amp;m=amazon&amp;f=ifr&amp;ref=ss_til&amp;asins=4798124605\" frameborder=\"0\" marginwidth=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3053\u307e\u3067\u3001 Java EE 7 \u3092\u8a66\u3059\u305f\u3081\u306b CentOS \u306b GlassFish \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb Ubuntu \u306b GlassFish v4 \u306b\u3088\u308b Java EE 7 \u691c\u8a3c\u74b0\u5883\u3092\u3064\u304f\u308b Ubuntu \u306b Spring [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","sitemap_hide":"","_veu_custom_css":"","veu_display_promotion_alert":"","vkexunit_cta_each_option":"","footnotes":""},"categories":[68,65,46],"tags":[],"class_list":["post-389","post","type-post","status-publish","format-standard","hentry","category-ejb","category-glassfish","category-java-ee"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=389"}],"version-history":[{"count":0,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/posts\/389\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=389"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=389"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.typea.info\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}