Polishing
This commit is contained in:
@@ -428,7 +428,7 @@ public abstract class ClassUtils {
|
||||
* @see java.beans.Introspector#decapitalize(String)
|
||||
*/
|
||||
public static String getShortNameAsProperty(Class<?> clazz) {
|
||||
String shortName = ClassUtils.getShortName(clazz);
|
||||
String shortName = getShortName(clazz);
|
||||
int dotIndex = shortName.lastIndexOf(PACKAGE_SEPARATOR);
|
||||
shortName = (dotIndex != -1 ? shortName.substring(dotIndex + 1) : shortName);
|
||||
return Introspector.decapitalize(shortName);
|
||||
@@ -498,7 +498,7 @@ public abstract class ClassUtils {
|
||||
StringBuilder result = new StringBuilder();
|
||||
while (clazz.isArray()) {
|
||||
clazz = clazz.getComponentType();
|
||||
result.append(ClassUtils.ARRAY_SUFFIX);
|
||||
result.append(ARRAY_SUFFIX);
|
||||
}
|
||||
result.insert(0, clazz.getName());
|
||||
return result.toString();
|
||||
@@ -1222,7 +1222,7 @@ public abstract class ClassUtils {
|
||||
* @see org.springframework.aop.support.AopUtils#isCglibProxy(Object)
|
||||
*/
|
||||
public static boolean isCglibProxy(Object object) {
|
||||
return ClassUtils.isCglibProxyClass(object.getClass());
|
||||
return isCglibProxyClass(object.getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,21 +60,20 @@ import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
import org.springframework.web.socket.server.HandshakeFailureException;
|
||||
|
||||
|
||||
/**
|
||||
* RequestUpgradeStrategy for WildFly and its underlying Undertow web
|
||||
* server. Also compatible with embedded Undertow usage.
|
||||
* A WebSocket {@code RequestUpgradeStrategy} for WildFly and its underlying
|
||||
* Undertow web server. Also compatible with embedded Undertow usage.
|
||||
*
|
||||
* <p>Compatible with Undertow 1.0 to 1.3 and also 1.3.5+ - as included in
|
||||
* WildFly 8.x, 9 and 10.
|
||||
* <p>Designed for Undertow 1.3.5+ as of Spring Framework 4.3, with a fallback
|
||||
* strategy for Undertow 1.0 to 1.3 - as included in WildFly 8.x, 9 and 10.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.0.1
|
||||
*/
|
||||
public class UndertowRequestUpgradeStrategy extends AbstractStandardUpgradeStrategy {
|
||||
|
||||
private static final boolean HAS_DO_UPGRADE = ClassUtils.hasMethod(ServerWebSocketContainer.class,
|
||||
"doUpgrade", (Class<?>[]) null);
|
||||
private static final boolean HAS_DO_UPGRADE = ClassUtils.hasMethod(ServerWebSocketContainer.class, "doUpgrade",
|
||||
HttpServletRequest.class, HttpServletResponse.class, ServerEndpointConfig.class, Map.class);
|
||||
|
||||
private static final FallbackStrategy FALLBACK_STRATEGY = (HAS_DO_UPGRADE ? null : new FallbackStrategy());
|
||||
|
||||
@@ -108,8 +107,7 @@ public class UndertowRequestUpgradeStrategy extends AbstractStandardUpgradeStrat
|
||||
endpointConfig.setExtensions(selectedExtensions);
|
||||
|
||||
try {
|
||||
getContainer(servletRequest).doUpgrade(servletRequest, servletResponse,
|
||||
endpointConfig, pathParams);
|
||||
getContainer(servletRequest).doUpgrade(servletRequest, servletResponse, endpointConfig, pathParams);
|
||||
}
|
||||
catch (ServletException ex) {
|
||||
throw new HandshakeFailureException(
|
||||
@@ -121,8 +119,7 @@ public class UndertowRequestUpgradeStrategy extends AbstractStandardUpgradeStrat
|
||||
}
|
||||
}
|
||||
else {
|
||||
FALLBACK_STRATEGY.upgradeInternal(request, response, selectedProtocol,
|
||||
selectedExtensions, endpoint);
|
||||
FALLBACK_STRATEGY.upgradeInternal(request, response, selectedProtocol, selectedExtensions, endpoint);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,10 +192,8 @@ public class UndertowRequestUpgradeStrategy extends AbstractStandardUpgradeStrat
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private final Set<WebSocketChannel> peerConnections;
|
||||
|
||||
|
||||
public FallbackStrategy() {
|
||||
if (exchangeConstructorWithPeerConnections) {
|
||||
this.peerConnections = Collections.newSetFromMap(new ConcurrentHashMap<WebSocketChannel, Boolean>());
|
||||
@@ -208,7 +203,6 @@ public class UndertowRequestUpgradeStrategy extends AbstractStandardUpgradeStrat
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String[] getSupportedVersions() {
|
||||
return VERSIONS;
|
||||
|
||||
Reference in New Issue
Block a user