@ Reference ( policy = ReferencePolicy . DYNAMIC , cardinality = ReferenceCardinality . MULTIPLE ) protected Map < String , Object > setAuthorization ( ServiceReference < AuthorizationService > ref ) { if ( hasPropertiesFromFile ( ref ) ) { String id = ( String ) ref . getProperty ( KEY_ID ) ; if ( id != null ) { authorization . putReference ( id , ref ) ; } else { Tr . error ( tc , "SECURITY_SERVICE_REQUIRED_SERVICE_WITHOUT_ID" , KEY_AUTHORIZATION ) ; } } else { authorization . putReference ( String . valueOf ( ref . getProperty ( KEY_SERVICE_ID ) ) , ref ) ; } // determine a new authorization service authzService . set ( null ) ; return getServiceProperties ( ) ; }
Method will be called for each AuthorizationService that is registered in the OSGi service registry . We maintain an internal map of these for easy access .