org.eclipse.ecf_3.1.300.v20120610-1946

16:43:17.389 INFO  jd.cli.Main - Decompiling org.eclipse.ecf_3.1.300.v20120610-1946.jar
package org.eclipse.ecf.core;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.ecf.core.events.ContainerDisposeEvent;
import org.eclipse.ecf.core.events.IContainerEvent;
import org.eclipse.ecf.core.security.Callback;
import org.eclipse.ecf.core.security.CallbackHandler;
import org.eclipse.ecf.core.security.IConnectContext;
import org.eclipse.ecf.core.security.ObjectCallback;
import org.eclipse.ecf.internal.core.ECFPlugin;

public abstract class AbstractContainer
  implements IContainer
{
  private final List containerListeners = new ArrayList(5);
  
  public void addListener(IContainerListener l)
  {
    synchronized (containerListeners)
    {
      containerListeners.add(l);
    }
  }
  
  public void removeListener(IContainerListener l)
  {
    synchronized (containerListeners)
    {
      containerListeners.remove(l);
    }
  }
  
  public void dispose()
  {
    fireContainerEvent(new ContainerDisposeEvent(getID()));
    synchronized (containerListeners)
    {
      containerListeners.clear();
    }
  }
  
  protected void fireContainerEvent(IContainerEvent event)
  {
    List toNotify = null;
    synchronized (containerListeners)
    {
      toNotify = new ArrayList(containerListeners);
    }
    for (Iterator i = toNotify.iterator(); i.hasNext();)
    {
      IContainerListener l = (IContainerListener)i.next();
      l.handleEvent(event);
    }
  }
  
  public Object getAdapter(Class serviceType)
  {
    if (serviceType == null) {
      return null;
    }
    if (serviceType.isInstance(this)) {
      return this;
    }
    ECFPlugin plugin = ECFPlugin.getDefault();
    if (plugin == null) {
      return null;
    }
    IAdapterManager adapterManager = plugin.getAdapterManager();
    return adapterManager == null ? null : adapterManager.loadAdapter(this, serviceType.getName());
  }
  
  protected String getPasswordFromConnectContext(IConnectContext connectContext)
    throws ContainerConnectException
  {
    String pw = null;
    try
    {
      Callback[] callbacks = new Callback[1];
      callbacks[0] = new ObjectCallback();
      if (connectContext != null)
      {
        CallbackHandler handler = connectContext.getCallbackHandler();
        if (handler != null) {
          handler.handle(callbacks);
        }
      }
      ObjectCallback cb = (ObjectCallback)callbacks[0];
      pw = (String)cb.getObject();
    }
    catch (Exception e)
    {
      throw new ContainerConnectException("Exception in CallbackHandler.handle(<callbacks>)", e);
    }
    return pw;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ecf.core.AbstractContainer
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ecf.core;

import org.eclipse.core.runtime.IAdapterFactory;

public abstract class AbstractContainerAdapterFactory
  implements IAdapterFactory
{
  public Object getAdapter(Object adaptableObject, Class adapterType)
  {
    if ((adaptableObject == null) || (adapterType == null)) {
      return null;
    }
    if (IContainer.class.isInstance(adaptableObject)) {
      return getContainerAdapter((IContainer)adaptableObject, adapterType);
    }
    return null;
  }
  
  protected abstract Object getContainerAdapter(IContainer paramIContainer, Class paramClass);
  
  public abstract Class[] getAdapterList();
}

/* Location:
 * Qualified Name:     org.eclipse.ecf.core.AbstractContainerAdapterFactory
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ecf.core;

import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.IDCreateException;
import org.eclipse.ecf.core.identity.IDFactory;
import org.eclipse.ecf.core.identity.IIDFactory;
import org.eclipse.ecf.core.provider.BaseContainerInstantiator;

public class BaseContainer$Instantiator
  extends BaseContainerInstantiator
{
  private static long nextBaseContainerID = 0L;
  
  public IContainer createInstance(ContainerTypeDescription description, Object[] parameters)
    throws ContainerCreateException
  {
    try
    {
      if ((parameters != null) && (parameters.length > 0))
      {
        if ((parameters[0] instanceof ID)) {
          return new BaseContainer((ID)parameters[0]);
        }
        if ((parameters[0] instanceof String)) {
          return new BaseContainer(IDFactory.getDefault().createStringID((String)parameters[0]));
        }
      }
    }
    catch (IDCreateException e)
    {
      throw new ContainerCreateException("Could not create ID for basecontainer");
    }
    return new BaseContainer(nextBaseContainerID++);
  }
  
  public String[] getSupportedAdapterTypes(ContainerTypeDescription description)
  {
    Class tmp4_1 = BaseContainer.class$0;
    if (tmp4_1 == null)
    {
      tmp4_1;
      try
      {
        tmpTernaryOp = (BaseContainer.class$0 = Class.forName("org.eclipse.ecf.core.BaseContainer"));
      }
      catch (ClassNotFoundException localClassNotFoundException)
      {
        throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
      }
    }
    return getInterfacesAndAdaptersForClass(tmp4_1);
  }
  
  public Class[][] getSupportedParameterTypes(ContainerTypeDescription description)
  {
    Class[] tmp17_14 = new Class[1]; Class tmp22_19 = BaseContainer.class$1;
    if (tmp22_19 == null)
    {
      tmp22_19;
      try
      {
        tmpTernaryOp = (BaseContainer.class$1 = Class.forName("org.eclipse.ecf.core.identity.ID"));
      }
      catch (ClassNotFoundException localClassNotFoundException1)
      {
        throw new NoClassDefFoundError(localClassNotFoundException1.getMessage());
      }
    }
    tmp17_14[0] = tmp22_19;{ new Class[0] }[1] = tmp17_14; Class[][] tmp53_11 = tmp11_4; Class[] tmp59_56 = new Class[1]; Class tmp64_61 = BaseContainer.class$2;
    if (tmp64_61 == null)
    {
      tmp64_61;
      try
      {
        tmpTernaryOp = (BaseContainer.class$2 = Class.forName("java.lang.String"));
      }
      catch (ClassNotFoundException localClassNotFoundException2)
      {
        throw new NoClassDefFoundError(localClassNotFoundException2.getMessage());
      }
    }
    tmp59_56[0] = tmp64_61;tmp53_11[2] = tmp59_56;return tmp53_11;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ecf.core.BaseContainer.Instantiator
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ecf.core;

import org.eclipse.core.runtime.Assert;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.identity.IDCreateException;
import org.eclipse.ecf.core.identity.IDFactory;
import org.eclipse.ecf.core.identity.IIDFactory;
import org.eclipse.ecf.core.identity.Namespace;
import org.eclipse.ecf.core.provider.BaseContainerInstantiator;
import org.eclipse.ecf.core.security.IConnectContext;

public class BaseContainer
  extends AbstractContainer
{
  public static class Instantiator
    extends BaseContainerInstantiator
  {
    private static long nextBaseContainerID = 0L;
    
    public IContainer createInstance(ContainerTypeDescription description, Object[] parameters)
      throws ContainerCreateException
    {
      try
      {
        if ((parameters != null) && (parameters.length > 0))
        {
          if ((parameters[0] instanceof ID)) {
            return new BaseContainer((ID)parameters[0]);
          }
          if ((parameters[0] instanceof String)) {
            return new BaseContainer(IDFactory.getDefault().createStringID((String)parameters[0]));
          }
        }
      }
      catch (IDCreateException e)
      {
        throw new ContainerCreateException("Could not create ID for basecontainer");
      }
      return new BaseContainer(nextBaseContainerID++);
    }
    
    public String[] getSupportedAdapterTypes(ContainerTypeDescription description)
    {
      Class tmp4_1 = BaseContainer.class$0;
      if (tmp4_1 == null)
      {
        tmp4_1;
        try
        {
          tmpTernaryOp = (BaseContainer.class$0 = Class.forName("org.eclipse.ecf.core.BaseContainer"));
        }
        catch (ClassNotFoundException localClassNotFoundException)
        {
          throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
        }
      }
      return getInterfacesAndAdaptersForClass(tmp4_1);
    }
    
    public Class[][] getSupportedParameterTypes(ContainerTypeDescription description)
    {
      Class[] tmp17_14 = new Class[1]; Class tmp22_19 = BaseContainer.class$1;
      if (tmp22_19 == null)
      {
        tmp22_19;
        try
        {
          tmpTernaryOp = (BaseContainer.class$1 = Class.forName("org.eclipse.ecf.core.identity.ID"));
        }
        catch (ClassNotFoundException localClassNotFoundException1)
        {
          throw new NoClassDefFoundError(localClassNotFoundException1.getMessage());
        }
      }
      tmp17_14[0] = tmp22_19;{ new Class[0] }[1] = tmp17_14; Class[][] tmp53_11 = tmp11_4; Class[] tmp59_56 = new Class[1]; Class tmp64_61 = BaseContainer.class$2;
      if (tmp64_61 == null)
      {
        tmp64_61;
        try
        {
          tmpTernaryOp = (BaseContainer.class$2 = Class.forName("java.lang.String"));
        }
        catch (ClassNotFoundException localClassNotFoundException2)
        {
          throw new NoClassDefFoundError(localClassNotFoundException2.getMessage());
        }
      }
      tmp59_56[0] = tmp64_61;tmp53_11[2] = tmp59_56;return tmp53_11;
    }
  }
  
  private ID id = null;
  static Class class$0;
  static Class class$1;
  static Class class$2;
  
  protected BaseContainer(long idl)
    throws ContainerCreateException
  {
    try
    {
      id = IDFactory.getDefault().createLongID(idl);
    }
    catch (IDCreateException e)
    {
      throw new ContainerCreateException("Could not create ID for basecontainer", e);
    }
  }
  
  protected BaseContainer(ID id)
  {
    Assert.isNotNull(id);
    this.id = id;
  }
  
  public void connect(ID targetID, IConnectContext connectContext)
    throws ContainerConnectException
  {
    throw new ContainerConnectException("Connect not supported");
  }
  
  public void disconnect() {}
  
  public Namespace getConnectNamespace()
  {
    return null;
  }
  
  public ID getConnectedID()
  {
    return null;
  }
  
  public ID getID()
  {
    return id;
  }
  
  public String toString()
  {
    StringBuffer sb = new StringBuffer("BaseContainer[");
    sb.append("id=").append(getID()).append("]");
    return sb.toString();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ecf.core.BaseContainer
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ecf.core;

public class ContainerAuthenticationException
  extends ContainerConnectException
{
  private static final long serialVersionUID = 7038962779623213444L;
  
  public ContainerAuthenticationException() {}
  
  public ContainerAuthenticationException(String message)
  {
    super(message);
  }
  
  public ContainerAuthenticationException(Throwable cause)
  {
    super(cause);
  }
  
  public ContainerAuthenticationException(String message, Throwable cause)
  {
    super(message, cause);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ecf.core.ContainerAuthenticationException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ecf.core;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.ecf.core.util.ECFException;

public class ContainerConnectException
  extends ECFException
{
  private static final long serialVersionUID = 4078658849424746859L;
  
  public ContainerConnectException() {}
  
  public ContainerConnectException(String message)
  {
    super(message);
  }
  
  public ContainerConnectException(Throwable cause)
  {
    super(cause);
  }
  
  public ContainerConnectException(String message, Throwable cause)
  {
    super(message, cause);
  }
  
  public ContainerConnectException(IStatus status)
  {
    super(status);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ecf.core.ContainerConnectException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ecf.core;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.ecf.core.util.ECFException;

public class ContainerCreateException
  extends ECFException
{
  private static final long serialVersionUID = -6979687717421003065L;
  
  public ContainerCreateException(IStatus status)
  {
    super(status);
  }
  
  public ContainerCreateException() {}
  
  public ContainerCreateException(String message)
  {
    super(message);
  }
  
  public ContainerCreateException(Throwable cause)
  {
    super(cause);
  }
  
  public ContainerCreateException(String message, Throwable cause)
  {
    super(message, cause);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ecf.core.ContainerCreateException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ecf.core;

import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.Status;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.internal.core.ECFPlugin;
import org.eclipse.ecf.internal.core.IDisposable;
import org.osgi.framework.Bundle;

class ContainerFactory$1
  implements IDisposable
{
  final ContainerFactory this$0;
  
  ContainerFactory$1(ContainerFactory paramContainerFactory)
  {
    this$0 = paramContainerFactory;
  }
  
  public void dispose()
  {
    synchronized (ContainerFactory.containers)
    {
      for (Iterator i = ContainerFactory.containers.keySet().iterator(); i.hasNext();)
      {
        ContainerFactory.ContainerEntry entry = (ContainerFactory.ContainerEntry)ContainerFactory.containers.get(i.next());
        if (entry != null)
        {
          IContainer c = entry.getContainer();
          try
          {
            c.dispose();
          }
          catch (Throwable e)
          {
            ECFPlugin.getDefault().log(new Status(4, ECFPlugin.getDefault().getBundle().getSymbolicName(), 4, "container dispose error", e)); Class 
              tmp100_97 = ContainerFactory.class$0;
            if (tmp100_97 == null)
            {
              tmp100_97;
              try
              {
                tmpTernaryOp = (ContainerFactory.class$0 = Class.forName("org.eclipse.ecf.core.ContainerFactory"));
              }
              catch (ClassNotFoundException localClassNotFoundException)
              {
                throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
              }
            }
            Trace.catching("org.eclipse.ecf", "org.eclipse.ecf/debug/exceptions/catching", tmp100_97, "doDispose", e);
          }
        }
      }
      ContainerFactory.containers.clear();
    }
    ContainerFactory.containerdescriptions.clear();
    ContainerFactory.managerListeners.clear();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ecf.core.ContainerFactory.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ecf.core;

class ContainerFactory$ContainerEntry
{
  private final IContainer container;
  private final ContainerTypeDescription typeDescription;
  final ContainerFactory this$0;
  
  public ContainerFactory$ContainerEntry(ContainerFactory paramContainerFactory, IContainer container, ContainerTypeDescription typeDescription)
  {
    this$0 = paramContainerFactory;
    this.container = container;
    this.typeDescription = typeDescription;
  }
  
  public IContainer getContainer()
  {
    return container;
  }
  
  public ContainerTypeDescription getContainerTypeDescription()
  {
    return typeDescription;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ecf.core.ContainerFactory.ContainerEntry
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ecf.core;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.Status;
import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.provider.IContainerInstantiator;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.internal.core.ECFPlugin;
import org.eclipse.ecf.internal.core.IDisposable;
import org.osgi.framework.Bundle;

public class ContainerFactory
  implements IContainerFactory, IContainerManager
{
  static final Map containerdescriptions = new HashMap();
  static final Map containers = new HashMap();
  static final List managerListeners = new ArrayList();
  private static volatile boolean init = false;
  private static IContainerFactory instance = new ContainerFactory();
  public static final String BASE_CONTAINER_NAME = "ecf.base";
  
  class ContainerEntry
  {
    private final IContainer container;
    private final ContainerTypeDescription typeDescription;
    
    public ContainerEntry(IContainer container, ContainerTypeDescription typeDescription)
    {
      this.container = container;
      this.typeDescription = typeDescription;
    }
    
    public IContainer getContainer()
    {
      return container;
    }
    
    public ContainerTypeDescription getContainerTypeDescription()
    {
      return typeDescription;
    }
  }
  
  public static synchronized IContainerFactory getDefault()
  {
    if (!init)
    {
      init = true;
      ECFPlugin.getDefault().initializeExtensions();
    }
    return instance;
  }
  
  protected ContainerFactory()
  {
    ECFPlugin.getDefault().addDisposable(new IDisposable()
    {
      public void dispose()
      {
        synchronized (ContainerFactory.containers)
        {
          for (Iterator i = ContainerFactory.containers.keySet().iterator(); i.hasNext();)
          {
            ContainerFactory.ContainerEntry entry = (ContainerFactory.ContainerEntry)ContainerFactory.containers.get(i.next());
            if (entry != null)
            {
              IContainer c = entry.getContainer();
              try
              {
                c.dispose();
              }
              catch (Throwable e)
              {
                ECFPlugin.getDefault().log(new Status(4, ECFPlugin.getDefault().getBundle().getSymbolicName(), 4, "container dispose error", e)); Class 
                  tmp100_97 = ContainerFactory.class$0;
                if (tmp100_97 == null)
                {
                  tmp100_97;
                  try
                  {
                    tmpTernaryOp = (ContainerFactory.class$0 = Class.forName("org.eclipse.ecf.core.ContainerFactory"));
                  }
                  catch (ClassNotFoundException localClassNotFoundException)
                  {
                    throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
                  }
                }
                Trace.catching("org.eclipse.ecf", "org.eclipse.ecf/debug/exceptions/catching", tmp100_97, "doDispose", e);
              }
            }
          }
          ContainerFactory.containers.clear();
        }
        ContainerFactory.containerdescriptions.clear();
        ContainerFactory.managerListeners.clear();
      }
    });
  }
  
  public ContainerTypeDescription addDescription(ContainerTypeDescription containerTypeDescription)
  {
    return addDescription0(containerTypeDescription);
  }
  
  public List getDescriptions()
  {
    return getDescriptions0();
  }
  
  /* Error */
  protected List getDescriptions0()
  {
    // Byte code:
    //   0: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   3: dup
    //   4: astore_1
    //   5: monitorenter
    //   6: new 183	java/util/ArrayList
    //   9: dup
    //   10: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   13: invokeinterface 437 1 0
    //   18: invokespecial 381	java/util/ArrayList:<init>	(Ljava/util/Collection;)V
    //   21: aload_1
    //   22: monitorexit
    //   23: areturn
    //   24: aload_1
    //   25: monitorexit
    //   26: athrow
    // Line number table:
    //   Java source line #130	-> byte code offset #0
    //   Java source line #131	-> byte code offset #6
    //   Java source line #130	-> byte code offset #24
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	27	0	this	ContainerFactory
    //   4	21	1	Ljava/lang/Object;	Object
    // Exception table:
    //   from	to	target	type
    //   6	23	24	finally
    //   24	26	24	finally
  }
  
  /* Error */
  protected ContainerTypeDescription addDescription0(ContainerTypeDescription containerTypeDescription)
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnonnull +5 -> 6
    //   4: aconst_null
    //   5: areturn
    //   6: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   9: dup
    //   10: astore_2
    //   11: monitorenter
    //   12: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   15: aload_1
    //   16: invokevirtual 418	org/eclipse/ecf/core/ContainerTypeDescription:getName	()Ljava/lang/String;
    //   19: aload_1
    //   20: invokeinterface 441 3 0
    //   25: checkcast 195	org/eclipse/ecf/core/ContainerTypeDescription
    //   28: aload_2
    //   29: monitorexit
    //   30: areturn
    //   31: aload_2
    //   32: monitorexit
    //   33: athrow
    // Line number table:
    //   Java source line #136	-> byte code offset #0
    //   Java source line #137	-> byte code offset #4
    //   Java source line #138	-> byte code offset #6
    //   Java source line #139	-> byte code offset #12
    //   Java source line #138	-> byte code offset #31
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	34	0	this	ContainerFactory
    //   0	34	1	containerTypeDescription	ContainerTypeDescription
    //   10	22	2	Ljava/lang/Object;	Object
    // Exception table:
    //   from	to	target	type
    //   12	30	31	finally
    //   31	33	31	finally
  }
  
  public boolean containsDescription(ContainerTypeDescription containerTypeDescription)
  {
    return containsDescription0(containerTypeDescription);
  }
  
  /* Error */
  protected boolean containsDescription0(ContainerTypeDescription containerTypeDescription)
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnonnull +5 -> 6
    //   4: iconst_0
    //   5: ireturn
    //   6: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   9: dup
    //   10: astore_2
    //   11: monitorenter
    //   12: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   15: aload_1
    //   16: invokevirtual 418	org/eclipse/ecf/core/ContainerTypeDescription:getName	()Ljava/lang/String;
    //   19: invokeinterface 436 2 0
    //   24: aload_2
    //   25: monitorexit
    //   26: ireturn
    //   27: aload_2
    //   28: monitorexit
    //   29: athrow
    // Line number table:
    //   Java source line #153	-> byte code offset #0
    //   Java source line #154	-> byte code offset #4
    //   Java source line #155	-> byte code offset #6
    //   Java source line #156	-> byte code offset #12
    //   Java source line #155	-> byte code offset #27
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	30	0	this	ContainerFactory
    //   0	30	1	containerTypeDescription	ContainerTypeDescription
    //   10	18	2	Ljava/lang/Object;	Object
    // Exception table:
    //   from	to	target	type
    //   12	26	27	finally
    //   27	29	27	finally
  }
  
  /* Error */
  protected ContainerTypeDescription getDescription0(ContainerTypeDescription containerTypeDescription)
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnonnull +5 -> 6
    //   4: aconst_null
    //   5: areturn
    //   6: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   9: dup
    //   10: astore_2
    //   11: monitorenter
    //   12: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   15: aload_1
    //   16: invokevirtual 418	org/eclipse/ecf/core/ContainerTypeDescription:getName	()Ljava/lang/String;
    //   19: invokeinterface 439 2 0
    //   24: checkcast 195	org/eclipse/ecf/core/ContainerTypeDescription
    //   27: aload_2
    //   28: monitorexit
    //   29: areturn
    //   30: aload_2
    //   31: monitorexit
    //   32: athrow
    // Line number table:
    //   Java source line #161	-> byte code offset #0
    //   Java source line #162	-> byte code offset #4
    //   Java source line #163	-> byte code offset #6
    //   Java source line #164	-> byte code offset #12
    //   Java source line #163	-> byte code offset #30
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	33	0	this	ContainerFactory
    //   0	33	1	containerTypeDescription	ContainerTypeDescription
    //   10	21	2	Ljava/lang/Object;	Object
    // Exception table:
    //   from	to	target	type
    //   12	29	30	finally
    //   30	32	30	finally
  }
  
  /* Error */
  protected ContainerTypeDescription getDescription0(String containerTypeDescriptionName)
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnonnull +5 -> 6
    //   4: aconst_null
    //   5: areturn
    //   6: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   9: dup
    //   10: astore_2
    //   11: monitorenter
    //   12: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   15: aload_1
    //   16: invokeinterface 439 2 0
    //   21: checkcast 195	org/eclipse/ecf/core/ContainerTypeDescription
    //   24: aload_2
    //   25: monitorexit
    //   26: areturn
    //   27: aload_2
    //   28: monitorexit
    //   29: athrow
    // Line number table:
    //   Java source line #169	-> byte code offset #0
    //   Java source line #170	-> byte code offset #4
    //   Java source line #171	-> byte code offset #6
    //   Java source line #172	-> byte code offset #12
    //   Java source line #171	-> byte code offset #27
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	30	0	this	ContainerFactory
    //   0	30	1	containerTypeDescriptionName	String
    //   10	18	2	Ljava/lang/Object;	Object
    // Exception table:
    //   from	to	target	type
    //   12	26	27	finally
    //   27	29	27	finally
  }
  
  public ContainerTypeDescription getDescriptionByName(String containerTypeDescriptionName)
  {
    return getDescription0(containerTypeDescriptionName);
  }
  
  public ContainerTypeDescription removeDescription(ContainerTypeDescription containerTypeDescription)
  {
    return removeDescription0(containerTypeDescription);
  }
  
  /* Error */
  protected ContainerTypeDescription removeDescription0(ContainerTypeDescription containerTypeDescription)
  {
    // Byte code:
    //   0: aload_1
    //   1: ifnonnull +5 -> 6
    //   4: aconst_null
    //   5: areturn
    //   6: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   9: dup
    //   10: astore_2
    //   11: monitorenter
    //   12: getstatic 365	org/eclipse/ecf/core/ContainerFactory:containerdescriptions	Ljava/util/Map;
    //   15: aload_1
    //   16: invokevirtual 418	org/eclipse/ecf/core/ContainerTypeDescription:getName	()Ljava/lang/String;
    //   19: invokeinterface 440 2 0
    //   24: checkcast 195	org/eclipse/ecf/core/ContainerTypeDescription
    //   27: aload_2
    //   28: monitorexit
    //   29: areturn
    //   30: aload_2
    //   31: monitorexit
    //   32: athrow
    // Line number table:
    //   Java source line #196	-> byte code offset #0
    //   Java source line #197	-> byte code offset #4
    //   Java source line #198	-> byte code offset #6
    //   Java source line #199	-> byte code offset #12
    //   Java source line #198	-> byte code offset #30
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	33	0	this	ContainerFactory
    //   0	33	1	containerTypeDescription	ContainerTypeDescription
    //   10	21	2	Ljava/lang/Object;	Object
    // Exception table:
    //   from	to	target	type
    //   12	29	30	finally
    //   30	32	30	finally
  }
  
  public ContainerTypeDescription[] getDescriptionsForContainerAdapter(Class containerAdapter)
  {
    if (containerAdapter == null) {
      throw new NullPointerException("containerAdapter cannot be null");
    }
    List result = new ArrayList();
    List descriptions = getDescriptions();
    for (Iterator i = descriptions.iterator(); i.hasNext();)
    {
      ContainerTypeDescription description = (ContainerTypeDescription)i.next();
      String[] supportedAdapters = description.getSupportedAdapterTypes();
      if (supportedAdapters != null) {
        for (int j = 0; j < supportedAdapters.length; j++) {
          if (supportedAdapters[j].equals(containerAdapter.getName())) {
            result.add(description);
          }
        }
      }
    }
    return (ContainerTypeDescription[])result.toArray(new ContainerTypeDescription[0]);
  }
  
  protected void throwContainerCreateException(String message, Throwable cause, String method)
    throws ContainerCreateException
  {
    ContainerCreateException except = cause == null ? new ContainerCreateException(message) : new ContainerCreateException(message, cause);
    Trace.throwing("org.eclipse.ecf", "org.eclipse.ecf/debug/exceptions/throwing", ContainerFactory.class, method, except);
    throw except;
  }
  
  public IContainer createContainer()
    throws ContainerCreateException
  {
    return createContainer("ecf.base");
  }
  
  public IContainer createContainer(ID containerID)
    throws ContainerCreateException
  {
    if (containerID == null) {
      return createContainer();
    }
    return createContainer("ecf.base", new Object[] { containerID });
  }
  
  public IContainer createContainer(ContainerTypeDescription containerTypeDescription)
    throws ContainerCreateException
  {
    return createContainer(containerTypeDescription, null);
  }
  
  public IContainer createContainer(String containerTypeDescriptionName)
    throws ContainerCreateException
  {
    return createContainer(getDescriptionByNameWithException(containerTypeDescriptionName), null);
  }
  
  private ContainerTypeDescription getDescriptionByNameWithException(String containerTypeDescriptionName)
    throws ContainerCreateException
  {
    ContainerTypeDescription typeDescription = getDescriptionByName(containerTypeDescriptionName);
    if (typeDescription == null) {
      throw new ContainerCreateException("Container type description with name=" + containerTypeDescriptionName + " not found.  This may indicate that the desired provider is not available or not startable within runtime.");
    }
    return typeDescription;
  }
  
  public IContainer createContainer(ContainerTypeDescription containerTypeDescription, Object[] parameters)
    throws ContainerCreateException
  {
    String method = "createContainer";
    Trace.entering("org.eclipse.ecf", "org.eclipse.ecf/debug/methods/entering", tmp12_9, method, new Object[] { containerTypeDescription, Trace.getArgumentsString(parameters) });
    if (containerTypeDescription == null) {
      throwContainerCreateException("ContainerTypeDescription cannot be null", null, method);
    }
    ContainerTypeDescription cd = getDescription0(containerTypeDescription);
    if (cd == null) {
      throwContainerCreateException("ContainerTypeDescription '" + 
        containerTypeDescription.getName() + "' not found", null, method);
    }
    IContainerInstantiator instantiator = null;
    try
    {
      instantiator = cd.getInstantiator();
    }
    catch (Exception e)
    {
      throwContainerCreateException("createContainer cannot get IContainerInstantiator for description : " + 
        containerTypeDescription, e, method);
    }
    IContainer container = instantiator.createInstance(containerTypeDescription, parameters);
    if (container == null) {
      throwContainerCreateException("Instantiator returned null for '" + 
        cd.getName() + "'", null, method);
    }
    ID containerID = container.getID();
    if (containerID != null) {
      addContainer(container, cd);
    }
    Trace.exiting("org.eclipse.ecf", "org.eclipse.ecf/debug/methods/exiting", ContainerFactory.class, method, container);
    return container;
  }
  
  public IContainer createContainer(String containerTypeDescriptionName, Object[] parameters)
    throws ContainerCreateException
  {
    return createContainer(getDescriptionByNameWithException(containerTypeDescriptionName), parameters);
  }
  
  public IContainer createContainer(ContainerTypeDescription containerTypeDescription, ID containerID, Object[] parameters)
    throws ContainerCreateException
  {
    if (containerID == null) {
      return createContainer(containerTypeDescription, parameters);
    }
    Object[] params = (parameters == null) || (parameters.length == 0) ? new Object[1] : new Object[parameters.length + 1];
    params[0] = containerID;
    if ((parameters != null) && (parameters.length != 0)) {
      System.arraycopy(parameters, 0, params, 1, parameters.length);
    }
    return createContainer(containerTypeDescription, params);
  }
  
  public IContainer createContainer(String containerTypeDescriptionName, ID containerID, Object[] parameters)
    throws ContainerCreateException
  {
    if (containerID == null) {
      return createContainer(containerTypeDescriptionName, parameters);
    }
    return createContainer(getDescriptionByNameWithException(containerTypeDescriptionName), containerID, parameters);
  }
  
  public IContainer createContainer(ContainerTypeDescription containerTypeDescription, ID containerID)
    throws ContainerCreateException
  {
    if (containerID == null) {
      return createContainer(containerTypeDescription);
    }
    return createContainer(containerTypeDescription, new Object[] { containerID });
  }
  
  public IContainer createContainer(String containerTypeDescriptionName, ID containerID)
    throws ContainerCreateException
  {
    return createContainer(getDescriptionByNameWithException(containerTypeDescriptionName), new Object[] { containerID });
  }
  
  public IContainer createContainer(String containerTypeDescriptionName, String containerId)
    throws ContainerCreateException
  {
    return createContainer(getDescriptionByNameWithException(containerTypeDescriptionName), containerId);
  }
  
  public IContainer createContainer(String containerTypeDescriptionName, String containerId, Object[] parameters)
    throws ContainerCreateException
  {
    return createContainer(getDescriptionByNameWithException(containerTypeDescriptionName), containerId, parameters);
  }
  
  public IContainer createContainer(ContainerTypeDescription containerTypeDescription, String containerId)
    throws ContainerCreateException
  {
    return createContainer(containerTypeDescription, containerId, null);
  }
  
  public IContainer createContainer(ContainerTypeDescription containerTypeDescription, String containerId, Object[] parameters)
    throws ContainerCreateException
  {
    if (containerId == null) {
      return createContainer(containerTypeDescription, parameters);
    }
    Object[] params = (parameters == null) || (parameters.length == 0) ? new Object[1] : new Object[parameters.length + 1];
    params[0] = containerId;
    if ((parameters != null) && (parameters.length != 0)) {
      System.arraycopy(parameters, 0, params, 1, parameters.length);
    }
    return createContainer(containerTypeDescription, params);
  }
  
  public IContainer[] getAllContainers()
  {
    List containerValues = new ArrayList();
    synchronized (containers)
    {
      Collection containerEntrys = containers.values();
      for (Iterator i = containerEntrys.iterator(); i.hasNext();)
      {
        ContainerEntry entry = (ContainerEntry)i.next();
        containerValues.add(entry.getContainer());
      }
    }
    return (IContainer[])containerValues.toArray(new IContainer[0]);
  }
  
  public IContainer getContainer(ID containerID)
  {
    if (containerID == null) {
      return null;
    }
    synchronized (containers)
    {
      ContainerEntry entry = (ContainerEntry)containers.get(containerID);
      if (entry == null) {
        return null;
      }
      return entry.getContainer();
    }
  }
  
  /* Error */
  public boolean hasContainer(ID containerID)
  {
    // Byte code:
    //   0: aload_1
    //   1: invokestatic 383	org/eclipse/core/runtime/Assert:isNotNull	(Ljava/lang/Object;)V
    //   4: getstatic 366	org/eclipse/ecf/core/ContainerFactory:containers	Ljava/util/Map;
    //   7: dup
    //   8: astore_2
    //   9: monitorenter
    //   10: getstatic 366	org/eclipse/ecf/core/ContainerFactory:containers	Ljava/util/Map;
    //   13: aload_1
    //   14: invokeinterface 436 2 0
    //   19: aload_2
    //   20: monitorexit
    //   21: ireturn
    //   22: aload_2
    //   23: monitorexit
    //   24: athrow
    // Line number table:
    //   Java source line #429	-> byte code offset #0
    //   Java source line #430	-> byte code offset #4
    //   Java source line #431	-> byte code offset #10
    //   Java source line #430	-> byte code offset #22
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	25	0	this	ContainerFactory
    //   0	25	1	containerID	ID
    //   8	15	2	Ljava/lang/Object;	Object
    // Exception table:
    //   from	to	target	type
    //   10	21	22	finally
    //   22	24	22	finally
  }
  
  /* Error */
  public boolean addListener(IContainerManagerListener listener)
  {
    // Byte code:
    //   0: aload_1
    //   1: invokestatic 383	org/eclipse/core/runtime/Assert:isNotNull	(Ljava/lang/Object;)V
    //   4: getstatic 364	org/eclipse/ecf/core/ContainerFactory:managerListeners	Ljava/util/List;
    //   7: dup
    //   8: astore_2
    //   9: monitorenter
    //   10: getstatic 364	org/eclipse/ecf/core/ContainerFactory:managerListeners	Ljava/util/List;
    //   13: aload_1
    //   14: invokeinterface 432 2 0
    //   19: aload_2
    //   20: monitorexit
    //   21: ireturn
    //   22: aload_2
    //   23: monitorexit
    //   24: athrow
    // Line number table:
    //   Java source line #439	-> byte code offset #0
    //   Java source line #440	-> byte code offset #4
    //   Java source line #441	-> byte code offset #10
    //   Java source line #440	-> byte code offset #22
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	25	0	this	ContainerFactory
    //   0	25	1	listener	IContainerManagerListener
    //   8	15	2	Ljava/lang/Object;	Object
    // Exception table:
    //   from	to	target	type
    //   10	21	22	finally
    //   22	24	22	finally
  }
  
  /* Error */
  public boolean removeListener(IContainerManagerListener listener)
  {
    // Byte code:
    //   0: aload_1
    //   1: invokestatic 383	org/eclipse/core/runtime/Assert:isNotNull	(Ljava/lang/Object;)V
    //   4: getstatic 364	org/eclipse/ecf/core/ContainerFactory:managerListeners	Ljava/util/List;
    //   7: dup
    //   8: astore_2
    //   9: monitorenter
    //   10: getstatic 364	org/eclipse/ecf/core/ContainerFactory:managerListeners	Ljava/util/List;
    //   13: aload_1
    //   14: invokeinterface 433 2 0
    //   19: aload_2
    //   20: monitorexit
    //   21: ireturn
    //   22: aload_2
    //   23: monitorexit
    //   24: athrow
    // Line number table:
    //   Java source line #449	-> byte code offset #0
    //   Java source line #450	-> byte code offset #4
    //   Java source line #451	-> byte code offset #10
    //   Java source line #450	-> byte code offset #22
    // Local variable table:
    //   start	length	slot	name	signatur
1 2 3 4

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