{"action":"created","comment":{"url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/comments/56815442","id":56815442,"diff_hunk":"@@ -35,26 +43,43 @@\n  *\n  * This cache also listens for {@link VariantCompletedEvent} event and stops all instantiated {@link ApnsService}s and frees the cache.\n  *\n- * @see AbstractServiceCache#dequeueOrCreateNewService(String, String, ServiceConstructor)\n- * @see AbstractServiceCache#queueFreedUpService(String, String, Object)\n- * @see AbstractServiceCache#freeUpSlot(String, String)\n+ * @see AbstractServiceHolder#dequeueOrCreateNewService(String, org.jboss.aerogear.unifiedpush.api.Variant, org.jboss.aerogear.unifiedpush.message.cache.AbstractServiceHolder.ServiceConstructor)\n+ * @see AbstractServiceHolder#queueFreedUpService(String, org.jboss.aerogear.unifiedpush.api.Variant, Object)\n+ * @see AbstractServiceHolder#freeUpSlot(String, org.jboss.aerogear.unifiedpush.api.Variant)\n  */\n @ApplicationScoped\n-public class ApnsServiceCache extends AbstractServiceCache<ApnsService> {\n+public class ApnsServiceHolder extends AbstractServiceHolder<ApnsService> {\n \n-    private final AeroGearLogger logger = AeroGearLogger.getInstance(ApnsServiceCache.class);\n+    private final AeroGearLogger logger = AeroGearLogger.getInstance(ApnsServiceHolder.class);\n \n     public static final int INSTANCE_LIMIT = 10;\n-    public static final long INSTANCE_ACQUIRING_TIMEOUT = 5000;\n+    public static final long INSTANCE_ACQUIRING_TIMEOUT = 7500;\n+    public static final long DISPOSING_DELAY = 5000;\n \n     @Inject\n     private ClientInstallationService clientInstallationService;\n \n-    public ApnsServiceCache() {\n-        super(INSTANCE_LIMIT, INSTANCE_ACQUIRING_TIMEOUT);\n+    @Resource(mappedName = \"java:/queue/APNsBadgeLeaseQueue\")\n+    private Queue apnsBadgeLeaseQueue;","path":"push/sender/src/main/java/org/jboss/aerogear/unifiedpush/message/serviceLease/ApnsServiceHolder.java","position":63,"original_position":63,"commit_id":"5c3f7e089e87939f76732b22500bfe9ffd4d4c2d","original_commit_id":"5c3f7e089e87939f76732b22500bfe9ffd4d4c2d","user":{"login":"lfryc","id":425792,"avatar_url":"https://avatars.githubusercontent.com/u/425792?v=3","gravatar_id":"","url":"https://api.github.com/users/lfryc","html_url":"https://github.com/lfryc","followers_url":"https://api.github.com/users/lfryc/followers","following_url":"https://api.github.com/users/lfryc/following{/other_user}","gists_url":"https://api.github.com/users/lfryc/gists{/gist_id}","starred_url":"https://api.github.com/users/lfryc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfryc/subscriptions","organizations_url":"https://api.github.com/users/lfryc/orgs","repos_url":"https://api.github.com/users/lfryc/repos","events_url":"https://api.github.com/users/lfryc/events{/privacy}","received_events_url":"https://api.github.com/users/lfryc/received_events","type":"User","site_admin":false},"body":"@matzew in https://github.com/lfryc/aerogear-unifiedpush-server/pull/16#discussion_r56665027\r\n> badge... is that a good name ? :)","created_at":"2016-03-21T12:42:47Z","updated_at":"2016-03-21T12:42:47Z","html_url":"https://github.com/aerogear/aerogear-unifiedpush-server/pull/696#discussion_r56815442","pull_request_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/696","_links":{"self":{"href":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/comments/56815442"},"html":{"href":"https://github.com/aerogear/aerogear-unifiedpush-server/pull/696#discussion_r56815442"},"pull_request":{"href":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/696"}}},"pull_request":{"url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/696","id":63557836,"html_url":"https://github.com/aerogear/aerogear-unifiedpush-server/pull/696","diff_url":"https://github.com/aerogear/aerogear-unifiedpush-server/pull/696.diff","patch_url":"https://github.com/aerogear/aerogear-unifiedpush-server/pull/696.patch","issue_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/issues/696","number":696,"state":"open","locked":false,"title":"limit APNs cluster workers - leasing of the permission to push for APNs AGPUSH-1413","user":{"login":"lfryc","id":425792,"avatar_url":"https://avatars.githubusercontent.com/u/425792?v=3","gravatar_id":"","url":"https://api.github.com/users/lfryc","html_url":"https://github.com/lfryc","followers_url":"https://api.github.com/users/lfryc/followers","following_url":"https://api.github.com/users/lfryc/following{/other_user}","gists_url":"https://api.github.com/users/lfryc/gists{/gist_id}","starred_url":"https://api.github.com/users/lfryc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfryc/subscriptions","organizations_url":"https://api.github.com/users/lfryc/orgs","repos_url":"https://api.github.com/users/lfryc/repos","events_url":"https://api.github.com/users/lfryc/events{/privacy}","received_events_url":"https://api.github.com/users/lfryc/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-21T12:41:38Z","updated_at":"2016-03-21T12:42:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"87c46b285eb7d45c7200d379d93c1451148aee47","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/696/commits","review_comments_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/696/comments","review_comment_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/issues/696/comments","statuses_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/statuses/5c3f7e089e87939f76732b22500bfe9ffd4d4c2d","head":{"label":"lfryc:AGPUSH-1413-clustering-apns-service-holder","ref":"AGPUSH-1413-clustering-apns-service-holder","sha":"5c3f7e089e87939f76732b22500bfe9ffd4d4c2d","user":{"login":"lfryc","id":425792,"avatar_url":"https://avatars.githubusercontent.com/u/425792?v=3","gravatar_id":"","url":"https://api.github.com/users/lfryc","html_url":"https://github.com/lfryc","followers_url":"https://api.github.com/users/lfryc/followers","following_url":"https://api.github.com/users/lfryc/following{/other_user}","gists_url":"https://api.github.com/users/lfryc/gists{/gist_id}","starred_url":"https://api.github.com/users/lfryc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfryc/subscriptions","organizations_url":"https://api.github.com/users/lfryc/orgs","repos_url":"https://api.github.com/users/lfryc/repos","events_url":"https://api.github.com/users/lfryc/events{/privacy}","received_events_url":"https://api.github.com/users/lfryc/received_events","type":"User","site_admin":false},"repo":{"id":19145815,"name":"aerogear-unifiedpush-server","full_name":"lfryc/aerogear-unifiedpush-server","owner":{"login":"lfryc","id":425792,"avatar_url":"https://avatars.githubusercontent.com/u/425792?v=3","gravatar_id":"","url":"https://api.github.com/users/lfryc","html_url":"https://github.com/lfryc","followers_url":"https://api.github.com/users/lfryc/followers","following_url":"https://api.github.com/users/lfryc/following{/other_user}","gists_url":"https://api.github.com/users/lfryc/gists{/gist_id}","starred_url":"https://api.github.com/users/lfryc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lfryc/subscriptions","organizations_url":"https://api.github.com/users/lfryc/orgs","repos_url":"https://api.github.com/users/lfryc/repos","events_url":"https://api.github.com/users/lfryc/events{/privacy}","received_events_url":"https://api.github.com/users/lfryc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lfryc/aerogear-unifiedpush-server","description":"AeroGear UnifiedPush Server","fork":true,"url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server","forks_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/forks","keys_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/teams","hooks_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/hooks","issue_events_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/issues/events{/number}","events_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/events","assignees_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/assignees{/user}","branches_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/branches{/branch}","tags_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/tags","blobs_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/statuses/{sha}","languages_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/languages","stargazers_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/stargazers","contributors_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/contributors","subscribers_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/subscribers","subscription_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/subscription","commits_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/contents/{+path}","compare_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/merges","archive_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/downloads","issues_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/issues{/number}","pulls_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/pulls{/number}","milestones_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/milestones{/number}","notifications_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/labels{/name}","releases_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/releases{/id}","deployments_url":"https://api.github.com/repos/lfryc/aerogear-unifiedpush-server/deployments","created_at":"2014-04-25T12:51:04Z","updated_at":"2015-04-16T10:50:51Z","pushed_at":"2016-03-21T12:41:08Z","git_url":"git://github.com/lfryc/aerogear-unifiedpush-server.git","ssh_url":"git@github.com:lfryc/aerogear-unifiedpush-server.git","clone_url":"https://github.com/lfryc/aerogear-unifiedpush-server.git","svn_url":"https://github.com/lfryc/aerogear-unifiedpush-server","homepage":"aerogear.org","size":17233,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"aerogear:master","ref":"master","sha":"59f224758ae49ab288100b8a056e3a936366bbbb","user":{"login":"aerogear","id":954205,"avatar_url":"https://avatars.githubusercontent.com/u/954205?v=3","gravatar_id":"","url":"https://api.github.com/users/aerogear","html_url":"https://github.com/aerogear","followers_url":"https://api.github.com/users/aerogear/followers","following_url":"https://api.github.com/users/aerogear/following{/other_user}","gists_url":"https://api.github.com/users/aerogear/gists{/gist_id}","starred_url":"https://api.github.com/users/aerogear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerogear/subscriptions","organizations_url":"https://api.github.com/users/aerogear/orgs","repos_url":"https://api.github.com/users/aerogear/repos","events_url":"https://api.github.com/users/aerogear/events{/privacy}","received_events_url":"https://api.github.com/users/aerogear/received_events","type":"Organization","site_admin":false},"repo":{"id":10624930,"name":"aerogear-unifiedpush-server","full_name":"aerogear/aerogear-unifiedpush-server","owner":{"login":"aerogear","id":954205,"avatar_url":"https://avatars.githubusercontent.com/u/954205?v=3","gravatar_id":"","url":"https://api.github.com/users/aerogear","html_url":"https://github.com/aerogear","followers_url":"https://api.github.com/users/aerogear/followers","following_url":"https://api.github.com/users/aerogear/following{/other_user}","gists_url":"https://api.github.com/users/aerogear/gists{/gist_id}","starred_url":"https://api.github.com/users/aerogear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerogear/subscriptions","organizations_url":"https://api.github.com/users/aerogear/orgs","repos_url":"https://api.github.com/users/aerogear/repos","events_url":"https://api.github.com/users/aerogear/events{/privacy}","received_events_url":"https://api.github.com/users/aerogear/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aerogear/aerogear-unifiedpush-server","description":":rocket: AeroGear UnifiedPush Server","fork":false,"url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server","forks_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/forks","keys_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/teams","hooks_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/hooks","issue_events_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/issues/events{/number}","events_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/events","assignees_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/assignees{/user}","branches_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/branches{/branch}","tags_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/tags","blobs_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/statuses/{sha}","languages_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/languages","stargazers_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/stargazers","contributors_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/contributors","subscribers_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/subscribers","subscription_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/subscription","commits_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/contents/{+path}","compare_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/merges","archive_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/downloads","issues_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/issues{/number}","pulls_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls{/number}","milestones_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/milestones{/number}","notifications_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/labels{/name}","releases_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/releases{/id}","deployments_url":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/deployments","created_at":"2013-06-11T15:48:01Z","updated_at":"2016-03-21T08:14:06Z","pushed_at":"2016-03-21T12:41:38Z","git_url":"git://github.com/aerogear/aerogear-unifiedpush-server.git","ssh_url":"git@github.com:aerogear/aerogear-unifiedpush-server.git","clone_url":"https://github.com/aerogear/aerogear-unifiedpush-server.git","svn_url":"https://github.com/aerogear/aerogear-unifiedpush-server","homepage":"http://aerogear.org/push","size":18292,"stargazers_count":263,"watchers_count":263,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":119,"mirror_url":null,"open_issues_count":4,"forks":119,"open_issues":4,"watchers":263,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/696"},"html":{"href":"https://github.com/aerogear/aerogear-unifiedpush-server/pull/696"},"issue":{"href":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/issues/696"},"comments":{"href":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/issues/696/comments"},"review_comments":{"href":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/696/comments"},"review_comment":{"href":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/pulls/696/commits"},"statuses":{"href":"https://api.github.com/repos/aerogear/aerogear-unifiedpush-server/statuses/5c3f7e089e87939f76732b22500bfe9ffd4d4c2d"}}}}