[
https://issues.apache.org/jira/browse/SLING-6702?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15939847#comment-15939847
]
Chetan Mehrotra commented on SLING-6702:
----------------------------------------
[~fmeschbe] The Metrics instance created from MetricService are usable (in the
sense no exception would be thrown) even if backing Sling MetricService gets
recycled. However those Metric instances would not be registered with newer
MetricsRegistry.
bq. Maybe a wrapper implementation hiding this in the background and
automatically rewiring when the service comes back, might help.
That would be tricky. Note that currently MetricsServiceImpl is not using any
OSGi config and has no required dependency on any other service. If support is
added later we can add support for modified callback and prevent it from
getting unregistering. So probably if keep such a design it should be ok.
Thoughts?
> Make MetricsService accessible as easily as a Logger
> ----------------------------------------------------
>
> Key: SLING-6702
> URL: https://issues.apache.org/jira/browse/SLING-6702
> Project: Sling
> Issue Type: Improvement
> Components: Extensions
> Affects Versions: Commons Metrics 1.2.0
> Reporter: Bertrand Delacretaz
> Assignee: Bertrand Delacretaz
> Priority: Minor
> Fix For: Commons Metrics 1.2.2
>
>
> Metrics are useful in all classes, not only OSGi components, so getting the
> {{MetricsService}} should be as useful as getting a {{Logger}} for example.
> I'll add a public {{MetricsServiceFactory}} class to our metrics module,
> usable like
> {code}
> MetricsService ms =
> MetricsServiceFactory.getMetricsService(this.getClass());
> {code}
> There's already a private {{MetricsServiceFactory}} class in that module,
> I'll rename that to {{InternalMetricsServiceFactory}} to avoid confusion.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)