public Vector getDeploymentFactoryClassNames()

in src/main/java/org/apache/openejb/cts/deploy/DeployTestUtil.java [109:144]


  public Vector getDeploymentFactoryClassNames() throws Exception {
    File deployPlatformJarFile;

    try {
      deployPlatformJarFile = new File(dmp.getJarFile());
    } catch (Exception e) {
      throw new Exception(
          "Could not contruct file object: " + dmp.getJarFile());
    }

    // Obtain DeploymentFactory names from manifest and load those entries
    TestUtil.logHarness("loadDeploymentFactories loading factories from file:"
        + deployPlatformJarFile.getName());

    Manifest mf = new java.util.jar.JarFile(deployPlatformJarFile)
        .getManifest();

    // This should be rewritten to get multiple class names from the manifest
    String dfClassNames = mf.getMainAttributes()
        .getValue(DEPLOYMENT_MANIFEST_ENTRY_NAME);
    if (dfClassNames == null) {
      throw new Exception(
          "Invalid Jar File: Jar file does not have entry for Deployment factories");
    }

    // Parse class names, assuming that class names are separated by space
    java.util.StringTokenizer st = new java.util.StringTokenizer(dfClassNames,
        " ");
    Vector classNames = new Vector();
    while (st.hasMoreTokens()) {
      classNames.add(st.nextToken());
    }

    return (classNames);

  }