{"id":656,"date":"2019-02-07T17:55:45","date_gmt":"2019-02-07T08:55:45","guid":{"rendered":"http:\/\/idealive.jp\/blog\/?p=656"},"modified":"2019-02-07T18:01:08","modified_gmt":"2019-02-07T09:01:08","slug":"spring%e3%81%a7%e3%82%b9%e3%82%b1%e3%82%b8%e3%83%a5%e3%83%bc%e3%83%aa%e3%83%b3%e3%82%b0%e5%ae%9a%e6%9c%9f%e5%ae%9f%e8%a1%8c%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/idealive.jp\/blog\/2019\/02\/07\/spring%e3%81%a7%e3%82%b9%e3%82%b1%e3%82%b8%e3%83%a5%e3%83%bc%e3%83%aa%e3%83%b3%e3%82%b0%e5%ae%9a%e6%9c%9f%e5%ae%9f%e8%a1%8c%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b\/","title":{"rendered":"Spring\u3067\u30b9\u30b1\u30b8\u30e5\u30fc\u30ea\u30f3\u30b0(\u5b9a\u671f\u5b9f\u884c)\u3057\u3066\u307f\u308b"},"content":{"rendered":"<p>\u3053\u3093\u3070\u3093\u306f\u3000sohnishi\u3000\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306fSpring\u3067\u30bf\u30b9\u30af\u306e\u5b9a\u671f\u5b9f\u884c\u3092\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3068\u3066\u3082\u7c21\u5358\u306b\u5229\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Application.java\u306b<em><strong>@EnableScheduling <\/strong><\/em>\u3092\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\" title=\"Application.java\">package com.hoge;\r\n\r\nimport org.springframework.boot.SpringApplication;\r\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\r\nimport org.springframework.scheduling.annotation.EnableScheduling;\r\n@SpringBootApplication\r\n@EnableScheduling\r\npublic class HogeApplication extends SpringBootServletInitializer {\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tSpringApplication.run(HogeApplication.class, args);\r\n\r\n    }\r\n\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3042\u3068\u306f\u5b9a\u671f\u5b9f\u884c\u3057\u305f\u3044\u51e6\u7406\u306b<strong><i>@Scheduled\u00a0<\/i><\/strong>\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\" title=\"Hoge.java\">@Scheduled(initialDelay = 1, fixedDelay = 21600000)\r\npublic void hogeTask() {\r\n\tSystem.out.println(\"Hogehoge...\");\r\n}<\/pre>\n<p>\u3053\u306e\u4f8b\u3067\u306f\u6700\u521d\u306e\u5b9f\u884c\u30921\u79d2\u5f8c\u306b\u884c\u3044\u3001\u305d\u308c\u4ee5\u964d\u306f6\u6642\u9593\u6bce\u306b\u5b9f\u884c\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5358\u4f4d\u306fms\u306a\u306e\u3067\u30011\u79d2=1000ms\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u4ed6\u306b\u3082\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3044\u304f\u3064\u304b\u5b58\u5728\u3059\u308b\u306e\u3067\u3001\u305c\u3072\u8abf\u3079\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4ee5\u4e0a\u3001\u3068\u3063\u3066\u3082\u7c21\u5358\u306a\u5b9a\u671f\u5b9f\u884c\u306e\u3054\u7d39\u4ecb\u3067\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u3070\u3093\u306f\u3000sohnishi\u3000\u3067\u3059\u3002 \u4eca\u56de\u306fSpring\u3067\u30bf\u30b9\u30af\u306e\u5b9a\u671f\u5b9f\u884c\u3092\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002 \u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3068\u3066\u3082\u7c21\u5358\u306b\u5229\u7528\u3067\u304d\u307e\u3059\u3002 Application.java\u306b@EnableSchedul&#8230;<a class=\"read-more-link button\" href=\"https:\/\/idealive.jp\/blog\/2019\/02\/07\/spring%e3%81%a7%e3%82%b9%e3%82%b1%e3%82%b8%e3%83%a5%e3%83%bc%e3%83%aa%e3%83%b3%e3%82%b0%e5%ae%9a%e6%9c%9f%e5%ae%9f%e8%a1%8c%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b\/\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":3,"featured_media":659,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,18],"tags":[],"class_list":["post-656","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-spring"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts\/656"}],"collection":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/comments?post=656"}],"version-history":[{"count":1,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts\/656\/revisions"}],"predecessor-version":[{"id":657,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/posts\/656\/revisions\/657"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/media\/659"}],"wp:attachment":[{"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/media?parent=656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/categories?post=656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idealive.jp\/blog\/wp-json\/wp\/v2\/tags?post=656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}