æ¯å¹ŽãJavaã¢ãžã¥ãŒã«åãããžã§ã¯ãã«ã€ããŠè³ã«ããŸãã ç§ãã¡ãåŸ ã€ãã³ã«ãç§ãã¡ã¯çºè¡šã«åŸããŸãã Jigsawã®æºåã¯ã»ãŒå®äºããŠãããšèšãããŠããŸããããªãªãŒã¹ãããã³ã«å»¶æãããŸãã ãã¶ããããã¯ãããªã«åçŽãªãããžã§ã¯ãã§ã¯ãªãã§ãããã ãã®å€æŽãã«ãŒãã®éçºã«åœ±é¿ããå¯èœæ§ã¯ãããŸããïŒ ãã¶ããã¢ãžã¥ã©ãŒã·ã¹ãã ã¯æ°·å±±ã®äžè§ã«ãããŸãããïŒ Ivan Krylovã«Jigsawãããžã§ã¯ãã«é¢é£ãã質åã«çããããã«äŸé ŒããŸããã
Ivanã¯10幎以äžã«ããã£ãŠJavaä»®æ³ãã·ã³ãšã³ã³ãã€ã©ãéçºããŠãããçŸåšãAzul Systemsã®Zingä»®æ³ãã·ã³ã§ã³ã³ãã€ã©ã€ã³ãã©ã¹ãã©ã¯ãã£ãéçºããŠããŸãã JUG.ruã«ã³ãã¡ã¬ã³ã¹ããã³ãã®ä»ã®ãšãŒãããã®Javaã«ã³ãã¡ã¬ã³ã¹ã§å®æçã«è¬æŒã
ãžã°ãœãŒãšã¯äœã§ããïŒãŸããJavaã®äžçã«ã©ã®ããã«åœ±é¿ããŸããïŒ
-ã€ã¯ã³ãããã«ã¡ã¯ã Jigsawãããžã§ã¯ããJavaãšã³ã·ã¹ãã ã«äžãã圱é¿ãæããŠãã ããã
-ãããã Javaãšã¢ãžã¥ãŒã«æ§ã«ã€ããŠã®ç§ã®èŠè§£ã説æããããã«ãç§ã®ä»äºã«ã€ããŠå°ã話ããã䟡å€ããããŸãã ç§ã¯çŽ20幎éåçšããã°ã©ãã³ã°ã«æºãã£ãŠããŸããã ãããã®æåŸã®11-ä»®æ³ãã·ã³ã®éçºã 圌ã¯ãSunã®HotSpot RuntimeããŒã ã§åããŠããŸããã ãã®åŸãå瀟ã¯Oracleã«è²·åãããŸããã ãã®åŸãã¢ã¯ãã£ããã£ã«ããã€ãã®å€æŽããããéå»3幎åã®éãä»®æ³ãã·ã³ãéçºããŠããAzul Systemsã§åããŠããŸããã
ããããã¹ãŠã¯ãç§ã®æ©èœã®èŠæ¹ã¯ãJVMéçºè ãã€ãŸããè¡ãªãŸãããäŒæ¥ãã®äžçããååã«é ã人ã§ãããé«ã¬ãã«ã®æœè±¡åã®éçºè ãçŽé¢ããåé¡ã ãšããããšã§ãã
Jigsawã®Javaãšã³ã·ã¹ãã ãžã®åœ±é¿ã®è³ªåã«æ»ããŸãããæåã¯ãã®åœ±é¿ã¯èŠããã»ã©å€§ãããããŸããã ãããããéçºè ãã¢ãžã¥ãŒã«ãã©ãã€ã ã«åãæ¿ããããªãå Žåãåãæ¿ããªãå¯èœæ§ããããŸãã å šäœãšããŠã³ãŒãããã³ã¹ã³ãŒããšå¯Ÿè©±ããå€ãæ¹æ³ãæ©èœããŸãã éçºè ãã³ãŒããã¢ãžã¥ãŒã«ã«è»¢éããããšãããšãã«åé¡ãçºçããŸãããä»ã®ã³ãŒãã¯ãŸã ã¢ãžã¥ãŒã«åŒã€ã³ãã©ã¹ãã©ã¯ãã£ã«ç§»æ€ãããŠããŸããã
OSGiã¡ã«ããºã ã䜿çšãããšãä»ã®åé¡ãçºçããŸããJigsawäŸåé¢ä¿ã¡ã«ããºã ã«åãæ¿ãããå Žåããããã®äŸåé¢ä¿ãèšè¿°ãã2ã€ã®æ¹æ³ãç¶æããã®ã¯é£ãããããããŸãããããããã¯ããŸããŸãªç¹æ®ãªã±ãŒã¹ã§ãã äžè¬çã«ãå€ãã®éçºè ã«ãšã£ãŠãJigsawãããžã§ã¯ãã¯éåžžã«ç®ç«ããªãããã«ééãããããããããäžçäžã®èª°ã«ãšã£ãŠãæ®éçãªçãã¯ãããŸããã
-Java 8ã§ã®äž»ãªé©æ°ã¯ãã©ã ãåŒãšStream APIã§ãã Jigsawãšæ¯èŒããŠãã©ã®ãããªéèŠãªå€æŽç¹ããããŸããïŒ
-Jigsawãããžã§ã¯ãã®ã¢ãžã¥ãŒã«ã¯ãã³ãŒãã®èšè¿°ããã³ã³ãŒãã®æ©èœã·ãŒã±ã³ã¹ã«å€§ããªåœ±é¿ãäžããŸããã Jigsawã¯ãããŸããŸãªã³ã³ããŒãã³ãéã®çžäºäœçšãã©ã®ããã«èŠå®ãããããæœè±¡åã®åäœã§ã³ãŒããã©ã®ããã«ã©ããããããæ åœããŸãã Java 9ã§ã¯ãé©æ°çã§ããããä»æ¥ã®éçºè ãã³ãŒããæžãæ¹æ³ã倧ããå€ããæ°ããAPIã®èšç»ã¯ãããŸããã
ããçš®ã®é²åçãªå€æŽããããŸããããšãã°ãJava 8ã§Optionalãç»å Žãããªãã·ã§ã³ã®Java 9ã«Streamãthe ãŸã㯠methodãžã®ã³ã³ããŒã¿ãªã©ã®ããã€ãã®ã¡ãœãããè¿œå ãããŸãããããããã¯å¢åå€æŽã§ãã è¿œå ããå¿ èŠããããšæããŸãã-è¿œå ããŸããã ããã»ã¹APIã®å€§å¹ ãªå€æŽãããã«ãããä»®æ³ãã·ã³ã®PIDãèŠã€ããããã»ã¹ããªãŒãããã»ã¹å¶åŸ¡ãååŸã§ããŸãã Process APIã䜿çšãããšããã€ã¹ãããå¿ èŠãããç¹å®ã®æ°ã®ããã¯ãåãé€ãããšãã§ããŸããããšãã°ã解æåºåãŸãã¯ä»ã®ã¡ãœããã䜿çšããã·ã§ã«åŒã³åºãããã€ãã£ãã«å ¥ãå¥ã®å¿ èŠæ§ã¯ãªããªããŸãã ãã®ãããªã€ã³ã¯ãªã¡ã³ã¿ã«ãªå€æŽã¯ã¯ã©ã¹ã©ã€ãã©ãªã³ãŒãå šäœã«æ£åšããŠããŸãããAPIã«ã³ãŒãã1ã€ã匷åãªæ§æã1ã€ããããŸããã
ãã¹ãŠã®ã»ãã³ãã£ãã¯ã®å€æŽã¯ã Milling Project Coinã§åéãããŸãã æãé¡èãªã®ã¯ããããããã©ã€ããŒãïŒããã©ã«ãïŒã€ã³ã¿ãŒãã§ãŒã¹ã¡ãœããã®å€èŠ³ã§ãã 2ã€ã®ãã©ã€ããŒãã€ã³ã¿ãŒãã§ã€ã¹ã¡ãœããã«å ±éã®ã³ãŒããå«ãŸããŠããç¶æ³ãæ³åããŠãã ããã 以åã¯ããã®ãããªã³ãŒãã¯ãããªãã¯ã¡ãœããã«ã®ã¿è»¢éã§ããŸãããããã®ã€ã³ã¿ãŒãã§ã€ã¹ãæäŸãããããªãã¯APIã®èŠ³ç¹ããã¯ããã®ãããªã¡ãœããã¯æå³ããªããªãå ŽåããããŸãã ããã§ããã®ãããªã¡ãœããããã©ã€ããŒããšããŠå®£èšã§ããŸãã ãã®ã¡ãœããã¯ããã®ã€ã³ã¿ãŒãã§ã€ã¹ã®APIã®äžéšãšããŠè¡šç€ºãããŸãããããããã®ããã©ã«ãã¡ãœããå ã§å®è£ ãå®å šã«äœ¿çšã§ããŸãã ãã®å€æŽã«ãããã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšããŠæäŸããAPIãããã¯ãªãŒã³ã«ããããšãã§ããç¹ã«ããã®ã€ã³ã¿ãŒãã§ã€ã¹ã®ã¡ãœããã®ããã©ã«ãå®è£ ãæäŸã§ããŸãã
-ã¢ãžã¥ãŒã«åãããžã§ã¯ãã¯çŽ9幎åããååšããŠããããªãªãŒã¹æ¥ã¯è€æ°å延æãããŠããŸãã JavaOne 2015ã«ã³ãã¡ã¬ã³ã¹ã§ããã®ãããã¯ã¯è€æ°ã®ã¹ããŒã«ãŒïŒAlan BatemanãAlex BuckleyãMark ReinholdïŒã«ãã£ãŠè¡šåœ°ãããŸããã ãã®ãããªè奮ã¯ããããžã§ã¯ãã®éèŠæ§ã瀺ããŠããŸããïŒ
-Jigsawãããžã§ã¯ãã«ãããç¹å®ã®å€æŽãè¡ãããŸããã ç§ã¯ãžã°ãœãŒããºã«ãããã€ãã®2ã€ã®æ§æèŠçŽ ãšèããŠããŸãã1ã€ç®ã¯ãå¯èŠæ§ã¢ãã«ã®èšèªãã¢ãžã¥ãŒã«å®£èšãæ§æã®å€æŽã§ãã 2çªç®ã®éšåã¯ãã¢ãžã¥ãŒã«ã¢ãã«ãjdkã®ã¯ã©ã¹ã©ã€ãã©ãªã«çŽæ¥é©çšããæ¹æ³ã§ãã äžéšã®ã¯ã©ã¹ã¯ç§»åããä»ã®ã¯ã©ã¹ã¯å»æ¢ãããããå€éšããèŠããªããªããŸããã
倧ããªè°è«ã¯ãåå°ã¡ã«ããºã ã«ã€ããŠã§ããã 以åã¯ããã©ã€ããŒãã¯ã©ã¹ãšã¡ãœããã«æãå·®ã䌞ã¹ãããšãã§ããŸããã ãã£ãŒã«ãã®å€æŽã¯ããªãã¬ã¯ã·ã§ã³ãšãã©ã€ãã·ãŒã«ããããªã³ã¶ãã©ã€ã§å®è¡ã§ããŸããã ã€ãŸããå€æ°ã®ã©ã€ãã©ãªã§äœ¿çšãããŠãããšã¯ã¹ããã€ããå©çšå¯èœã§ããããšç§ã¯èšããŸãã ããã¯æçµçã«ãŠãŒã¶ãŒã«åœ±é¿ããŸãã ããªãããªã¹ãããèšèªã¢ãŒããã¯ãã¯ã³ãã¥ããã£ã«è¡ããã©ããªå€åãèµ·ããã®ãããªãèµ·ããã®ãããªãããªãã¯ãããã®èŠçãªå€æŽãããå¿ èŠãããã®ãââã«ã€ããŠè©±ããŸããã çã¿ã¯ãç¹å®ã®æ°ã®ã©ã€ãã©ãªãŒãããã«èªåçã«éäºæã«ãªãããšã§ãã 圌ããã³ãŒããããäºææ§ã®ããããŒãžã§ã³ã«å€æããã®ã«ã¯æéãããããŸãããéåžžã®ããã«ãããšãã°ã9çªç®ã®ããŒãžã§ã³ã«åãæ¿ãããšãã¹ãŠãå£ããããªã©ã®ãã€ãºã䌎ããŸãã ãããã®èª¬æãå¿ èŠã§ããã
æšå¹Žã®ãžã°ãœãŒã«é¢ããå€æ°ã®ã¬ããŒãã¯JavaOneã«é¢ãããã®ã§ãã¢ã³ãã¯ãŒãã®Devoxxã«é¢ããã¬ããŒããšã»ãŒåãã§ããã ã¬ããŒãã¯åãã«ãªããŸãããéšå€è ããã¯èå³æ·±ããã®ã«ãªããŸããããšãã°ãIBMã®æ åœè ã¯ãã¢ãžã¥ãŒã«ã«åãæ¿ããåŸã«çåœããããã©ãããæããŠãããŸãã JavaOne 2016ã®ãããªã楜ãã¿ã«ããŠæ¥œãã¿ã«ããŠããŸãã
-æ°ããã³ã³ã»ããã¯ã¢ãžã¥ãŒã«ã§ãã ã¢ãžã¥ãŒã«ã®ãã³ã³ããŒãã³ããéšåãæ£ãã解éããæ¹æ³ïŒã¢ãžã¥ãŒã«åããšã¯ã¹ããŒããããã³èŠæ±ïŒ ãrequiresãã«ã€ããŠè©³ãã説æãããrequires localãããrequires optionalããªã©ãå®éã«ãrequiresãã§ããããšãç解ãããã®ã§ããã
-ç°¡åãªæ¬ã®äŸããå§ããŸããããæ¢åã®ã³ãŒãããªãããŒãããäœæããç¶æ³ã§ãã ã¯ã©ã¹ããããããããç°ãªãããã±ãŒãžã«é 眮ããããããå¯æ¥ãªæ確ãªã³ãã¥ãã±ãŒã·ã§ã³ãæããªãããšã決å®ãããããã¯ç°ãªãã¢ãžã¥ãŒã«ã«ãããŸãã æåã®ã¢ãžã¥ãŒã«ã®ã¯ã©ã¹ã2çªç®ã®ã¢ãžã¥ãŒã«ã®ã¯ã©ã¹ãå¿ èŠãšããå Žåãç§ã¯ãããå¿ èŠã§ãããã€ãŸãrequireã§ãããšèšãããã®ã¢ãžã¥ãŒã«ã¯2ã§ãã ãã©ã®ããã±ãŒãžãå¿ èŠãã瀺ããŸãã ããã±ãŒãžãã¯ã©ã¹ã¬ãã«ã§æœè±¡åã管çããã¢ãžã¥ãŒã«ãããã±ãŒãžã¬ãã«ã®éå±€ã管çããå Žåãéå±€å šäœã¯éåžžã«å³å¯ã§ããããã«ã¯ expression ãå¿ èŠ ã§ãã
æ€èšŒã¯ãã³ã³ãã€ã«æãšå®è¡æã®äž¡æ¹ã§çºçããŸããããã¯ãJavaèšèªã®ä»ã®èŠçŽ ã§ããçºçããããã§ãã JVMã¯ããã¹ãŠã®ãã§ãã¯ã«åæ Œããããšãä¿èšŒã§ããŸãããæ£çŽã«èšã£ãŠãã³ã³ãã€ã«ã¬ãã«ã§ã¯ããã€ãã³ãŒãã¯ã©ãããã§ãæ¥ãå¯èœæ§ããããããå€ãã®ç¹ã§javacãšJVMã©ã³ã¿ã€ã ã¬ãã«ã®äž¡æ¹ã§ãã§ãã¯ãè€è£œãããŸãã ãã®ã¢ãžã¥ãŒã«ãæ©èœããããã«å¿ èŠãªããã±ãŒãžã䜿çšå¯èœã§ããããšã確èªããå¿ èŠããããŸãããããã®ããã±ãŒãžã¯ãã¢ãžã¥ãŒã«2ãŸãã¯ã¢ãžã¥ãŒã«3ã«ãããŸãã ããããé çªã«ä»ã®ã¢ãžã¥ãŒã«ãå¿ èŠãšããå Žåã察å¿ããã¢ãžã¥ãŒã«ããå¿ èŠãªãã¹ãŠã®ããã±ãŒãžãå©çšå¯èœã§ããããšãäœæ¥ã®æåã«æåéãæ€èšŒããããã«ããã®ãããªæšç§»çãªãã§ãŒã³ãæ§ç¯ãããŸãã
次ã«ã ãšã¯ã¹ããŒãã¯å¯èŠæ§ã®ã¡ã«ããºã ã§ãã 圌ã¯ããã®ã¢ãžã¥ãŒã«ããã®ãããªããã±ãŒãžãä»ã®ã¢ãžã¥ãŒã«ã«æäŸãããšèšã£ãŠããŸãã ãã¹ãŠã®äººãäžåºŠã«æ¡ä»¶ä»ãã*ãã§ããããšãæå®ã§ããŸããããã¯ããã®ã¢ãžã¥ãŒã«ã䜿çšããä»ã®ãã¹ãŠã®ã¢ãžã¥ãŒã«ãããã±ãŒãžã䜿çšã§ããããšã瀺ããŸãã ããã¯ããŠãŒã¶ãŒã絶察ã«ãã¹ãŠã®ã¯ã©ã¹ã«ã¢ã¯ã»ã¹ã§ããããšãæå³ããã®ã§ã¯ãªãããããªãã¯ãšå®£èšãããã¯ã©ã¹ã®ã¿ãã€ãŸã ãšã¹ã±ãŒãããããã®ã¯ããã®ã¡ã«ããºã ãéããŠä»ã®ã¢ãžã¥ãŒã«ã§å©çšå¯èœã«ãªããŸãã æå®ããã¢ãžã¥ãŒã«ã«çŽæ¥ãšã¯ã¹ããŒãããããšãã«ãšã¯ã¹ããŒããæå®ã§ããŸããä»ã®èª°ããã®éç宣èšã¡ã«ããºã ãå¿ èŠãšããŸããã
ããã«ãæ¢ã«ã³ã³ãã€ã«ãããã¢ãžã¥ãŒã«ã®åŒã³åºãæã«ãããã®ã¹ã³ãŒããå€æŽã§ããããã«ããç¹å®ã®ã©ã³ã¿ã€ã ãã©ã°ããããããã¢ãžã¥ãŒã«ãåæ§ç¯ããå¿ èŠã¯ãããŸããã äœæ¥ãæåãããããã®ååãªãšã¯ã¹ããŒãããªãã£ãå Žåãã³ãã³ãã©ã€ã³ã§è¿œå ã§ããŸãããçè«çã«ã¯ãã¹ãŠã®å®£èšãã¢ãžã¥ãŒã«å ã«ãããããããã¯äžé段éãšèŠãªãããŸãã ã€ãŸã ã¢ãžã¥ãŒã«ã¯ããã®ã¢ãžã¥ãŒã«ã«å¿ èŠãªãã®ãšããã§ãªããã®ãããã³äœ¿çšããããã«ä»ã®ã¢ãžã¥ãŒã«ã«æäŸãããã®ã宣èšããç¹å®ã®å®æãããŠãããã§ãã
ååãšããŠãjdkã©ã€ãã©ãªã®ã»ããå šäœãæ確ãªäŸåé¢ä¿ãæã€ã¢ãžã¥ãŒã«ã®ã»ãããè¡šãããã«ãjdkèªäœãåæ§ç¯ãããŠããŸãã ãã®çµæãç¹å®ã®ãµãã»ããjreãæ§ç¯ã§ããŸãããã®å Žåãå¿ èŠãªã¢ãžã¥ãŒã«ã®ã¿ãååšããŸãã ãã®ç¹ã§ãjlinkãŠãŒãã£ãªãã£ãç»å ŽããŸãããããã«ãããå¿ èŠãªã¢ãžã¥ãŒã«ããã®ã¿ã©ã³ã¿ã€ã ã€ã¡ãŒãžãæ§ç¯ã§ããŸãã ããã¯ããããã¡ã€ã«ä»ãã®Java 8ã§ç»å Žããã¢ã€ãã¢ã®æ確ãªéçºã§ãã jdk 8ã§ã¯ãããŸããŸãªã¯ã©ã¹ãšããŸããŸãªéã®æ©èœãåããããŸããŸãªãããã¡ã€ã«ã®jdkãæ§ç¯ã§ããŸããããããã¯ãããšãã°ãã¢ããªã±ãŒã·ã§ã³ãæ¬åœã«å¿ èŠãšãããã®ããã§ãã¯ããã«éçã¢ã»ã³ããªã§ãã ãŸããjlinkã䜿çšãããšãä»®æ³ãã·ã³ãjava.baseã¢ãžã¥ãŒã«ãã¢ããªã±ãŒã·ã§ã³ã§å¿ èŠãªä»ã®ã¢ãžã¥ãŒã«ã§æ§æãããããŒã¿ãã«ã©ã³ã¿ã€ã ãæ§ç¯ã§ããŸãã
ãããã¬ãŒã³ããŒã·ã§ã³ã§ã¯ ãJava 9ã®ã¢ãžã¥ãŒã«ã«é¢ããæ¬ã®èè Paul BakkerãšSander MakãããŸããŸãªäŸãæããŸããã å¿ èŠãªã©ã³ã¿ã€ã ãåããåçŽãªããã¹ãã¢ãã©ââã€ã¶ãŒããã°ã©ã ã®ããŒãžã§ã³ãçµã¿ç«ãŠãŸãã-çŽ20ã¡ã¬ãã€ãã®ãã£ã¹ããªãã¥ãŒã·ã§ã³ãåŸãŸããã ã¹ã€ã³ã°ãŠã£ã³ããŠãã¢ããªã±ãŒã·ã§ã³ã«è¿œå ããããšããæ°ããã¢ãžã¥ãŒã«ãè¿œå ããããã®ãããªé åžã®ãµã€ãºã¯50ã¡ã¬ãã€ãã«å¢å ããŸããã JDKã®å éšã«ãããjdkã§æäŸãããã¢ãžã¥ãŒã«ã«å ããŠããµãŒãããŒãã£ã®ã©ã€ãã©ãªã¢ãžã¥ãŒã«ãè¿œå ã§ãããããJDKã©ã€ãã©ãªã®å¢çã¯å¡ãã€ã¶ãããŠããŸãã ãã®ãããªååžã¯ããŸã£ããç°ãªãæ¹æ³ã§ãŸãšããããŸãã ããã«ãããããã°ã©ã ãæ°ããæ¹æ³ã§åé åžã§ããŸãã顧客ãæ°ããããŒãžã§ã³ã®jdkãããŠã³ããŒãããŠããŠã³ããŒãããå¿ èŠã¯ãªããçµã¿ç«ãŠãããã©ã³ã¿ã€ã ã«çŽæ¥é ä¿¡ããå¿ èŠããããŸãã
-ã äŸåæ§å°ç ãã®åé¡ãæ°žé ã«å¿ããããšã¯ã§ããŸããïŒ
-å®éã®ãããã¯ã·ã§ã³ã·ã¹ãã ã§ã¯ãéåžžã«å€ãã®ã¯ã©ã¹ãã¹ã衚瀺ãããããšãå€ããå€æ°ã®jarããªã¹ããããããã³ã³ãã€ã«ãããã³ãŒããé 眮ããããã£ã¬ã¯ããªã衚瀺ãããŸãã å€ãã®å Žåãåãããã±ãŒãžã®åãã¯ã©ã¹ãã¯ã©ã¹ã§å®£èšãããã©ã³ã¿ã€ã ã¯ã¯ã©ã¹ãã¹ã«è¡šç€ºãããŠãããã®ã䜿çšããŸãã ãã®ç¹ã§ãå€ãã®äººã ã¯ãã®ãããªåé¡ã«æ°ã¥ããŸãããã¯ã©ã¹ãã¹ã®jarã®å Žæã®å€æŽã«ããããã°ã©ã ã®åäœãå€æŽããããšããããã¯ã«ãŒãã®ã¢ãžã¥ãŒã«ã®å©ããåããŠè§£æ±ºãããŸãã
ããã¯æ¬¡ã®ããã«çºçããŸããã¯ã©ã¹ãããã±ãŒãžã«é 眮ããŠããå Žåã1ã€ã®ããã±ãŒãžã§1ã€ã®ã¢ãžã¥ãŒã«ã宣èšã§ããŸãã ãããã£ãŠãããšãã°ã2ã€ã®jarã«2ã€ã®ã¢ãžã¥ãŒã«ããããäž¡æ¹ã«ããã±ãŒãžèŠçŽ ãå«ãŸããŠããå Žåãããã±ãŒãžã¯çŸåšã¢ãžã¥ãŒã«ã®1ã€ã«å±ããŠãããšæ³å®ãããããããã®ç¶æ³ã¯äžå¯èœã§ãã åã¢ãžã¥ãŒã«ã¯ããã±ãŒãžãäžæã«å®£èšããŸãã åæã«ããžã°ãœãŒããºã«ã¯ããŒãžã§ã³ç®¡çã®åé¡ã解決ããŸããã Linuxãªã©ã®ããã±ãŒãžãããŒãžã£ãŒã§èŠæ £ããŠããæå³ã§ã®ããŒãžã§ã³ã®å¯Ÿå¿ã
ã¢ãžã¥ãŒã«ã®ããŒãžã§ã³ç®¡çã®ã¿ã¹ã¯ã¯ã以åã¯ä»¥åã®ããŒãžã§ã³ã«ãããŸãããããã®åŸåé€ãããŸãããã§ããããšã¯ãããŒãžã§ã³ãã¡ã¿ããŒã¿ã«æžã蟌ãããšã ãã§ãã ãã®ã¡ã¿ããŒã¿ã¯æœåºã§ããŸãããã¯ã©ã¹ããŒãã£ã³ã°ã¡ã«ããºã èªäœã¯è¿œå ã®ãã§ãã¯ãè¡ãããOSGiãªã©ä»ã®ããã±ãŒãžãããŒãžã£ãŒã®æã«å§ããããŸãã ããã¯èšç®äžã®å°é£ã«ãããã®ã§ãã ããã¯ãã¯ã©ã¹ããŒããŒãäžããããªãè€éãªã¿ã¹ã¯ãªã®ã§ãå€éšããŒã«ã«è»¢éãããŸããã
-ããŸããŸãªã¿ã€ãã®ã¢ãžã¥ãŒã«ã衚瀺ãããŸãïŒååä»ãã¢ãžã¥ãŒã«ãååã®ãªãã¢ãžã¥ãŒã«ãèªåã¢ãžã¥ãŒã«ã ãããã«ã€ããŠç°¡åã«è©±ããŠããããŸããïŒ åœŒãã®éãã¯äœã§ããïŒãŸãã誰ããå šäœçãªæ§é ã«äœããããããŸããïŒ
-ãã¹ãŠã®ã«ãŒã«ã«åŸã£ãŠã¢ãžã¥ãŒã«ããæåãããèšè¿°ããå Žåãã€ãŸããã¢ãžã¥ãŒã«ã®ååã§æäžäœãã£ã¬ã¯ããªã«çœ®ãå Žåãã¢ãžã¥ãŒã«ã®å®£èšãå«ãmodule-info.javaãã¡ã€ã«ãè¿œå ããŸãããã®ãã¡ã€ã«ã«ã¯ããã£ã¬ã¯ããªã®ååãšäžèŽããååãå¿ èŠã§ãã 茞åºããªã¹ãã ããå¿ èŠãšããŸã ã ãã®ãããªã¢ãžã¥ãŒã«ã¯ãéåžžã®ååä»ãã¢ãžã¥ãŒã«ã§ãã
æãªããã®æ¹æ³ã§çããŠããŠãã¯ã©ã¹ãã¹ãä»ããŠæããã ãã®ã¯ã©ã¹ãããå Žåããããã¯ååã®ãªãã¢ãžã¥ãŒã«ãšåŒã°ããã¢ãžã¥ãŒã«ã«ããªããŸãã ãããã£ãŠãååãä»ããªãã£ãã¢ãžã¥ãŒã«ã«ã¯ãååã®ãªãæåŸã®é¿é£æããããŸããããã¯ã9ã€ã¯ã¢ãžã¥ãŒã«ãªãã§ã¯æ©èœã§ããªãããã§ãã
ããäžé段éããããŸããããšãã°ãjarãã¡ã€ã«ããããããã€ãã®ããã±ãŒãžãå«ãŸããŠããå Žåãã¯ã©ã¹ãã¹ã§ã¯ãªãã¢ãžã¥ãŒã«ãã¹ã«é 眮ãããšãã©ã³ã¿ã€ã ã¯ãã®ãã¡ã€ã«ãjarãšããååãšäžèŽããã¢ãžã¥ãŒã«ãšããŠæ³åãå§ããŸã-fileã䜿çšãããšãNamedã¢ãžã¥ãŒã«ã®å Žåãšåæ§ã®æäœãåŒãç¶ãå®è¡ã§ãããããåç §ã§ããŸãã
ããšãã°ãååä»ãã¢ãžã¥ãŒã«ãéçºããŠããå Žåã ãŸã ã¢ãžã¥ãŒã«æ§é ã«å€æãããŠããªãã©ã€ãã©ãªã«äŸåããŠããå Žåããã®ã©ã€ãã©ãªãå«ãjarãã¢ãžã¥ãŒã«ãã¹ã«é 眮ã§ããŸãã èªåã¢ãžã¥ãŒã«ã«ãªããŸãã ããã§ã module-info.java ïŒ requiresãåç §ããŠããã ããã«èªåçã«å²ãåœãŠãããã¢ãžã¥ãŒã«ã®ååãåç §ã§ããŸãã
ãããŠæåŸã«ãããæ°é±éã§è¡ãããæåŸã®å€æŽã§ããããã®ææ¡ãåãå ¥ãããããã©ããã¯ãŸã æ確ã§ã¯ãããŸããã å°ãåã«ããªãã¬ã¯ã·ã§ã³ã«ç¹å®ã®åé¡ãããããšãæ¢ã«è¿°ã¹ãŸããã以åã«äœãã«æãå·®ã䌞ã¹ãããšãã§ããå Žåãä»ã§ã¯ä»®æ³ãã·ã³ã¬ãã«ã§ä¿è·ããããæ°ããã³ã³ã»ãããåºçŸããŠããŸãããçŸåšéçºäžã§ãããæšæºã«èœã¡ãå¯èœæ§ããããŸããããã¯ä¿èšŒãããŠããŸãããã匱ãã¢ãžã¥ãŒã«ã§ãã
匱ãã¢ãžã¥ãŒã«ã¯ããã®ã¢ãžã¥ãŒã«å ã®ã³ãŒããã¯ã©ã¹ãä»ããŠååä»ãã¢ãžã¥ãŒã«å ã®ã¯ã©ã¹ãžã®ãªãã¬ã¯ã·ã§ã³ã«å°éã§ããäžéç¶æ ã§ãããæ£ãããšã¯ã¹ããŒããããŠããªãã¯ã©ã¹ã«ããå°éã§ããŸãããåæã«ãã®ãããªã¢ãžã¥ãŒã«èªäœã¯ãã®æ©èœãå€éšã«ãšã¯ã¹ããŒãã§ããŸããã ããã¯ããã®ç§»è¡æéãééããããã«ç¹å¥ã«è¡ããããã®ã§ããªãã¬ã¯ã·ã§ã³ãééããŠå éšã³ãŒãã«å°éããå¿ èŠããããŸãããããã¯æ¬æ¥ãããç®çãšããŠããŸããã§ããã
æéãçµã€ã«ã€ããŠã匱ãã¢ãžã¥ãŒã«ã®äœ¿çšã¯ç¡é§ã«ãªãããããããããã°ã®ç®çã§æ®ã£ãŠãããšæããŸãã èªåã¢ãžã¥ãŒã«ãšåæ§ã«ãããã¯ã¢ãžã¥ãŒã«åãããŠããªãã³ãŒãããã¢ãžã¥ãŒã«åãããã³ãŒããžã®ç§»è¡ãå¯èœã«ããäžéã¡ã«ããºã ã§ãã
OSGi察ãžã°ãœãŒããºã«ïŒããªããŒã©ã¯ãããŸãã
-ãªãOSGiã¯Javaã®ã¢ãžã¥ãŒã«åã«æ¿èªãããªãã£ãã®ã§ããïŒ ããªãã¯ããŒã¯ã»ã©ã€ã³ããŒã«ãã«åæããŸãïŒãOSGiã¢ãžã¥ãŒã«å±€ã¯ã³ã³ãã€ã«æã«åäœããŸããã ããã±ãŒãžåãå±éãããã³å®è¡äžã®ã¢ãžã¥ãŒã«æ§ã®ã¿ã«å¯Ÿå¿ããŸãã ããã«ãã©ã€ãã©ãªããã³ã¢ããªã±ãŒã·ã§ã³ã¢ãžã¥ãŒã«ã«ã¯äŸ¿å©ã§ãããJava SEãã©ãããã©ãŒã äžã«å³å¯ã«æ§ç¯ãããŠããããããã©ãããã©ãŒã èªäœã®ã¢ãžã¥ãŒã«åã«äœ¿çšããããšã¯ã§ããŸãããïŒã OSGi /ãžã°ãœãŒã€ã³ã¿ã©ã¯ã·ã§ã³çšã®ãã³ããŒãºãããžã§ã¯ãããããŸãã ïŒOSGiã¢ãžã¥ã©ãŒã¬ã€ã€ãŒã¯ãã³ã³ãã€ã«æã«ã¯æ©èœããŸãããã¢ãŒã«ã€ãããããã€ããŸãã¯å®è¡äžã®ã¢ãžã¥ãŒã«æ§ã®ã¿ãæããŸãããŸããOSGiã®åœ¢åŒã§ã¯ãã©ã€ãã©ãªããã³ã¢ããªã±ãŒã·ã§ã³ã¢ãžã¥ãŒã«ã«åœ¹ç«ã¡ãŸãããå³å¯ã«äœæãããããJava SEãã©ãããã©ãŒã ã«åºã¥ããŠããããã®ãã©ãããã©ãŒã ãå€èª¿ããããã«äœ¿çšããããšã¯ã§ããŸããïŒèè ã®ç¿»èš³ããŒãïŒã
-ç§ã¯å ·äœçã«OSGiãç 究ããŸãããããªãOSGiããžã°ãœãŒããºã«ã«ãªããªãã£ãã®ãã«ã€ããŠäžå®ã®æèŠããããŸããã è¡šé¢äžã®æåã®çãã¯ããŒã¯ã»ã©ã€ã³ããŒã«ãã«ãã£ãŠããŒã¯ãããŸããïŒã¡ã«ããºã èªäœã¯Java SEä»æ§ã®äžã«èšè¿°ãããŠããŸããJavaSEãã©ã°ã¡ã³ããã€ãŸãã¢ãžã¥ãŒã«ãæäŸãããå ŽåãOSGiã¡ã«ããºã ã¯åœ¹ã«ç«ããªãã®ã§ãäžäœã¬ãã«ã§äœããå¿ èŠã§ãã äžè¬ã«ãOSGiã¯ã¯ã©ã¹ããŒãã£ã³ã°ã¡ã«ããºã ãä»ããŠæ©èœããŸããã€ãŸããæåã«å ±éã®OSGiç°å¢ã¯ã©ã¹ããŒããŒã1ã€è¡šç€ºããã次ã«åãã³ãã«OSGiã«ç¬èªã®ã¯ã©ã¹ããŒããŒããããŸããããã«ãããã¯ã©ã¹ã®å¯èŠæ§ãæ確ã«åºå¥ãããŸãã
Jigsawã¡ã«ããºã ã¯åæ§ã®æ©èœãæäŸããŸããããã§ã«ä»®æ³ãã·ã³ã¬ãã«ã§å®è¡ãããŠãããããä»®æ³ãã·ã³èªäœã®ããã©ãŒãã³ã¹ã«ãšã£ãŠã¯ååã«éèŠã§ãã ä»®æ³ãã·ã³å ã§ãã¯ã©ã¹ãã·ãŒã±ã³ã¹ãä»ããŠã¢ãã¬ã¹æå®ãããã®ã¯ç§å¯ã§ã¯ãããŸããïŒã¯ã©ã¹ããŒããŒã次ã«ããã±ãŒãžãšã¯ã©ã¹åããã®ãã¢ãä»ããŠã ãŸããããã±ãŒãžãšã¯ã©ã¹åãããã«å¯Ÿå¿ããç¹å®ã®æååãªãã©ã«ã§ããå Žåãã¯ã©ã¹ããŒããŒã¯åã«ã¯ã©ã¹ãããŒããããªããžã§ã¯ããžã®åç §ã§ãã ãããã£ãŠãæ°žç¶åã®å Žåã«åæããã«ã¯ãä»®æ³ãã·ã³ãå®äºãã次ã®ããŒãã§ãã®ããŒã¿ãå埩ããããšãããšããã®åç §ã¯æå³ã倱ããã¯ã©ã¹ããŒããŒã«ã¯ç¬èªã®æååãªãã©ã«ããããŸããã ããã¯ããã®ãããªäºåã®ã¹ã¿ã€ã«ã§ã®äœæ¥ã®æé©åã«å¶éã課ããŸãã ãã®ãããJigsawã®éçºè ã¯ãOSGiã§è¡ãããŠããããã«ãã¯ã©ã¹ã®ããŒãã¡ã«ããºã ã«åºã¥ããŠãã®å¯èŠæ§ã¡ã«ããºã ã®ããŒã¹ãæŸæ£ããããšã«ããŸããã OSGiããããè¡ã£ãã®ã¯ãä»®æ³ãã·ã³ãæäŸãããã®ããå ¥æã§ããå¯äžã®ãã®ã§ãããã¯ã©ã¹è§£æ±ºã¡ã«ããºã ã«å¹²æžã§ããªãããã§ãã
-OSGiãšJigsawã®å®éã®å®è£ ã¯ç°ãªãã¬ãã«ã«ããããšãå€æããŸããã
ãã¯ãã絶察ã«æ£ãããã ãžã°ãœãŒããºã«ã¯äœã¬ãã«ã§å®è£ ãããŠããŸãã 幞éã«ãäžå¹žã«ãã ãããããæ®å¿µãªããããã§ã«OSGiã䜿çšããããšããã人ãã¡ã«ãšã£ãŠã¯ã ããã§ãäœããã®æ¹æ³ã§çžäºäœçšãããã2ã€ã®äžŠè¡ããäŸåé¢ä¿ã®èšè¿°ãç¶æããããPenroseã®ãããªãããžã§ã¯ãã䜿çšããŠåæããå¿ èŠããããŸãã èšè¿°ã¯ãã¢ãžã¥ãŒã«èšè¿°ãäŸåé¢ä¿ã®ãžã°ãœãŒèšè¿°ãããã³OSGièšè¿°ãçæã§ããJSONã¹ã¯ãªããã䜿çšããŠèšå®ãããŸãã ãããã®2ã€ã®äžçã暪æããå¿ èŠããããçŸåšOSGiã䜿çšããŠãããŠãŒã¶ãŒã¯ãããå°ãå°é£ãªç掻ãéã£ãŠããŸãã
-ã¯ã©ã¹ããŒããŒã®åäœã«ã©ã®ãããªå€æŽãçºçããŸããïŒ
-å€æŽã¯ããã»ã©å€§ãããããŸããã , , Bootstrap classloader, Extension classloader Application classloader, instance of URL classloader. Java 9 , Extension classloader Platform classloader , Extension , jdk, . Java 9 , , Bootstrap classloader, Platform classloader. , Application classloader, instance of URL classloader, instance . , , Gradle, , instance of URL classloader â . Gradle Jigsaw .
, , , Gradle, . , Application classloader'. .
, , , â .
, â , , , .. , Whole Program Optimization, , .. , jit- . , , Oracle ahead of time jmod, , . , , , .
: ,
â ?
â , Jigsaw , . , , - requires . , , , , «Hello World». -: requires exports. , , , , , , .
, , . IDE, , , .
, private -, . javac , , . , , , , class resolution, , , , . ã€ãŸã , .
â , IDE «Jigsaw». , . ?
â , , , , module , StackOverflow Google , .
IDE: , IDEA, «», , Jigsaw. , IDE, , IDE , .. «».
â Jigsaw â «». , ?
â , OSGi, , , , , . , , , .
Java 8 jdep , jdk, Java 9 jar module-info.java , , , requires . Jdep module-info.java, , , .. , , jdep .
, , , .
Java 9 Joker 2016 Sander Mak, Java 9 Modularity O'Reilly, Java 9 Modularity in Action .
«» JVM Java 9 , , Joker 2016:
- JITã³ãŒãã®ã©ã€ããµã€ã¯ã«
- Javaããã¢ã»ã³ããªãŒãžïŒãŠãµã®ã®ç©Ž
- Elbrusäžã®Java
- HotSpot InternalsïŒã»ãŒããã€ã³ããNullPointersãããã³StackOverflow
- JMM-
- G1 GC, G1 GC
- Native , Off-heap Java
â .