From 045ef0d51db925e7a2aeaf373dd5af2061aad221 Mon Sep 17 00:00:00 2001 From: gorvin Date: Wed, 28 Feb 2018 13:39:21 +0100 Subject: [PATCH] jetty-repacked:9.4.7.v20171121 --- selenium-bravo-servlet/build.gradle | 2 +- .../java/com/bravostudiodev/selenium/RuntimeJar.java | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/selenium-bravo-servlet/build.gradle b/selenium-bravo-servlet/build.gradle index f2868f8..f38801b 100644 --- a/selenium-bravo-servlet/build.gradle +++ b/selenium-bravo-servlet/build.gradle @@ -23,7 +23,7 @@ repositories { dependencies { compile 'com.google.guava:guava:23.0' compile 'io.sterodium:sterodium-rmi:0.3' - compile 'org.seleniumhq.selenium:jetty-repacked:9.4.5.v20170502' + compile 'org.seleniumhq.selenium:jetty-repacked:9.4.7.v20171121' compile 'commons-io:commons-io:2.5' compile 'org.slf4j:slf4j-api:1.7.12' compile 'org.slf4j:slf4j-simple:1.7.12' diff --git a/selenium-bravo-servlet/src/main/java/com/bravostudiodev/selenium/RuntimeJar.java b/selenium-bravo-servlet/src/main/java/com/bravostudiodev/selenium/RuntimeJar.java index f5e3588..0e78eed 100644 --- a/selenium-bravo-servlet/src/main/java/com/bravostudiodev/selenium/RuntimeJar.java +++ b/selenium-bravo-servlet/src/main/java/com/bravostudiodev/selenium/RuntimeJar.java @@ -8,9 +8,12 @@ import java.net.URLClassLoader; import java.util.Arrays; import java.util.function.BiConsumer; +import java.util.logging.Logger; public class RuntimeJar { - BiConsumer addToRmiFacade = null; + private static final Logger LOGGER = Logger.getLogger(SikuliScreen.class.getName()); + + private BiConsumer addToRmiFacade = null; public RuntimeJar(BiConsumer addToRmiFacade) { this.addToRmiFacade = addToRmiFacade; } @@ -20,6 +23,7 @@ public RuntimeJar(BiConsumer addToRmiFacade) { * if the library is already loaded. */ private synchronized void loadModule(String jarPath) throws TypeNotPresentException { + LOGGER.info("Loading module " + jarPath); File jar = new File(jarPath); try { /*We are using reflection here to circumvent encapsulation; addURL is not public*/ @@ -33,6 +37,7 @@ private synchronized void loadModule(String jarPath) throws TypeNotPresentExcept Method method = URLClassLoader.class.getDeclaredMethod("addURL", new Class[]{java.net.URL.class}); method.setAccessible(true); /*promote the method to public access*/ method.invoke(loader, new Object[]{url}); + LOGGER.info("... loaded module " + jarPath); } catch (final NoSuchMethodException | IllegalAccessException | MalformedURLException | InvocationTargetException e){ throw new TypeNotPresentException("FAILED loading module ", e); @@ -41,7 +46,9 @@ private synchronized void loadModule(String jarPath) throws TypeNotPresentExcept public void addRemoteInstance(String jarPath, String remoteId, String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException { loadModule(jarPath); + LOGGER.info("Creating object of class " + className); Object obj = Class.forName(className).newInstance(); + LOGGER.info("Registering object " + className); addToRmiFacade.accept(remoteId, obj); } }