code: @Override
      public Plugin create(final PluginWrapper pluginWrapper) {
          String pluginClassName = pluginWrapper.getDescriptor().getPluginClass();
          log.debug("Create instance for plugin '{}'", pluginClassName);
  
          Class<?> pluginClass;
          try {
              pluginClass = pluginWrapper.getPluginClassLoader().loadClass(pluginClassName);
          } catch (ClassNotFoundException e) {
              log.error(e.getMessage(), e);
              return null;
          }
  
          // once we have the class, we can do some checks on it to ensure
          // that it is a valid implementation of a plugin.
          int modifiers = pluginClass.getModifiers();
          if (Modifier.isAbstract(modifiers) || Modifier.isInterface(modifiers)
                  || (!Plugin.class.isAssignableFrom(pluginClass))) {
              log.error("The plugin class '{}' is not valid", pluginClassName);
              return null;
          }
  
          // create the plugin instance
          try {
              Constructor<?> constructor = pluginClass.getConstructor(PluginWrapper.class);
              return (Plugin) constructor.newInstance(pluginWrapper);
          } catch (Exception e) {
              log.error(e.getMessage(), e);
          }
  
          return null;
      }
docs: Creates a plugin instance. If an error occurs than that error is logged and the method returns null.
  @param pluginWrapper
  @return