Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -72,25 +72,23 @@ public abstract class AbstractHandshakeHandler implements HandshakeHandler, Life
|
||||
private static final Charset UTF8_CHARSET = Charset.forName("UTF-8");
|
||||
|
||||
|
||||
private static final ClassLoader classLoader = AbstractHandshakeHandler.class.getClassLoader();
|
||||
|
||||
private static final boolean jettyWsPresent = ClassUtils.isPresent(
|
||||
"org.eclipse.jetty.websocket.server.WebSocketServerFactory", classLoader);
|
||||
"org.eclipse.jetty.websocket.server.WebSocketServerFactory", AbstractHandshakeHandler.class.getClassLoader());
|
||||
|
||||
private static final boolean tomcatWsPresent = ClassUtils.isPresent(
|
||||
"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", classLoader);
|
||||
"org.apache.tomcat.websocket.server.WsHttpUpgradeHandler", AbstractHandshakeHandler.class.getClassLoader());
|
||||
|
||||
private static final boolean undertowWsPresent = ClassUtils.isPresent(
|
||||
"io.undertow.websockets.jsr.ServerWebSocketContainer", classLoader);
|
||||
"io.undertow.websockets.jsr.ServerWebSocketContainer", AbstractHandshakeHandler.class.getClassLoader());
|
||||
|
||||
private static final boolean glassfishWsPresent = ClassUtils.isPresent(
|
||||
"org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler", classLoader);
|
||||
"org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler", AbstractHandshakeHandler.class.getClassLoader());
|
||||
|
||||
private static final boolean weblogicWsPresent = ClassUtils.isPresent(
|
||||
"weblogic.websocket.tyrus.TyrusServletWriter", classLoader);
|
||||
"weblogic.websocket.tyrus.TyrusServletWriter", AbstractHandshakeHandler.class.getClassLoader());
|
||||
|
||||
private static final boolean websphereWsPresent = ClassUtils.isPresent(
|
||||
"com.ibm.websphere.wsoc.WsWsocServerContainer", classLoader);
|
||||
"com.ibm.websphere.wsoc.WsWsocServerContainer", AbstractHandshakeHandler.class.getClassLoader());
|
||||
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
@@ -146,7 +144,7 @@ public abstract class AbstractHandshakeHandler implements HandshakeHandler, Life
|
||||
}
|
||||
|
||||
try {
|
||||
Class<?> clazz = ClassUtils.forName(className, classLoader);
|
||||
Class<?> clazz = ClassUtils.forName(className, AbstractHandshakeHandler.class.getClassLoader());
|
||||
return (RequestUpgradeStrategy) clazz.newInstance();
|
||||
}
|
||||
catch (Throwable ex) {
|
||||
|
||||
Reference in New Issue
Block a user