Exemple #1
0
  public void loadOldStylePluginFrom(File pluginFile) throws IOException {
    JarFile jarFile = new JarFile(pluginFile);
    // add jar to our extension classLoader
    SoapUIExtensionClassLoader extensionClassLoader = getExtensionClassLoader();
    extensionClassLoader.addFile(pluginFile);

    // look for factories
    JarEntry entry = jarFile.getJarEntry("META-INF/factories.xml");
    if (entry != null) {
      getFactoryRegistry().addConfig(jarFile.getInputStream(entry), extensionClassLoader);
    }

    // look for listeners
    entry = jarFile.getJarEntry("META-INF/listeners.xml");
    if (entry != null) {
      getListenerRegistry().addConfig(jarFile.getInputStream(entry), extensionClassLoader);
    }

    // look for actions
    entry = jarFile.getJarEntry("META-INF/actions.xml");
    if (entry != null) {
      getActionRegistry().addConfig(jarFile.getInputStream(entry), extensionClassLoader);
    }

    // add jar to resource classloader so embedded images can be found with
    // UISupport.loadImageIcon(..)
    UISupport.addResourceClassLoader(new URLClassLoader(new URL[] {pluginFile.toURI().toURL()}));
  }
Exemple #2
0
 public synchronized void loadExternalLibraries() {
   if (extClassLoader == null) {
     try {
       extClassLoader =
           SoapUIExtensionClassLoader.create(getRoot(), getExtensionClassLoaderParent());
     } catch (MalformedURLException e) {
       SoapUI.logError(e);
     }
   }
 }