Skip to content

Commit

Permalink
Fix #254 - document behaviour on error in the Javadoc
Browse files Browse the repository at this point in the history
No change in behaviour. Just being more explicit so callers know what to
expect.

Signed-off-by: Mark Thomas <markt@apache.org>
  • Loading branch information
markt-asf committed May 17, 2020
1 parent af3e556 commit 1064c29
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -18,6 +18,7 @@
package jakarta.websocket;

import java.util.Iterator;
import java.util.ServiceConfigurationError;
import java.util.ServiceLoader;

/**
Expand All @@ -38,6 +39,10 @@ public abstract class ContainerProvider {
* WebSocketContainer implementation from the ContainerProvider implementation that is not {@code null}.
*
* @return an implementation provided instance of type WebSocketContainer
*
* @throws ServiceConfigurationError If there is a problem loading one of the discovered ContainerProvider
* implementations. A ServiceConfigurationError is viewed as a serious problem so the exception is allowed
* to propagate rather than swallowing the exception and attempting to load the next provider (if any).
*/
public static WebSocketContainer getWebSocketContainer() {
Iterator<ContainerProvider> providers = ServiceLoader.load(ContainerProvider.class).iterator();
Expand Down

0 comments on commit 1064c29

Please sign in to comment.