Browse Source

Handle UnsupportedOperationException from getInstalledExtensions in Glassfish 4.0

pull/403/merge
Michael Irwin 11 years ago committed by Rossen Stoyanchev
parent
commit
467c770b4d
  1. 13
      spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFish40RequestUpgradeStrategy.java

13
spring-websocket/src/main/java/org/springframework/web/socket/server/support/GlassFish40RequestUpgradeStrategy.java

@ -17,11 +17,16 @@ @@ -17,11 +17,16 @@
package org.springframework.web.socket.server.support;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;
import javax.websocket.WebSocketContainer;
import org.glassfish.tyrus.core.EndpointWrapper;
import org.glassfish.tyrus.spi.SPIEndpoint;
import org.glassfish.tyrus.websockets.WebSocketApplication;
import org.springframework.util.ClassUtils;
import org.springframework.web.socket.support.WebSocketExtension;
/**
@ -34,6 +39,14 @@ import org.springframework.util.ClassUtils; @@ -34,6 +39,14 @@ import org.springframework.util.ClassUtils;
*/
public class GlassFish40RequestUpgradeStrategy extends AbstractGlassFishRequestUpgradeStrategy {
protected List<WebSocketExtension> getInstalledExtensions(WebSocketContainer container) {
try {
return super.getInstalledExtensions(container);
}
catch (UnsupportedOperationException e) {
return new ArrayList<WebSocketExtension>();
}
}
protected WebSocketApplication createTyrusEndpoint(EndpointWrapper endpoint) {
try {

Loading…
Cancel
Save