org.eclipse.jst.server.core_1.2.202.v20110419

16:46:02.889 INFO  jd.cli.Main - Decompiling org.eclipse.jst.server.core_1.2.202.v20110419.jar
package org.eclipse.jst.server.core;

import java.io.File;
import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.model.RuntimeTargetHandlerDelegate;

/**
 * @deprecated
 */
public abstract class ClasspathRuntimeTargetHandler
  extends RuntimeTargetHandlerDelegate
{
  public void setRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor)
    throws CoreException
  {
    throw new RuntimeException("Attempt to use deprecated code");
  }
  
  public void removeRuntimeTarget(IProject project, IRuntime runtime, IProgressMonitor monitor)
  {
    throw new RuntimeException("Attempt to use deprecated code");
  }
  
  protected static void addLibraryEntries(List list, File dir, boolean includeSubdirectories)
  {
    throw new RuntimeException("Attempt to use deprecated code");
  }
  
  public IClasspathEntry[] getDelegateClasspathEntries(IRuntime runtime, IProgressMonitor monitor)
  {
    throw new RuntimeException("Attempt to use deprecated code");
  }
  
  public String[] getClasspathEntryIds()
  {
    throw new RuntimeException("Attempt to use deprecated code");
  }
  
  public void requestClasspathContainerUpdate(IRuntime runtime, String id, IClasspathEntry[] entries)
  {
    throw new RuntimeException("Attempt to use deprecated code");
  }
  
  public abstract String getClasspathContainerLabel(IRuntime paramIRuntime, String paramString);
  
  public IClasspathEntry[] resolveClasspathContainerImpl(IRuntime runtime, String id)
  {
    throw new RuntimeException("Attempt to use deprecated code");
  }
  
  public abstract IClasspathEntry[] resolveClasspathContainer(IRuntime paramIRuntime, String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.ClasspathRuntimeTargetHandler
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.jst.server.core.internal.Messages;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;

public class EJBBean
  extends ModuleArtifactDelegate
{
  public static final String EJB_11 = "1.1";
  public static final String EJB_20 = "2.0";
  public static final String EJB_21 = "2.1";
  public static final String EJB_30 = "3.0";
  private String jndiName;
  private String interfaceName;
  private boolean local;
  private boolean remote;
  private String version;
  
  public EJBBean(IModule module, String jndiName, boolean remote, boolean local)
  {
    super(module);
    this.jndiName = jndiName;
    this.remote = remote;
    this.local = local;
    version = "2.1";
  }
  
  public EJBBean(IModule module, String jndiName, boolean remote, boolean local, String version)
  {
    super(module);
    this.jndiName = jndiName;
    this.remote = remote;
    this.local = local;
    this.version = version;
  }
  
  public EJBBean(IModule module, String jndiName, boolean remote, boolean local, String version, String interfaceName)
  {
    super(module);
    this.jndiName = jndiName;
    this.remote = remote;
    this.local = local;
    this.version = version;
    this.interfaceName = interfaceName;
  }
  
  public EJBBean() {}
  
  public String getJndiName()
  {
    return jndiName;
  }
  
  public boolean hasRemoteInterface()
  {
    return remote;
  }
  
  public boolean hasLocalInterface()
  {
    return local;
  }
  
  public String getVersion()
  {
    return version;
  }
  
  public String getName()
  {
    String ejbName;
    String ejbName;
    if ((interfaceName != null) && (interfaceName.length() > 0)) {
      ejbName = interfaceName;
    } else {
      ejbName = jndiName;
    }
    return NLS.bind(Messages.artifactEJB, ejbName);
  }
  
  public void deserialize(String s)
  {
    int ind = s.indexOf("//");
    super.deserialize(s.substring(0, ind));
    if ('T' == s.charAt(ind + 2)) {
      local = true;
    } else {
      local = false;
    }
    if ('T' == s.charAt(ind + 3)) {
      remote = true;
    } else {
      remote = false;
    }
    jndiName = s.substring(ind + 4);
  }
  
  public String serialize()
  {
    StringBuffer sb = new StringBuffer(super.serialize());
    sb.append("//");
    if (local) {
      sb.append("T");
    } else {
      sb.append("F");
    }
    if (remote) {
      sb.append("T");
    } else {
      sb.append("F");
    }
    sb.append(jndiName);
    return sb.toString();
  }
  
  public String getInterfaceName()
  {
    return interfaceName;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.EJBBean
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.wst.server.core.IServer;

public final class FacetUtil
{
  public static org.eclipse.wst.server.core.IRuntime getRuntime(org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime)
  {
    return org.eclipse.wst.server.core.internal.facets.FacetUtil.getRuntime(runtime);
  }
  
  public static org.eclipse.wst.common.project.facet.core.runtime.IRuntime getRuntime(org.eclipse.wst.server.core.IRuntime runtime)
  {
    return org.eclipse.wst.server.core.internal.facets.FacetUtil.getRuntime(runtime);
  }
  
  public static final IStatus verifyFacets(IProject project, IServer server)
  {
    return org.eclipse.wst.server.core.internal.facets.FacetUtil.verifyFacets(project, server);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.FacetUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

public abstract interface IApplicationClientModule
  extends IJ2EEModule
{}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.IApplicationClientModule
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.core.runtime.IPath;

public abstract interface IConnectorModule
  extends IJ2EEModule
{
  public abstract IPath[] getClasspath();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.IConnectorModule
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

public abstract interface IEJBModule
  extends IJ2EEModule
{}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.IEJBModule
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.core.resources.IContainer;
import org.eclipse.wst.server.core.IModule;

public abstract interface IEnterpriseApplication
{
  public abstract IModule[] getModules();
  
  public abstract String getURI(IModule paramIModule);
  
  public abstract IContainer[] getResourceFolders();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.IEnterpriseApplication
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.core.resources.IContainer;

public abstract interface IJ2EEModule
{
  public abstract IContainer[] getResourceFolders();
  
  public abstract IContainer[] getJavaOutputFolders();
  
  public abstract boolean isBinary();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.IJ2EEModule
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.jdt.launching.IVMInstall;

public abstract interface IJavaRuntime
{
  public abstract IVMInstall getVMInstall();
  
  public abstract boolean isUsingDefaultJRE();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.IJavaRuntime
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.jdt.launching.IVMInstall;

public abstract interface IJavaRuntimeWorkingCopy
  extends IJavaRuntime
{
  public abstract void setVMInstall(IVMInstall paramIVMInstall);
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.IJavaRuntimeWorkingCopy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.core.resources.IContainer;

public abstract interface IUtilityModule
{
  public abstract IContainer[] getResourceFolders();
  
  public abstract IContainer[] getJavaOutputFolders();
  
  public abstract boolean isBinary();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.IUtilityModule
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

public abstract interface IWebFragmentModule
  extends IJ2EEModule
{}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.IWebFragmentModule
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.wst.server.core.IModule;

public abstract interface IWebModule
  extends IJ2EEModule
{
  public abstract String getContextRoot();
  
  public abstract String getContextRoot(IModule paramIModule);
  
  public abstract IModule[] getModules();
  
  public abstract String getURI(IModule paramIModule);
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.IWebModule
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import java.util.Properties;

public class JndiLaunchable
{
  private Properties props;
  private String jndiName;
  
  public JndiLaunchable(Properties props, String jndiName)
  {
    this.jndiName = jndiName;
    this.props = props;
  }
  
  public Properties getProperties()
  {
    return props;
  }
  
  public String getJNDIName()
  {
    return jndiName;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.JndiLaunchable
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.jst.server.core.internal.Messages;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;

public class JndiObject
  extends ModuleArtifactDelegate
{
  private String jndiName;
  
  public JndiObject(IModule module, String jndiName)
  {
    super(module);
    this.jndiName = jndiName;
  }
  
  public JndiObject() {}
  
  public String getJndiName()
  {
    return jndiName;
  }
  
  public String getName()
  {
    return NLS.bind(Messages.artifactJNDI, jndiName);
  }
  
  public void deserialize(String s)
  {
    int ind = s.indexOf("//");
    super.deserialize(s.substring(0, ind));
    jndiName = s.substring(ind + 2);
  }
  
  public String serialize()
  {
    StringBuffer sb = new StringBuffer(super.serialize());
    sb.append("//");
    sb.append(jndiName);
    return sb.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.JndiObject
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jst.server.core.internal.Messages;
import org.eclipse.jst.server.core.internal.Trace;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.model.IModuleFile;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;

public final class PublishUtil
{
  private static final int BUFFER = 65536;
  private static byte[] buf = new byte[65536];
  
  /**
   * @deprecated
   */
  public static IStatus copyFile(InputStream in, String to)
  {
    OutputStream out = null;
    try
    {
      out = new FileOutputStream(to);
      
      int avail = in.read(buf);
      while (avail > 0)
      {
        out.write(buf, 0, avail);
        avail = in.read(buf);
      }
      return Status.OK_STATUS;
    }
    catch (Exception e)
    {
      Object localObject2;
      if (Trace.SEVERE) {
        Trace.trace("/severe", "Error copying file", e);
      }
      return new Status(4, "org.eclipse.jst.server.core", 0, NLS.bind(Messages.errorCopyingFile, new String[] { to, e.getLocalizedMessage() }), e);
    }
    finally
    {
      try
      {
        if (in != null) {
          in.close();
        }
      }
      catch (Exception localException5) {}
      try
      {
        if (out != null) {
          out.close();
        }
      }
      catch (Exception localException6) {}
    }
  }
  
  /**
   * @deprecated
   */
  public static void smartCopy(IModuleResource[] resources, IPath path, IProgressMonitor monitor)
    throws CoreException
  {
    IStatus[] status = publishSmart(resources, path, monitor);
    if ((status != null) && (status.length > 0)) {
      throw new CoreException(status[0]);
    }
  }
  
  /**
   * @deprecated
   */
  public static void handleDelta(int kind, IPath path, IModuleResourceDelta delta)
    throws CoreException
  {
    IStatus[] status = publishDelta(delta, path, null);
    if ((status != null) && (status.length > 0)) {
      throw new CoreException(status[0]);
    }
  }
  
  /**
   * @deprecated
   */
  protected static void deleteFile(IPath path, IModuleFile file)
  {
    if (Trace.PUBLISHING) {
      Trace.trace("/publishing", "Deleting: " + file.getName() + " from " + path.toString());
    }
    IPath path2 = path.append(file.getModuleRelativePath()).append(file.getName());
    path2.toFile().delete();
  }
  
  /**
   * @deprecated
   */
  public static void copy(IModuleResource[] resources, IPath path)
    throws CoreException
  {
    IStatus[] status = publishFull(resources, path, null);
    if ((status != null) && (status.length > 0)) {
      throw new CoreException(status[0]);
    }
  }
  
  public static void createZipFile(IModuleResource[] resources, IPath zipPath)
    throws CoreException
  {
    IStatus[] status = publishZip(resources, zipPath, null);
    if ((status != null) && (status.length > 0)) {
      throw new CoreException(status[0]);
    }
  }
  
  public static IStatus[] deleteDirectory(File dir, IProgressMonitor monitor)
  {
    return org.eclipse.wst.server.core.util.PublishUtil.deleteDirectory(dir, monitor);
  }
  
  public static IStatus[] publishSmart(IModuleResource[] resources, IPath path, IProgressMonitor monitor)
  {
    return org.eclipse.wst.server.core.util.PublishUtil.publishSmart(resources, path, monitor);
  }
  
  public static IStatus[] publishDelta(IModuleResourceDelta[] delta, IPath path, IProgressMonitor monitor)
  {
    return org.eclipse.wst.server.core.util.PublishUtil.publishDelta(delta, path, monitor);
  }
  
  public static IStatus[] publishDelta(IModuleResourceDelta delta, IPath path, IProgressMonitor monitor)
  {
    return org.eclipse.wst.server.core.util.PublishUtil.publishDelta(delta, path, monitor);
  }
  
  public static IStatus[] publishFull(IModuleResource[] resources, IPath path, IProgressMonitor monitor)
  {
    return org.eclipse.wst.server.core.util.PublishUtil.publishFull(resources, path, monitor);
  }
  
  public static IStatus[] publishZip(IModuleResource[] resources, IPath path, IProgressMonitor monitor)
  {
    return org.eclipse.wst.server.core.util.PublishUtil.publishZip(resources, path, monitor);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.PublishUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IClasspathAttribute;

public class RuntimeClasspathProviderDelegate$SourceAttachmentUpdate
{
  String runtimeId;
  IPath entry;
  IPath sourceAttachmentPath;
  IPath sourceAttachmentRootPath;
  IClasspathAttribute[] attributes;
  
  protected RuntimeClasspathProviderDelegate$SourceAttachmentUpdate(RuntimeClasspathProviderDelegate paramRuntimeClasspathProviderDelegate) {}
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate.SourceAttachmentUpdate
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jst.server.core.internal.IMemento;
import org.eclipse.jst.server.core.internal.JavaServerPlugin;
import org.eclipse.jst.server.core.internal.Trace;
import org.eclipse.jst.server.core.internal.XMLMemento;
import org.eclipse.wst.server.core.IRuntime;

public abstract class RuntimeClasspathProviderDelegate
{
  private volatile List<SourceAttachmentUpdate> sourceAttachments;
  private String extensionId;
  private Map<String, IPath> runtimePathMap = Collections.synchronizedMap(new HashMap());
  private Map<String, Integer> previousClasspath = Collections.synchronizedMap(new HashMap());
  
  public final void initialize(String id)
  {
    extensionId = id;
  }
  
  /**
   * @deprecated
   */
  public IClasspathEntry[] resolveClasspathContainer(IRuntime runtime)
  {
    return null;
  }
  
  public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime)
  {
    return null;
  }
  
  /**
   * @deprecated
   */
  public IClasspathEntry[] resolveClasspathContainerImpl(IRuntime runtime)
  {
    return resolveClasspathContainerImpl(null, runtime);
  }
  
  public IClasspathEntry[] resolveClasspathContainerImpl(IProject project, IRuntime runtime)
  {
    if (runtime == null) {
      return new IClasspathEntry[0];
    }
    runtimePathMap.put(runtime.getId(), runtime.getLocation());
    IClasspathEntry[] entries = resolveClasspathContainer(project, runtime);
    if (entries == null) {
      entries = resolveClasspathContainer(runtime);
    }
    if (entries == null) {
      entries = new IClasspathEntry[0];
    }
    synchronized (this)
    {
      if (sourceAttachments == null) {
        load();
      }
    }
    List<SourceAttachmentUpdate> srcAttachments = sourceAttachments;
    if (srcAttachments != null)
    {
      int size = entries.length;
      int size2 = srcAttachments.size();
      for (int i = 0; i < size; i++) {
        for (int j = 0; j < size2; j++)
        {
          SourceAttachmentUpdate sau = (SourceAttachmentUpdate)srcAttachments.get(j);
          if ((runtimeId.equals(runtime.getId())) && (entry.equals(entries[i].getPath())))
          {
            IClasspathAttribute[] consolidatedClasspathAttributes = consolidateClasspathAttributes(attributes, entries[i].getExtraAttributes());
            entries[i] = JavaCore.newLibraryEntry(entries[i].getPath(), sourceAttachmentPath, sourceAttachmentRootPath, entries[i].getAccessRules(), consolidatedClasspathAttributes, false);
            break;
          }
        }
      }
    }
    String key = project.getName() + "/" + runtime.getId();
    if (!previousClasspath.containsKey(key))
    {
      previousClasspath.put(key, new Integer(entries.length));
    }
    else
    {
      Integer previousEntries = (Integer)previousClasspath.get(key);
      if ((previousEntries == null) || (previousEntries.intValue() != entries.length))
      {
        if (Trace.FINEST) {
          Trace.trace("/finest", "Classpath update: " + key + " " + entries);
        }
        previousClasspath.put(key, new Integer(entries.length));
        
        IPath path = new Path("org.eclipse.jst.server.core.container");
        path = path.append(extensionId).append(runtime.getId());
        try
        {
          IJavaProject javaProject = JavaCore.create(project);
          JavaCore.setClasspathContainer(path, new IJavaProject[] { javaProject }, 
            new IClasspathContainer[1], new NullProgressMonitor());
        }
        catch (Exception e)
        {
          if (Trace.WARNING) {
            Trace.trace("/warning", "Error updating classpath", e);
          }
        }
      }
    }
    return entries;
  }
  
  public boolean hasRuntimeClasspathChanged(IRuntime runtime)
  {
    try
    {
      IPath path = (IPath)runtimePathMap.get(runtime.getId());
      return (path != null) && (!path.equals(runtime.getLocation()));
    }
    catch (Exception localException) {}
    return false;
  }
  
  private static void addJarFiles(File dir, List<IClasspathEntry> list, boolean includeSubdirectories)
  {
    int depth = 0;
    if (includeSubdirectories) {
      depth = 2;
    }
    addJarFiles(dir, list, depth);
  }
  
  private static void addJarFiles(File dir, List<IClasspathEntry> list, int depth)
  {
    if (dir == null) {
      throw new IllegalArgumentException();
    }
    File[] files = dir.listFiles();
    if (files != null)
    {
      File[] arrayOfFile1;
      int j = (arrayOfFile1 = files).length;
      for (int i = 0; i < j; i++)
      {
        File file = arrayOfFile1[i];
        if ((file.isDirectory()) && (depth > 0))
        {
          addJarFiles(file, list, depth - 1);
        }
        else if ((file.getAbsolutePath().endsWith(".jar")) || (file.getAbsolutePath().endsWith(".zip")))
        {
          IPath path = new Path(file.getAbsolutePath());
          list.add(JavaCore.newLibraryEntry(path, null, null));
        }
      }
    }
  }
  
  protected static void addLibraryEntries(List<IClasspathEntry> list, File dir, boolean includeSubdirectories)
  {
    if (dir == null) {
      throw new IllegalArgumentException();
    }
    addJarFiles(dir, list, includeSubdirectories);
  }
  
  public void requestClasspathContainerUpdate(IRuntime runtime, IClasspathEntry[] entries)
  {
    if ((runtime == null) || (entries == null)) {
      return;
    }
    List<SourceAttachmentUpdate> srcAttachments = new ArrayList();
    IClasspathEntry[] arrayOfIClasspathEntry;
    int j = (arrayOfIClasspathEntry = entries).length;
    for (int i = 0; i < j; i++)
    {
      IClasspathEntry entry = arrayOfIClasspathEntry[i];
      if ((entry.getSourceAttachmentPath() != null) || ((entry.getExtraAttributes() != null) && (entry.getExtraAttributes().length > 0)))
      {
        SourceAttachmentUpdate sau = new SourceAttachmentUpdate();
        runtimeId = runtime.getId();
        entry = entry.getPath();
        sourceAttachmentPath = entry.getSourceAttachmentPath();
        sourceAttachmentRootPath = entry.getSourceAttachmentRootPath();
        attributes = entry.getExtraAttributes();
        srcAttachments.add(sau);
      }
    }
    sourceAttachments = srcAttachments;
    save();
  }
  
  private void load()
  {
    List<SourceAttachmentUpdate> srcAttachments = new ArrayList();
    
    String id = extensionId;
    String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString();
    if (!new File(filename).exists()) {
      return;
    }
    try
    {
      IMemento memento = XMLMemento.loadMemento(filename);
      
      IMemento[] children = memento.getChildren("source-attachment");
      IMemento[] arrayOfIMemento1;
      int j = (arrayOfIMemento1 = children).length;
      for (int i = 0; i < j; i++)
      {
        IMemento child = arrayOfIMemento1[i];
        try
        {
          SourceAttachmentUpdate sau = new SourceAttachmentUpdate();
          runtimeId = child.getString("runtime-id");
          String temp = child.getString("entry");
          if (temp != null) {
            entry = new Path(temp);
          }
          temp = child.getString("source-attachment-path");
          if (temp != null) {
            sourceAttachmentPath = new Path(temp);
          }
          temp = child.getString("source-attachment-root-path");
          if (temp != null) {
            sourceAttachmentRootPath = new Path(temp);
          }
          IMemento[] attrChildren = child.getChildren("attribute");
          if (attrChildren != null)
          {
            int size2 = attrChildren.length;
            attributes = new IClasspathAttribute[size2];
            for (int j = 0; j < size2; j++)
            {
              String name = attrChildren[j].getString("name");
              String value = attrChildren[j].getString("value");
              attributes[j] = JavaCore.newClasspathAttribute(name, value);
            }
          }
          srcAttachments.add(sau);
        }
        catch (Exception e)
        {
          if (Trace.WARNING) {
            Trace.trace("/warning", "Could not load source attachment: " + e);
          }
        }
      }
    }
    catch (Exception e)
    {
      if (Trace.WARNING) {
        Trace.trace("/warning", "Could not load source path info", e);
      }
    }
    sourceAttachments = srcAttachments;
  }
  
  private synchronized void save()
  {
    List<SourceAttachmentUpdate> srcAttachments = sourceAttachments;
    if (srcAttachments == null) {
      return;
    }
    String id = extensionId;
    String filename = JavaServerPlugin.getInstance().getStateLocation().append(id + ".xml").toOSString();
    try
    {
      XMLMemento memento = XMLMemento.createWriteRoot("classpath");
      
      Iterator iterator = srcAttachments.iterator();
      while (iterator.hasNext())
      {
        SourceAttachmentUpdate sau = (SourceAttachmentUpdate)iterator.next();
        IMemento child = memento.createChild("source-attachment");
        child.putString("runtime-id", runtimeId);
        if (entry != null) {
          child.putString("entry", entry.toPortableString());
        }
        if (sourceAttachmentPath != null) {
          child.putString("source-attachment-path", sourceAttachmentPath.toPortableString());
        }
        if (sourceAttachmentRootPath != null) {
          child.putString("source-attachment-root-path", sourceAttachmentRootPath.toPortableString());
        }
        if (attributes != null)
        {
          IClasspathAttribute[] arrayOfIClasspathAttribute;
          int j = (arrayOfIClasspathAttribute = attributes).length;
          for (int i = 0; i < j; i++)
          {
            IClasspathAttribute attr = arrayOfIClasspathAttribute[i];
            IMemento attrChild = child.createChild("attribute");
            attrChild.putString("name", attr.getName());
            attrChild.putString("value", attr.getValue());
          }
        }
      }
      memento.saveToFile(filename);
    }
    catch (Exception e)
    {
      if (Trace.SEVERE) {
        Trace.trace("/severe", "Error saving source path info", e);
      }
    }
  }
  
  public IClasspathAttribute[] consolidateClasspathAttributes(IClasspathAttribute[] sourceAttachmentAttributes, IClasspathAttribute[] classpathEntryAttributes)
  {
    List classpathAttributeList = new ArrayList();
    classpathAttributeList.addAll(Arrays.asList(sourceAttachmentAttributes));
    for (int i = 0; i < classpathEntryAttributes.length; i++)
    {
      boolean attributeCollision = false;
      for (int j = 0; j < sourceAttachmentAttributes.length; j++)
      {
        String name = classpathEntryAttributes[i].getName();
        if ((name != null) && (name.equals(sourceAttachmentAttributes[j].getName())))
        {
          attributeCollision = true;
          break;
        }
      }
      if (!attributeCollision) {
        classpathAttributeList.add(classpathEntryAttributes[i]);
      }
    }
    return (IClasspathAttribute[])classpathAttributeList.toArray(new IClasspathAttribute[classpathAttributeList.size()]);
  }
  
  protected class SourceAttachmentUpdate
  {
    String runtimeId;
    IPath entry;
    IPath sourceAttachmentPath;
    IPath sourceAttachmentRootPath;
    IClasspathAttribute[] attributes;
    
    protected SourceAttachmentUpdate() {}
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.VMRunnerConfiguration;
import org.eclipse.jst.server.core.internal.JavaServerPlugin;

public abstract class ServerProfilerDelegate
{
  public abstract void process(ILaunch paramILaunch, IVMInstall paramIVMInstall, VMRunnerConfiguration paramVMRunnerConfiguration, IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public static void configureProfiling(ILaunch launch, IVMInstall vmInstall, VMRunnerConfiguration vmConfig, IProgressMonitor monitor)
    throws CoreException
  {
    JavaServerPlugin.configureProfiling(launch, vmInstall, vmConfig, monitor);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.ServerProfilerDelegate
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core;

import org.eclipse.jst.server.core.internal.Messages;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.model.ModuleArtifactDelegate;

public class Servlet
  extends ModuleArtifactDelegate
{
  private String className;
  private String alias;
  
  public Servlet(IModule module, String className, String alias)
  {
    super(module);
    this.className = className;
    this.alias = alias;
  }
  
  public Servlet() {}
  
  public String getServletClassName()
  {
    return className;
  }
  
  public String getAlias()
  {
    return alias;
  }
  
  public String getName()
  {
    return NLS.bind(Messages.artifactServlet, className);
  }
  
  public void deserialize(String s)
  {
    int ind = s.indexOf("//");
    super.deserialize(s.substring(0, ind));
    s = s.substring(ind + 2);
    ind = s.indexOf("//");
    className = s.substring(0, ind);
    alias = s.substring(ind + 2);
  }
  
  public String serialize()
  {
    StringBuffer sb = new StringBuffer(super.serialize());
    sb.append("//");
    sb.append(className);
    sb.append("//");
    sb.append(alias);
    return sb.toString();
  }
  
  public String toString()
  {
    return "Servlet [module=" + getModule() + ", class=" + className + ", alias=" + alias + "]";
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.Servlet
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core.internal;

import java.io.File;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.launching.IVMInstall;
import org.eclipse.jdt.launching.IVMInstallType;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.model.RuntimeDelegate;

public class GenericRuntime
  extends RuntimeDelegate
  implements IGenericRuntime, IGenericRuntimeWorkingCopy
{
  protected static final String PROP_VM_INSTALL_TYPE_ID = "vm-install-type-id";
  protected static final String PROP_VM_INSTALL_ID = "vm-install-id";
  
  protected String getVMInstallTypeId()
  {
    return getAttribute("vm-install-type-id", null);
  }
  
  protected String getVMInstallId()
  {
    return getAttribute("vm-install-id", null);
  }
  
  public boolean isUsingDefaultJRE()
  {
    return getVMInstallTypeId() == null;
  }
  
  public IVMInstall getVMInstall()
  {
    if (getVMInstallTypeId() == null) {
      return JavaRuntime.getDefaultVMInstall();
    }
    try
    {
      IVMInstallType vmInstallType = JavaRuntime.getVMInstallType(getVMInstallTypeId());
      IVMInstall[] vmInstalls = vmInstallType.getVMInstalls();
      String id = getVMInstallId();
      IVMInstall[] arrayOfIVMInstall1;
      int j = (arrayOfIVMInstall1 = vmInstalls).length;
      for (int i = 0; i < j; i++)
      {
        IVMInstall vmInst = arrayOfIVMInstall1[i];
        if (id.equals(vmInst.getId())) {
          return vmInst;
        }
      }
    }
    catch (Exception localException) {}
    return null;
  }
  
  public IStatus validate()
  {
    IStatus status = super.validate();
    if (!status.isOK()) {
      return status;
    }
    IRuntime runtime = getRuntime();
    
    IPath path = runtime.getLocation();
    if (!path.toFile().exists()) {
      return new Status(4, "org.eclipse.jst.server.core", 0, Messages.errorLocation, null);
    }
    if (getVMInstall() == null) {
      return new Status(4, "org.eclipse.jst.server.core", 0, Messages.errorJRE, null);
    }
    return Status.OK_STATUS;
  }
  
  public void setVMInstall(IVMInstall vmInstall)
  {
    if (vmInstall == null) {
      setVMInstall(null, null);
    } else {
      setVMInstall(vmInstall.getVMInstallType().getId(), vmInstall.getId());
    }
  }
  
  protected void setVMInstall(String typeId, String id)
  {
    if (typeId == null) {
      setAttribute("vm-install-type-id", null);
    } else {
      setAttribute("vm-install-type-id", typeId);
    }
    if (id == null) {
      setAttribute("vm-install-id", null);
    } else {
      setAttribute("vm-install-id", id);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.internal.GenericRuntime
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core.internal;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jst.server.core.RuntimeClasspathProviderDelegate;
import org.eclipse.wst.server.core.IRuntime;

public class GenericRuntimeClasspathProvider
  extends RuntimeClasspathProviderDelegate
{
  public IClasspathEntry[] resolveClasspathContainer(IProject project, IRuntime runtime)
  {
    IPath installPath = runtime.getLocation();
    if (installPath == null) {
      return new IClasspathEntry[0];
    }
    List<IClasspathEntry> list = new ArrayList();
    addLibraryEntries(list, installPath.toFile(), false);
    return (IClasspathEntry[])list.toArray(new IClasspathEntry[list.size()]);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.internal.GenericRuntimeClasspathProvider
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core.internal;

import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.IRuntimeType;

public class GenericRuntimeUtil
{
  protected static final String RUNTIME_TYPE_ID = "org.eclipse.jst.server.core.runtimeType";
  
  public static boolean isGenericJ2EERuntime(IRuntime runtime)
  {
    if (runtime == null) {
      throw new IllegalArgumentException();
    }
    return (runtime.getRuntimeType() != null) && (runtime.getRuntimeType().getId().startsWith("org.eclipse.jst.server.core.runtimeType"));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.internal.GenericRuntimeUtil
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core.internal;

import org.eclipse.jst.server.core.IJavaRuntime;

public abstract interface IGenericRuntime
  extends IJavaRuntime
{}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.internal.IGenericRuntime
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core.internal;

import org.eclipse.jst.server.core.IJavaRuntimeWorkingCopy;

public abstract interface IGenericRuntimeWorkingCopy
  extends IGenericRuntime, IJavaRuntimeWorkingCopy
{}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.internal.IGenericRuntimeWorkingCopy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core.internal;

public abstract interface IMemento
{
  public abstract IMemento createChild(String paramString);
  
  public abstract IMemento getChild(String paramString);
  
  public abstract IMemento[] getChildren(String paramString);
  
  public abstract String getString(String paramString);
  
  public abstract void putString(String paramString1, String paramString2);
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.internal.IMemento
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core.internal;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.jst.server.core.JndiLaunchable;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.ClientDelegate;

public class J2EELaunchableClient
  extends ClientDelegate
{
  public boolean supports(IServer server, Object launchable, String launchMode)
  {
    return launchable instanceof JndiLaunchable;
  }
  
  public IStatus launch(IServer server, Object launchable, String launchMode, ILaunch launch)
  {
    if (Trace.FINEST) {
      Trace.trace("/finest", "JNDI client launched");
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.server.core.internal.J2EELaunchableClient
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.server.core.internal;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jst.server.core.IEnterpriseApplication;
import org.eclipse.jst.server.core.IJ2EEModule;
import org.eclipse.jst.server.core.IWebModule;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.ServerUtil;

public class J2EEUtil
{
  private static final String EAR_MODULE = "jst.ear";
  private static final String WEB_MODULE = "jst.web";
  private static final IModule[] EMPTY_LIST = new IModule[0];
  private static Map<IModule, List<IModule>> earCache;
  private static Map<IJ2EEModule, List<IModule>> earCache2;
  private static Map<IModule, List<IModule>> webCache;
  protected static String cache;
  
  public static IModule[] getEnterpriseApplications(IJ2EEModule module, IProgressMonitor monitor)
  {
    if (shouldUseCache())
    {
      List<IModule> list = (List)earCache2.get(module);
      if (list == null) {
        return EMPTY_LIST;
      }
      return (IModule[])list.toArray(new IModule[list.size()]);
    }
    List<IModule> list = new ArrayList();
    IModule[] modules = ServerUtil.getModules("jst.ear");
    if (modules != null)
    {
      IModule[] arrayOfIModule1;
      int j = (arrayOfIModule1 = modules).length;
      for (int i = 0; i < j; i++)
      {
        IModule module2 = arrayOfIModule1[i];
        IEnterpriseApplication ear = (IEnterpriseApplication)module2.loadAdapter(IEnterpriseApplication.class, monitor);
        if (ear != null)
        {
          IModule[] modules2 = ear.getModules();
          if (modules2 != null)
          {
            IModule[] arrayOfIModule2;
            int m = (arrayOfIModule2 = modules2).length;
            for (int k = 0; k < m; k++)
            {
              IModule m = arrayOfIModule2[k];
              if (module.equals(m.loadAdapter(IJ2EEModule.class, monitor))) {
                list.add(module2);
              }
            }
          }
        }
      }
    }
    return (IModule[])list.toArray(new IModule[list.size()]);
  }
  
  public static IMo
1 2 3

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd