public static synchronized int insertProviderAt ( Provider provider , int position ) { String providerName = provider . getName ( ) ; check ( "insertProvider." + providerName ) ; ProviderList list = Providers . getFullProviderList ( ) ; ProviderList newList = ProviderList . insertAt ( list , provider , position - 1 ) ; if ( list == newList ) { return - 1 ; } increaseVersion ( ) ; Providers . setProviderList ( newList ) ; return newList . getIndex ( providerName ) + 1 ; }
Adds a new provider at a specified position . The position is the preference order in which providers are searched for requested algorithms . The position is 1 - based that is 1 is most preferred followed by 2 and so on .