code: @SuppressWarnings("unchecked") // We check this ourselves with isAssignableFrom()
      private Class<Listener> getListenerClass(String name)
              throws GuacamoleException {
  
          try {
  
              // Get listener class
              Class<?> listenerClass = classLoader.loadClass(name);
  
              // Verify the located class is actually a subclass of Listener
              if (!Listener.class.isAssignableFrom(listenerClass))
                  throw new GuacamoleServerException("Listeners MUST implement a Listener subclass.");
  
              // Return located class
              return (Class<Listener>) listenerClass;
  
          }
          catch (ClassNotFoundException e) {
              throw new GuacamoleException("Listener class not found.", e);
          }
          catch (LinkageError e) {
              throw new GuacamoleException("Listener class cannot be loaded (wrong version of API?).", e);
          }
  
      }
docs: Retrieve the Listener subclass having the given name. If
  the class having the given name does not exist or isn't actually a
  subclass of Listener, an exception will be thrown.
  
  @param name
  The name of the Listener class to retrieve.
  
  @return
  The subclass of Listener having the given name.
  
  @throws GuacamoleException
  If no such class exists, or if the class with the given name is not
  a subclass of Listener.