[ 
https://issues.apache.org/jira/browse/SLING-6578?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15889802#comment-15889802
 ] 

Felix Meschberger edited comment on SLING-6578 at 3/1/17 9:03 AM:
------------------------------------------------------------------

I think we should still use the service.pid. According to the spec:

     The purpose of a Persistent Identifier (PID) is to identify a service 
across Framework restarts. Ser-
     vices that can reference the same underlying entity every time they are 
registered should therefore
     use a service property that contains a PID. The name of the service 
property for PID is defined as
     service.pid. The PID is a unique identifier for a service that persists 
over multiple invocations of the
     Framework. For a given service, the same PID should always be used. If the 
bundle is stopped and
     later started, the same PID must always be used.

     The format of the PID should be:
        pid ::= symbolic-name                   // See 1.3.2

Yes, it is optional. But it serves to stably identify the service across 
restarts. Of course you can go ahead and reinvent wheels and define a new 
service property which is expected to be set. But this is exactly the same: It 
is optional and may or may not exist.

Why not just define: service.pid is used. If missing, the service is ignored -- 
which is correct anyway as the service is not "addressable"

Also: I am not entirely sure the SLING-5839 case really applies to this 
discussion.


was (Author: fmeschbe):
I think we should still use the service.pid. According to the spec:

     The purpose of a Persistent Identifier (PID) is to identify a service 
across Framework restarts. Ser-
     vices that can reference the same underlying entity every time they are 
registered should therefore
     use a service property that contains a PID. The name of the service 
property for PID is defined as
     service.pid. The PID is a unique identifier for a service that persists 
over multiple invocations of the
     Framework. For a given service, the same PID should always be used. If the 
bundle is stopped and
     later started, the same PID must always be used.

     The format of the PID should be:
        pid ::= symbolic-name                   // See 1.3.2

Yes, it is optional. But it serves to stably identify the service across 
restarts. Of course you can go ahead and reinvent wheels and define a new 
service property which is expected to be set. But this is exactly the same: It 
is optional and may or may not exist.

Why not just define: service.pid is used. If missing, the service is ignored -- 
which is correct anyway as the service is not "addressable"

> Use "service.pid" property instead of class name to reference validators
> ------------------------------------------------------------------------
>
>                 Key: SLING-6578
>                 URL: https://issues.apache.org/jira/browse/SLING-6578
>             Project: Sling
>          Issue Type: Improvement
>            Reporter: Konrad Windszus
>            Assignee: Konrad Windszus
>
> Leveraging the component's "service.pid" property value instead of its 
> classname is more stable (even if implementation changes, the PID might stay 
> the same) and also allows for configuration factories to refer to a specific 
> validator configuration.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to