mirror of
				https://github.com/gyurix1968/guacamole-client.git
				synced 2025-10-30 00:23:21 +00:00 
			
		
		
		
	GUAC-587: Remove unnecessary use of GuacamoleClassLoader.
This commit is contained in:
		| @@ -24,7 +24,6 @@ package org.glyptodon.guacamole.net.basic; | |||||||
|  |  | ||||||
| import com.google.inject.servlet.ServletModule; | import com.google.inject.servlet.ServletModule; | ||||||
| import java.lang.reflect.InvocationTargetException; | import java.lang.reflect.InvocationTargetException; | ||||||
| import org.glyptodon.guacamole.GuacamoleException; |  | ||||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||||
|  |  | ||||||
| @@ -55,7 +54,7 @@ public class TunnelModule extends ServletModule { | |||||||
|         try { |         try { | ||||||
|  |  | ||||||
|             // Attempt to find WebSocket module |             // Attempt to find WebSocket module | ||||||
|             Class<?> module = (Class<?>) GuacamoleClassLoader.getInstance().findClass(classname); |             Class<?> module = Class.forName(classname); | ||||||
|  |  | ||||||
|             // Create loader |             // Create loader | ||||||
|             TunnelLoader loader = (TunnelLoader) module.getConstructor().newInstance(); |             TunnelLoader loader = (TunnelLoader) module.getConstructor().newInstance(); | ||||||
| @@ -85,12 +84,6 @@ public class TunnelModule extends ServletModule { | |||||||
|             logger.debug("Error instantiating WebSocket module.", e); |             logger.debug("Error instantiating WebSocket module.", e); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         // Log all GuacamoleExceptions |  | ||||||
|         catch (GuacamoleException e) { |  | ||||||
|             logger.error("Unable to load/detect WebSocket support: {}", e.getMessage()); |  | ||||||
|             logger.debug("Error loading/detecting WebSocket support.", e); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         // Load attempt failed |         // Load attempt failed | ||||||
|         return false; |         return false; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -28,8 +28,6 @@ import java.util.Arrays; | |||||||
| import javax.websocket.DeploymentException; | import javax.websocket.DeploymentException; | ||||||
| import javax.websocket.server.ServerContainer; | import javax.websocket.server.ServerContainer; | ||||||
| import javax.websocket.server.ServerEndpointConfig; | import javax.websocket.server.ServerEndpointConfig; | ||||||
| import org.glyptodon.guacamole.GuacamoleException; |  | ||||||
| import org.glyptodon.guacamole.net.basic.GuacamoleClassLoader; |  | ||||||
| import org.glyptodon.guacamole.net.basic.TunnelLoader; | import org.glyptodon.guacamole.net.basic.TunnelLoader; | ||||||
| import org.glyptodon.guacamole.net.basic.TunnelRequestService; | import org.glyptodon.guacamole.net.basic.TunnelRequestService; | ||||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||||
| @@ -53,7 +51,7 @@ public class WebSocketTunnelModule extends ServletModule implements TunnelLoader | |||||||
|         try { |         try { | ||||||
|  |  | ||||||
|             // Attempt to find WebSocket servlet |             // Attempt to find WebSocket servlet | ||||||
|             GuacamoleClassLoader.getInstance().findClass("javax.websocket.Endpoint"); |             Class.forName("javax.websocket.Endpoint"); | ||||||
|  |  | ||||||
|             // Support found |             // Support found | ||||||
|             return true; |             return true; | ||||||
| @@ -65,12 +63,6 @@ public class WebSocketTunnelModule extends ServletModule implements TunnelLoader | |||||||
|         catch (ClassNotFoundException e) {} |         catch (ClassNotFoundException e) {} | ||||||
|         catch (NoClassDefFoundError e) {} |         catch (NoClassDefFoundError e) {} | ||||||
|  |  | ||||||
|         // Log all GuacamoleExceptions |  | ||||||
|         catch (GuacamoleException e) { |  | ||||||
|             logger.error("Unable to load/detect WebSocket support: {}", e.getMessage()); |  | ||||||
|             logger.debug("Error loading/detecting WebSocket support.", e); |  | ||||||
|         } |  | ||||||
|          |  | ||||||
|         // Support not found |         // Support not found | ||||||
|         return false; |         return false; | ||||||
|          |          | ||||||
|   | |||||||
| @@ -23,8 +23,6 @@ | |||||||
| package org.glyptodon.guacamole.net.basic.websocket.jetty8; | package org.glyptodon.guacamole.net.basic.websocket.jetty8; | ||||||
|  |  | ||||||
| import com.google.inject.servlet.ServletModule; | import com.google.inject.servlet.ServletModule; | ||||||
| import org.glyptodon.guacamole.GuacamoleException; |  | ||||||
| import org.glyptodon.guacamole.net.basic.GuacamoleClassLoader; |  | ||||||
| import org.glyptodon.guacamole.net.basic.TunnelLoader; | import org.glyptodon.guacamole.net.basic.TunnelLoader; | ||||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||||
| @@ -47,7 +45,7 @@ public class WebSocketTunnelModule extends ServletModule implements TunnelLoader | |||||||
|         try { |         try { | ||||||
|  |  | ||||||
|             // Attempt to find WebSocket servlet |             // Attempt to find WebSocket servlet | ||||||
|             GuacamoleClassLoader.getInstance().findClass("org.glyptodon.guacamole.net.basic.websocket.jetty8.BasicGuacamoleWebSocketTunnelServlet"); |             Class.forName("org.glyptodon.guacamole.net.basic.websocket.jetty8.BasicGuacamoleWebSocketTunnelServlet"); | ||||||
|  |  | ||||||
|             // Support found |             // Support found | ||||||
|             return true; |             return true; | ||||||
| @@ -59,12 +57,6 @@ public class WebSocketTunnelModule extends ServletModule implements TunnelLoader | |||||||
|         catch (ClassNotFoundException e) {} |         catch (ClassNotFoundException e) {} | ||||||
|         catch (NoClassDefFoundError e) {} |         catch (NoClassDefFoundError e) {} | ||||||
|  |  | ||||||
|         // Log all GuacamoleExceptions |  | ||||||
|         catch (GuacamoleException e) { |  | ||||||
|             logger.error("Unable to load/detect WebSocket support: {}", e.getMessage()); |  | ||||||
|             logger.debug("Error loading/detecting WebSocket support.", e); |  | ||||||
|         } |  | ||||||
|          |  | ||||||
|         // Support not found |         // Support not found | ||||||
|         return false; |         return false; | ||||||
|          |          | ||||||
|   | |||||||
| @@ -23,8 +23,6 @@ | |||||||
| package org.glyptodon.guacamole.net.basic.websocket.jetty9; | package org.glyptodon.guacamole.net.basic.websocket.jetty9; | ||||||
|  |  | ||||||
| import com.google.inject.servlet.ServletModule; | import com.google.inject.servlet.ServletModule; | ||||||
| import org.glyptodon.guacamole.GuacamoleException; |  | ||||||
| import org.glyptodon.guacamole.net.basic.GuacamoleClassLoader; |  | ||||||
| import org.glyptodon.guacamole.net.basic.TunnelLoader; | import org.glyptodon.guacamole.net.basic.TunnelLoader; | ||||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||||
| @@ -47,7 +45,7 @@ public class WebSocketTunnelModule extends ServletModule implements TunnelLoader | |||||||
|         try { |         try { | ||||||
|  |  | ||||||
|             // Attempt to find WebSocket servlet |             // Attempt to find WebSocket servlet | ||||||
|             GuacamoleClassLoader.getInstance().findClass("org.glyptodon.guacamole.net.basic.websocket.jetty9.BasicGuacamoleWebSocketTunnelServlet"); |             Class.forName("org.glyptodon.guacamole.net.basic.websocket.jetty9.BasicGuacamoleWebSocketTunnelServlet"); | ||||||
|  |  | ||||||
|             // Support found |             // Support found | ||||||
|             return true; |             return true; | ||||||
| @@ -59,12 +57,6 @@ public class WebSocketTunnelModule extends ServletModule implements TunnelLoader | |||||||
|         catch (ClassNotFoundException e) {} |         catch (ClassNotFoundException e) {} | ||||||
|         catch (NoClassDefFoundError e) {} |         catch (NoClassDefFoundError e) {} | ||||||
|  |  | ||||||
|         // Log all GuacamoleExceptions |  | ||||||
|         catch (GuacamoleException e) { |  | ||||||
|             logger.error("Unable to load/detect WebSocket support: {}", e.getMessage()); |  | ||||||
|             logger.debug("Error loading/detecting WebSocket support.", e); |  | ||||||
|         } |  | ||||||
|          |  | ||||||
|         // Support not found |         // Support not found | ||||||
|         return false; |         return false; | ||||||
|          |          | ||||||
|   | |||||||
| @@ -23,8 +23,6 @@ | |||||||
| package org.glyptodon.guacamole.net.basic.websocket.tomcat; | package org.glyptodon.guacamole.net.basic.websocket.tomcat; | ||||||
|  |  | ||||||
| import com.google.inject.servlet.ServletModule; | import com.google.inject.servlet.ServletModule; | ||||||
| import org.glyptodon.guacamole.GuacamoleException; |  | ||||||
| import org.glyptodon.guacamole.net.basic.GuacamoleClassLoader; |  | ||||||
| import org.glyptodon.guacamole.net.basic.TunnelLoader; | import org.glyptodon.guacamole.net.basic.TunnelLoader; | ||||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||||
| @@ -47,7 +45,7 @@ public class WebSocketTunnelModule extends ServletModule implements TunnelLoader | |||||||
|         try { |         try { | ||||||
|  |  | ||||||
|             // Attempt to find WebSocket servlet |             // Attempt to find WebSocket servlet | ||||||
|             GuacamoleClassLoader.getInstance().findClass("org.glyptodon.guacamole.net.basic.websocket.tomcat.BasicGuacamoleWebSocketTunnelServlet"); |             Class.forName("org.glyptodon.guacamole.net.basic.websocket.tomcat.BasicGuacamoleWebSocketTunnelServlet"); | ||||||
|  |  | ||||||
|             // Support found |             // Support found | ||||||
|             return true; |             return true; | ||||||
| @@ -59,12 +57,6 @@ public class WebSocketTunnelModule extends ServletModule implements TunnelLoader | |||||||
|         catch (ClassNotFoundException e) {} |         catch (ClassNotFoundException e) {} | ||||||
|         catch (NoClassDefFoundError e) {} |         catch (NoClassDefFoundError e) {} | ||||||
|  |  | ||||||
|         // Log all GuacamoleExceptions |  | ||||||
|         catch (GuacamoleException e) { |  | ||||||
|             logger.error("Unable to load/detect WebSocket support: {}", e.getMessage()); |  | ||||||
|             logger.debug("Error loading/detecting WebSocket support.", e); |  | ||||||
|         } |  | ||||||
|          |  | ||||||
|         // Support not found |         // Support not found | ||||||
|         return false; |         return false; | ||||||
|          |          | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user