[
https://issues.apache.org/jira/browse/SLING-4417?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15170538#comment-15170538
]
ASF GitHub Bot commented on SLING-4417:
---------------------------------------
GitHub user ghenzler opened a pull request:
https://github.com/apache/sling/pull/127
SLING-4417 now the the default for immediate is false, it needs to be
explicitly provided here to ensure state is kept
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/ghenzler/sling trunk
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/sling/pull/127.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #127
----
commit 80ff77358d10583c851861423040b2ce5b31f1a3
Author: georg.henzler <[email protected]>
Date: 2016-02-27T10:30:37Z
SLING-4417 now the the default for immediate is false, it needs to be
explicitly provided here to ensure state is kept
----
> HC Annotation should allow to configure "immediate" SCR property
> ----------------------------------------------------------------
>
> Key: SLING-4417
> URL: https://issues.apache.org/jira/browse/SLING-4417
> Project: Sling
> Issue Type: New Feature
> Components: Health Check
> Reporter: Georg Henzler
> Assignee: Konrad Windszus
> Fix For: Health Check samples 1.0.8, Health Check Annotations
> 1.0.4
>
> Attachments:
> SLING-4417-HC-Annotation-with-immediate-setting-default-false.patch.txt,
> SLING-4417-HC-Annotation-with-immediate-setting.patch
>
>
> When using @SlingHealthCheck at the moment, the "immediate" property is left
> to "false" in the SCR descriptor which causes the component object to be
> created on every call of the health check (making it impossible to keep some
> state in a private member variable if desired).
> Let's make the immediate property configurable (the same way it would be
> provided in the @Component annotation) and make immediate="true" the default
> (this is a slight change in the behaviour that will not break existing code)
> for the following reasons:
> - It's more intuitive to think of a HC as singleton (and hence be able to
> keep some instance variables)
> - It's a tiny little bit better from a performance perspective (the instance
> does not have to be created on each execution)
> The attached patch includes the (fairly simple) change to
> annotation(-processor) and the change for two sample components that were
> using @Component because of this issue.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)