protected Map < String , Object > unsetAuthentication ( ServiceReference < AuthenticationService > ref ) { authentication . removeReference ( ( String ) ref . getProperty ( KEY_ID ) , ref ) ; authentication . removeReference ( String . valueOf ( ref . getProperty ( KEY_SERVICE_ID ) ) , ref ) ; // determine a new authentication service authnService . set ( null ) ; return getServiceProperties ( ) ; }
Method will be called for each AuthenticationService that is unregistered in the OSGi service registry . We must remove this instance from our internal map .