+ /**
+ * internal vamsas class discovery state
+ */
+ private static int groovyJarsArePresent = -1;
+ /**
+ * Searches for vamsas client classes on class path.
+ * @return true if vamsas client is present on classpath
+ */
+ public static boolean groovyJarsPresent()
+ {
+ if (groovyJarsArePresent == -1)
+ {
+ try
+ {
+ if (Cache.class.getClassLoader().loadClass(
+ "groovy.lang.GroovyObject") != null)
+ {
+ jalview.bin.Cache.log.debug(
+ "Found Groovy (groovy.lang.GroovyObject can be loaded)");
+ groovyJarsArePresent = 1;
+ Logger lgclient = Logger.getLogger("groovy");
+ lgclient.setLevel(Level.toLevel(Cache.getDefault("logs.Groovy.Level",
+ Level.INFO.toString())));
+
+ lgclient.addAppender(log.getAppender("JalviewLogger"));
+ // Tell the user that debug is enabled
+ lgclient.debug("Jalview Groovy Client Debugging Output Follows.");
+ }
+ }
+ catch (Exception e)
+ {
+ groovyJarsArePresent = 0;
+ jalview.bin.Cache.log.debug("Groovy Classes are not present");
+ }
+ }
+ return (groovyJarsArePresent > 0);
+ }