Set the passed Provider to be the default implementation for the protocol in Provider.protocol overriding any previous values. @param provider Currently configured Provider which will be set as the default for the protocol @exception NoSuchProviderException If the provider passed in is invalid.
(Provider provider)
| 529 | * is invalid. |
| 530 | */ |
| 531 | public synchronized void setProvider(Provider provider) |
| 532 | throws NoSuchProviderException { |
| 533 | if (provider == null) { |
| 534 | throw new NoSuchProviderException("Can't set null provider"); |
| 535 | } |
| 536 | providersByProtocol.put(provider.getProtocol(), provider); |
| 537 | providersByClassName.put(provider.getClassName(), provider); |
| 538 | props.put("mail." + provider.getProtocol() + ".class", |
| 539 | provider.getClassName()); |
| 540 | } |
| 541 | |
| 542 | |
| 543 | /** |
nothing calls this directly
no test coverage detected