Closed nicolatimeus closed 4 years ago
Always before the unbind() invocation for the old service.
CloudSubscriber:
public void unsetCloudSubscriber(org.eclipse.kura.cloudconnection.subscriber.CloudSubscriber cloudSubscriber) { this.cloudSubscriber.unregisterCloudSubscriberListener(CloudSubscriber.this); if (this.cloudSubscriber == cloudSubscriber) this.cloudSubscriber = null; }
CloudPublisher:
public void unbindWireHelperService(final WireHelperService wireHelperService) { if (this.wireHelperService == wireHelperService) { this.wireHelperService = null; } }
Osgi DS spec [1] section 112.5.12 states that when a service instance bound using dynamic references is replaced with another one, the invocation of
bind()
method injecting the new service happens before theunbind()
invocation for the old service.We should check existing components that use this kind of references (e.g. wires publisher) to verify if their
bind()
/unbind()
implementations are compliant.[1] https://osgi.org/specification/osgi.cmpn/7.0.0/service.component.html