{"action":"created","comment":{"url":"https://api.github.com/repos/Jasig/cas/pulls/comments/34156520","id":34156520,"diff_hunk":"@@ -0,0 +1,188 @@\n+/*\n+ * Licensed to Apereo under one or more contributor license\n+ * agreements. See the NOTICE file distributed with this work\n+ * for additional information regarding copyright ownership.\n+ * Apereo licenses this file to you under the Apache License,\n+ * Version 2.0 (the \"License\"); you may not use this file\n+ * except in compliance with the License.  You may obtain a\n+ * copy of the License at the following location:\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied.  See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+package org.jasig.cas.services;\n+\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+\n+import java.io.File;\n+import java.io.IOException;\n+import java.nio.file.FileSystems;\n+import java.nio.file.Path;\n+import java.nio.file.WatchEvent;\n+import java.nio.file.WatchKey;\n+import java.nio.file.WatchService;\n+import java.util.Arrays;\n+import java.util.concurrent.atomic.AtomicBoolean;\n+import java.util.concurrent.locks.Lock;\n+import java.util.concurrent.locks.ReadWriteLock;\n+import java.util.concurrent.locks.ReentrantReadWriteLock;\n+\n+import static java.nio.file.StandardWatchEventKinds.*;\n+\n+/**\n+ * This is {@link JsonServiceRegistryConfigWatcher} that watches the json config directory\n+ * for changes and promptly attempts to reload the CAS service registry configuration.\n+ *\n+ * @author Misagh Moayyed\n+ * @since 4.1.0\n+ */\n+class JsonServiceRegistryConfigWatcher implements Runnable {","path":"cas-server-core/src/main/java/org/jasig/cas/services/JsonServiceRegistryConfigWatcher.java","position":47,"original_position":47,"commit_id":"beaab05916a34642cb991fdeb5a3319cb77eae61","original_commit_id":"beaab05916a34642cb991fdeb5a3319cb77eae61","user":{"login":"leleuj","id":1038508,"avatar_url":"https://avatars.githubusercontent.com/u/1038508?v=3","gravatar_id":"","url":"https://api.github.com/users/leleuj","html_url":"https://github.com/leleuj","followers_url":"https://api.github.com/users/leleuj/followers","following_url":"https://api.github.com/users/leleuj/following{/other_user}","gists_url":"https://api.github.com/users/leleuj/gists{/gist_id}","starred_url":"https://api.github.com/users/leleuj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leleuj/subscriptions","organizations_url":"https://api.github.com/users/leleuj/orgs","repos_url":"https://api.github.com/users/leleuj/repos","events_url":"https://api.github.com/users/leleuj/events{/privacy}","received_events_url":"https://api.github.com/users/leleuj/received_events","type":"User","site_admin":false},"body":"OK","created_at":"2015-07-08T14:53:51Z","updated_at":"2015-07-08T14:53:51Z","html_url":"https://github.com/Jasig/cas/pull/1005#discussion_r34156520","pull_request_url":"https://api.github.com/repos/Jasig/cas/pulls/1005","_links":{"self":{"href":"https://api.github.com/repos/Jasig/cas/pulls/comments/34156520"},"html":{"href":"https://github.com/Jasig/cas/pull/1005#discussion_r34156520"},"pull_request":{"href":"https://api.github.com/repos/Jasig/cas/pulls/1005"}}},"pull_request":{"url":"https://api.github.com/repos/Jasig/cas/pulls/1005","id":38397298,"html_url":"https://github.com/Jasig/cas/pull/1005","diff_url":"https://github.com/Jasig/cas/pull/1005.diff","patch_url":"https://github.com/Jasig/cas/pull/1005.patch","issue_url":"https://api.github.com/repos/Jasig/cas/issues/1005","number":1005,"state":"open","locked":false,"title":"Allow JsonSvcReg to auto-detect changes","user":{"login":"mmoayyed","id":1205228,"avatar_url":"https://avatars.githubusercontent.com/u/1205228?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoayyed","html_url":"https://github.com/mmoayyed","followers_url":"https://api.github.com/users/mmoayyed/followers","following_url":"https://api.github.com/users/mmoayyed/following{/other_user}","gists_url":"https://api.github.com/users/mmoayyed/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoayyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoayyed/subscriptions","organizations_url":"https://api.github.com/users/mmoayyed/orgs","repos_url":"https://api.github.com/users/mmoayyed/repos","events_url":"https://api.github.com/users/mmoayyed/events{/privacy}","received_events_url":"https://api.github.com/users/mmoayyed/received_events","type":"User","site_admin":false},"body":"Allows the JSON service registry to auto detect changes and reload the service registry using JDK7 APIs","created_at":"2015-06-24T00:29:53Z","updated_at":"2015-07-08T14:53:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"62db411dcbc2e54b23173f093b9ccbcaa0da38b2","assignee":null,"milestone":{"url":"https://api.github.com/repos/Jasig/cas/milestones/2","html_url":"https://github.com/Jasig/cas/milestones/4.1.0","labels_url":"https://api.github.com/repos/Jasig/cas/milestones/2/labels","id":721279,"number":2,"title":"4.1.0","description":"CAS 4.1.0 Release","creator":{"login":"mmoayyed","id":1205228,"avatar_url":"https://avatars.githubusercontent.com/u/1205228?v=3","gravatar_id":"","url":"https://api.github.com/users/mmoayyed","html_url":"https://github.com/mmoayyed","followers_url":"https://api.github.com/users/mmoayyed/followers","following_url":"https://api.github.com/users/mmoayyed/following{/other_user}","gists_url":"https://api.github.com/users/mmoayyed/gists{/gist_id}","starred_url":"https://api.github.com/users/mmoayyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmoayyed/subscriptions","organizations_url":"https://api.github.com/users/mmoayyed/orgs","repos_url":"https://api.github.com/users/mmoayyed/repos","events_url":"https://api.github.com/users/mmoayyed/events{/privacy}","received_events_url":"https://api.github.com/users/mmoayyed/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":347,"state":"open","created_at":"2014-07-15T06:16:10Z","updated_at":"2015-07-08T14:34:49Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Jasig/cas/pulls/1005/commits","review_comments_url":"https://api.github.com/repos/Jasig/cas/pulls/1005/comments","review_comment_url":"https://api.github.com/repos/Jasig/cas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Jasig/cas/issues/1005/comments","statuses_url":"https://api.github.com/repos/Jasig/cas/statuses/beaab05916a34642cb991fdeb5a3319cb77eae61","head":{"label":"Unicon:json-svc-detectchange","ref":"json-svc-detectchange","sha":"beaab05916a34642cb991fdeb5a3319cb77eae61","user":{"login":"Unicon","id":835400,"avatar_url":"https://avatars.githubusercontent.com/u/835400?v=3","gravatar_id":"","url":"https://api.github.com/users/Unicon","html_url":"https://github.com/Unicon","followers_url":"https://api.github.com/users/Unicon/followers","following_url":"https://api.github.com/users/Unicon/following{/other_user}","gists_url":"https://api.github.com/users/Unicon/gists{/gist_id}","starred_url":"https://api.github.com/users/Unicon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unicon/subscriptions","organizations_url":"https://api.github.com/users/Unicon/orgs","repos_url":"https://api.github.com/users/Unicon/repos","events_url":"https://api.github.com/users/Unicon/events{/privacy}","received_events_url":"https://api.github.com/users/Unicon/received_events","type":"Organization","site_admin":false},"repo":{"id":6410069,"name":"cas","full_name":"Unicon/cas","owner":{"login":"Unicon","id":835400,"avatar_url":"https://avatars.githubusercontent.com/u/835400?v=3","gravatar_id":"","url":"https://api.github.com/users/Unicon","html_url":"https://github.com/Unicon","followers_url":"https://api.github.com/users/Unicon/followers","following_url":"https://api.github.com/users/Unicon/following{/other_user}","gists_url":"https://api.github.com/users/Unicon/gists{/gist_id}","starred_url":"https://api.github.com/users/Unicon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Unicon/subscriptions","organizations_url":"https://api.github.com/users/Unicon/orgs","repos_url":"https://api.github.com/users/Unicon/repos","events_url":"https://api.github.com/users/Unicon/events{/privacy}","received_events_url":"https://api.github.com/users/Unicon/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Unicon/cas","description":"Jasig CAS - Single Sign On for the Web","fork":true,"url":"https://api.github.com/repos/Unicon/cas","forks_url":"https://api.github.com/repos/Unicon/cas/forks","keys_url":"https://api.github.com/repos/Unicon/cas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Unicon/cas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Unicon/cas/teams","hooks_url":"https://api.github.com/repos/Unicon/cas/hooks","issue_events_url":"https://api.github.com/repos/Unicon/cas/issues/events{/number}","events_url":"https://api.github.com/repos/Unicon/cas/events","assignees_url":"https://api.github.com/repos/Unicon/cas/assignees{/user}","branches_url":"https://api.github.com/repos/Unicon/cas/branches{/branch}","tags_url":"https://api.github.com/repos/Unicon/cas/tags","blobs_url":"https://api.github.com/repos/Unicon/cas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Unicon/cas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Unicon/cas/git/refs{/sha}","trees_url":"https://api.github.com/repos/Unicon/cas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Unicon/cas/statuses/{sha}","languages_url":"https://api.github.com/repos/Unicon/cas/languages","stargazers_url":"https://api.github.com/repos/Unicon/cas/stargazers","contributors_url":"https://api.github.com/repos/Unicon/cas/contributors","subscribers_url":"https://api.github.com/repos/Unicon/cas/subscribers","subscription_url":"https://api.github.com/repos/Unicon/cas/subscription","commits_url":"https://api.github.com/repos/Unicon/cas/commits{/sha}","git_commits_url":"https://api.github.com/repos/Unicon/cas/git/commits{/sha}","comments_url":"https://api.github.com/repos/Unicon/cas/comments{/number}","issue_comment_url":"https://api.github.com/repos/Unicon/cas/issues/comments{/number}","contents_url":"https://api.github.com/repos/Unicon/cas/contents/{+path}","compare_url":"https://api.github.com/repos/Unicon/cas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Unicon/cas/merges","archive_url":"https://api.github.com/repos/Unicon/cas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Unicon/cas/downloads","issues_url":"https://api.github.com/repos/Unicon/cas/issues{/number}","pulls_url":"https://api.github.com/repos/Unicon/cas/pulls{/number}","milestones_url":"https://api.github.com/repos/Unicon/cas/milestones{/number}","notifications_url":"https://api.github.com/repos/Unicon/cas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Unicon/cas/labels{/name}","releases_url":"https://api.github.com/repos/Unicon/cas/releases{/id}","created_at":"2012-10-26T20:34:46Z","updated_at":"2015-06-10T18:22:29Z","pushed_at":"2015-07-08T14:34:51Z","git_url":"git://github.com/Unicon/cas.git","ssh_url":"git@github.com:Unicon/cas.git","clone_url":"https://github.com/Unicon/cas.git","svn_url":"https://github.com/Unicon/cas","homepage":"http://www.jasig.org/cas","size":46818,"stargazers_count":23,"watchers_count":23,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":23,"mirror_url":null,"open_issues_count":0,"forks":23,"open_issues":0,"watchers":23,"default_branch":"master"}},"base":{"label":"Jasig:master","ref":"master","sha":"4a9acf5dadc197549d113287953e610667fea8b5","user":{"login":"Jasig","id":884285,"avatar_url":"https://avatars.githubusercontent.com/u/884285?v=3","gravatar_id":"","url":"https://api.github.com/users/Jasig","html_url":"https://github.com/Jasig","followers_url":"https://api.github.com/users/Jasig/followers","following_url":"https://api.github.com/users/Jasig/following{/other_user}","gists_url":"https://api.github.com/users/Jasig/gists{/gist_id}","starred_url":"https://api.github.com/users/Jasig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jasig/subscriptions","organizations_url":"https://api.github.com/users/Jasig/orgs","repos_url":"https://api.github.com/users/Jasig/repos","events_url":"https://api.github.com/users/Jasig/events{/privacy}","received_events_url":"https://api.github.com/users/Jasig/received_events","type":"Organization","site_admin":false},"repo":{"id":2352744,"name":"cas","full_name":"Jasig/cas","owner":{"login":"Jasig","id":884285,"avatar_url":"https://avatars.githubusercontent.com/u/884285?v=3","gravatar_id":"","url":"https://api.github.com/users/Jasig","html_url":"https://github.com/Jasig","followers_url":"https://api.github.com/users/Jasig/followers","following_url":"https://api.github.com/users/Jasig/following{/other_user}","gists_url":"https://api.github.com/users/Jasig/gists{/gist_id}","starred_url":"https://api.github.com/users/Jasig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jasig/subscriptions","organizations_url":"https://api.github.com/users/Jasig/orgs","repos_url":"https://api.github.com/users/Jasig/repos","events_url":"https://api.github.com/users/Jasig/events{/privacy}","received_events_url":"https://api.github.com/users/Jasig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Jasig/cas","description":"Apereo CAS - Single Sign On for the Web","fork":false,"url":"https://api.github.com/repos/Jasig/cas","forks_url":"https://api.github.com/repos/Jasig/cas/forks","keys_url":"https://api.github.com/repos/Jasig/cas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jasig/cas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jasig/cas/teams","hooks_url":"https://api.github.com/repos/Jasig/cas/hooks","issue_events_url":"https://api.github.com/repos/Jasig/cas/issues/events{/number}","events_url":"https://api.github.com/repos/Jasig/cas/events","assignees_url":"https://api.github.com/repos/Jasig/cas/assignees{/user}","branches_url":"https://api.github.com/repos/Jasig/cas/branches{/branch}","tags_url":"https://api.github.com/repos/Jasig/cas/tags","blobs_url":"https://api.github.com/repos/Jasig/cas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jasig/cas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jasig/cas/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jasig/cas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jasig/cas/statuses/{sha}","languages_url":"https://api.github.com/repos/Jasig/cas/languages","stargazers_url":"https://api.github.com/repos/Jasig/cas/stargazers","contributors_url":"https://api.github.com/repos/Jasig/cas/contributors","subscribers_url":"https://api.github.com/repos/Jasig/cas/subscribers","subscription_url":"https://api.github.com/repos/Jasig/cas/subscription","commits_url":"https://api.github.com/repos/Jasig/cas/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jasig/cas/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jasig/cas/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jasig/cas/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jasig/cas/contents/{+path}","compare_url":"https://api.github.com/repos/Jasig/cas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jasig/cas/merges","archive_url":"https://api.github.com/repos/Jasig/cas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jasig/cas/downloads","issues_url":"https://api.github.com/repos/Jasig/cas/issues{/number}","pulls_url":"https://api.github.com/repos/Jasig/cas/pulls{/number}","milestones_url":"https://api.github.com/repos/Jasig/cas/milestones{/number}","notifications_url":"https://api.github.com/repos/Jasig/cas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jasig/cas/labels{/name}","releases_url":"https://api.github.com/repos/Jasig/cas/releases{/id}","created_at":"2011-09-09T01:36:42Z","updated_at":"2015-07-08T13:51:56Z","pushed_at":"2015-07-08T14:34:49Z","git_url":"git://github.com/Jasig/cas.git","ssh_url":"git@github.com:Jasig/cas.git","clone_url":"https://github.com/Jasig/cas.git","svn_url":"https://github.com/Jasig/cas","homepage":"https://www.apereo.org/cas","size":500904,"stargazers_count":752,"watchers_count":752,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":567,"mirror_url":null,"open_issues_count":68,"forks":567,"open_issues":68,"watchers":752,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Jasig/cas/pulls/1005"},"html":{"href":"https://github.com/Jasig/cas/pull/1005"},"issue":{"href":"https://api.github.com/repos/Jasig/cas/issues/1005"},"comments":{"href":"https://api.github.com/repos/Jasig/cas/issues/1005/comments"},"review_comments":{"href":"https://api.github.com/repos/Jasig/cas/pulls/1005/comments"},"review_comment":{"href":"https://api.github.com/repos/Jasig/cas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Jasig/cas/pulls/1005/commits"},"statuses":{"href":"https://api.github.com/repos/Jasig/cas/statuses/beaab05916a34642cb991fdeb5a3319cb77eae61"}}}}