public void unregisterFhirProviders ( FhirProviderBundle bundle , Map < String , Object > props ) throws FhirConfigurationException { if ( bundle != null ) { Collection < Object > providers = bundle . getProviders ( ) ; if ( providers != null && ! providers . isEmpty ( ) ) { try { registeredProviders . remove ( providers ) ; String serverName = ( String ) props . get ( FhirServer . SVCPROP_SERVICE_NAME ) ; String ourServerName = getServerName ( serverName ) ; FhirServer server = registeredServers . get ( ourServerName ) ; if ( server != null ) { server . unregisterOsgiProviders ( providers ) ; Collection < Collection < Object > > active = serverProviders . get ( serverName ) ; if ( active != null ) { active . remove ( providers ) ; } } } catch ( BadServerException e ) { throw new FhirConfigurationException ( "Unable to register the OSGi FHIR Provider. Multiple Restful Servers exist. Specify the [" + FhirServer . SVCPROP_SERVICE_NAME + "] service-property" ) ; } } } }
This method will be called when a FHIR Provider OSGi service is being removed from the container . This normally will only occur when its bundle is stopped because it is being removed or updated .