org.eclipse.osgi_3.7.2.v20120110-1415

nit>	(Ljava/io/File;Ljava/lang/String;)V
    //   319: astore 8
    //   321: ldc 2
    //   323: aload 6
    //   325: invokevirtual 246	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   328: ifeq +50 -> 378
    //   331: new 109	java/io/File
    //   334: dup
    //   335: aload_0
    //   336: getfield 235	org/eclipse/osgi/internal/baseadaptor/BundleUpdate:source	Ljava/net/URLConnection;
    //   339: invokevirtual 251	java/net/URLConnection:getURL	()Ljava/net/URL;
    //   342: invokevirtual 248	java/net/URL:getPath	()Ljava/lang/String;
    //   345: invokespecial 242	java/io/File:<init>	(Ljava/lang/String;)V
    //   348: astore 9
    //   350: aload 9
    //   352: invokevirtual 240	java/io/File:isDirectory	()Z
    //   355: ifeq +13 -> 368
    //   358: aload 9
    //   360: aload 8
    //   362: invokestatic 268	org/eclipse/osgi/internal/baseadaptor/AdaptorUtil:copyDir	(Ljava/io/File;Ljava/io/File;)V
    //   365: goto +20 -> 385
    //   368: aload 4
    //   370: aload 8
    //   372: invokestatic 269	org/eclipse/osgi/internal/baseadaptor/AdaptorUtil:readFile	(Ljava/io/InputStream;Ljava/io/File;)V
    //   375: goto +10 -> 385
    //   378: aload 4
    //   380: aload 8
    //   382: invokestatic 269	org/eclipse/osgi/internal/baseadaptor/AdaptorUtil:readFile	(Ljava/io/InputStream;Ljava/io/File;)V
    //   385: aload_0
    //   386: getfield 238	org/eclipse/osgi/internal/baseadaptor/BundleUpdate:storage	Lorg/eclipse/osgi/internal/baseadaptor/BaseStorage;
    //   389: aload_0
    //   390: getfield 237	org/eclipse/osgi/internal/baseadaptor/BundleUpdate:newData	Lorg/eclipse/osgi/baseadaptor/BaseData;
    //   393: iconst_1
    //   394: invokevirtual 272	org/eclipse/osgi/internal/baseadaptor/BaseStorage:loadManifest	(Lorg/eclipse/osgi/baseadaptor/BaseData;Z)Ljava/util/Dictionary;
    //   397: astore 7
    //   399: iconst_0
    //   400: istore 8
    //   402: goto +17 -> 419
    //   405: aload_2
    //   406: iload 8
    //   408: aaload
    //   409: aload 7
    //   411: invokeinterface 284 2 0
    //   416: iinc 8 1
    //   419: iload 8
    //   421: aload_2
    //   422: arraylength
    //   423: if_icmplt -18 -> 405
    //   426: goto +22 -> 448
    //   429: astore 10
    //   431: aload 4
    //   433: ifnull +12 -> 445
    //   436: aload 4
    //   438: invokevirtual 244	java/io/InputStream:close	()V
    //   441: goto +4 -> 445
    //   444: pop
    //   445: aload 10
    //   447: athrow
    //   448: aload 4
    //   450: ifnull +30 -> 480
    //   453: aload 4
    //   455: invokevirtual 244	java/io/InputStream:close	()V
    //   458: goto +22 -> 480
    //   461: pop
    //   462: goto +18 -> 480
    //   465: astore_1
    //   466: new 130	org/osgi/framework/BundleException
    //   469: dup
    //   470: getstatic 233	org/eclipse/osgi/internal/baseadaptor/AdaptorMsg:BUNDLE_READ_EXCEPTION	Ljava/lang/String;
    //   473: bipush 11
    //   475: aload_1
    //   476: invokespecial 281	org/osgi/framework/BundleException:<init>	(Ljava/lang/String;ILjava/lang/Throwable;)V
    //   479: athrow
    //   480: aload_0
    //   481: getfield 237	org/eclipse/osgi/internal/baseadaptor/BundleUpdate:newData	Lorg/eclipse/osgi/baseadaptor/BaseData;
    //   484: areturn
    // Line number table:
    //   Java source line #46	-> byte code offset #0
    //   Java source line #47	-> byte code offset #25
    //   Java source line #48	-> byte code offset #35
    //   Java source line #49	-> byte code offset #49
    //   Java source line #51	-> byte code offset #63
    //   Java source line #52	-> byte code offset #77
    //   Java source line #53	-> byte code offset #83
    //   Java source line #54	-> byte code offset #88
    //   Java source line #55	-> byte code offset #103
    //   Java source line #53	-> byte code offset #129
    //   Java source line #57	-> byte code offset #138
    //   Java source line #59	-> byte code offset #146
    //   Java source line #60	-> byte code offset #160
    //   Java source line #61	-> byte code offset #169
    //   Java source line #62	-> byte code offset #178
    //   Java source line #64	-> byte code offset #194
    //   Java source line #65	-> byte code offset #202
    //   Java source line #66	-> byte code offset #212
    //   Java source line #67	-> byte code offset #225
    //   Java source line #70	-> byte code offset #241
    //   Java source line #71	-> byte code offset #248
    //   Java source line #72	-> byte code offset #253
    //   Java source line #74	-> byte code offset #262
    //   Java source line #75	-> byte code offset #268
    //   Java source line #76	-> byte code offset #276
    //   Java source line #77	-> byte code offset #295
    //   Java source line #78	-> byte code offset #300
    //   Java source line #79	-> byte code offset #306
    //   Java source line #80	-> byte code offset #321
    //   Java source line #81	-> byte code offset #331
    //   Java source line #82	-> byte code offset #350
    //   Java source line #83	-> byte code offset #358
    //   Java source line #85	-> byte code offset #368
    //   Java source line #88	-> byte code offset #378
    //   Java source line #91	-> byte code offset #385
    //   Java source line #92	-> byte code offset #399
    //   Java source line #93	-> byte code offset #405
    //   Java source line #92	-> byte code offset #416
    //   Java source line #94	-> byte code offset #429
    //   Java source line #96	-> byte code offset #431
    //   Java source line #97	-> byte code offset #436
    //   Java source line #98	-> byte code offset #444
    //   Java source line #101	-> byte code offset #445
    //   Java source line #96	-> byte code offset #448
    //   Java source line #97	-> byte code offset #453
    //   Java source line #98	-> byte code offset #461
    //   Java source line #102	-> byte code offset #465
    //   Java source line #103	-> byte code offset #466
    //   Java source line #106	-> byte code offset #480
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	485	0	this	BundleUpdate
    //   76	58	1	storageHooks	org.eclipse.osgi.baseadaptor.hooks.StorageHook[]
    //   465	11	1	e	IOException
    //   82	340	2	instanceHooks	org.eclipse.osgi.baseadaptor.hooks.StorageHook[]
    //   84	49	3	i	int
    //   159	154	3	newStorageHook	BaseStorageHook
    //   167	287	4	in	java.io.InputStream
    //   176	12	5	sourceURL	java.net.URL
    //   192	132	6	protocol	String
    //   210	32	7	reference	java.net.URL
    //   266	45	7	genDir	java.io.File
    //   397	13	7	manifest	java.util.Dictionary<String, String>
    //   246	9	8	path	String
    //   319	62	8	outFile	java.io.File
    //   400	20	8	i	int
    //   348	11	9	inFile	java.io.File
    //   429	17	10	localObject	Object
    //   444	1	17	localIOException1	IOException
    //   461	1	18	localIOException2	IOException
    // Exception table:
    //   from	to	target	type
    //   194	429	429	finally
    //   431	441	444	java/io/IOException
    //   448	458	461	java/io/IOException
    //   0	462	465	java/io/IOException
  }
  
  public void commit(boolean postpone)
    throws BundleException
  {
    storage.processExtension(data, (byte)4);
    storage.processExtension(newData, (byte)8);
    newData.setLastModified(System.currentTimeMillis());
    storage.updateState(newData, 8);
    try
    {
      newData.save();
    }
    catch (IOException e)
    {
      throw new BundleException(AdaptorMsg.ADAPTOR_STORAGE_EXCEPTION, e);
    }
    BaseStorageHook oldStorageHook = (BaseStorageHook)data.getStorageHook(BaseStorageHook.KEY);
    try
    {
      oldStorageHook.delete(postpone, 2);
    }
    catch (IOException e)
    {
      data.getAdaptor().getEventPublisher().publishFrameworkEvent(2, data.getBundle(), e);
    }
  }
  
  public void undo()
    throws BundleException
  {
    if (newData != null)
    {
      BaseStorageHook newStorageHook = (BaseStorageHook)newData.getStorageHook(BaseStorageHook.KEY);
      try
      {
        if (newStorageHook != null) {
          newStorageHook.delete(false, 2);
        }
      }
      catch (IOException e)
      {
        data.getAdaptor().getEventPublisher().publishFrameworkEvent(2, data.getBundle(), e);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.baseadaptor.BundleUpdate
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.baseadaptor;

import java.io.File;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.AllPermission;
import java.security.CodeSource;
import java.security.PermissionCollection;
import java.security.ProtectionDomain;
import java.security.cert.Certificate;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import org.eclipse.osgi.baseadaptor.BaseData;
import org.eclipse.osgi.baseadaptor.bundlefile.BundleEntry;
import org.eclipse.osgi.baseadaptor.bundlefile.BundleFile;
import org.eclipse.osgi.baseadaptor.bundlefile.BundleFileWrapperChain;
import org.eclipse.osgi.baseadaptor.loader.ClasspathEntry;
import org.eclipse.osgi.baseadaptor.loader.ClasspathManager;
import org.eclipse.osgi.baseadaptor.loader.ParallelClassLoader;
import org.eclipse.osgi.framework.adaptor.BundleData;
import org.eclipse.osgi.framework.adaptor.BundleProtectionDomain;
import org.eclipse.osgi.framework.adaptor.ClassLoaderDelegate;
import org.eclipse.osgi.framework.debug.Debug;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
import org.eclipse.osgi.signedcontent.SignedContent;
import org.eclipse.osgi.signedcontent.SignerInfo;
import org.osgi.framework.Bundle;

public class DefaultClassLoader
  extends ClassLoader
  implements ParallelClassLoader
{
  protected static final PermissionCollection ALLPERMISSIONS;
  private static final String CLASS_CERTIFICATE_SUPPORT = "osgi.support.class.certificate";
  private static final String CLASS_LOADER_TYPE = "osgi.classloader.type";
  private static final String CLASS_LOADER_TYPE_PARALLEL = "parallel";
  private static final boolean CLASS_CERTIFICATE;
  private static final boolean PARALLEL_CAPABLE;
  private static final Enumeration<URL> EMPTY_ENUMERATION = Collections.enumeration(Collections.EMPTY_LIST);
  protected ClassLoaderDelegate delegate;
  protected ProtectionDomain domain;
  protected ClasspathManager manager;
  
  static
  {
    CLASS_CERTIFICATE = Boolean.valueOf(FrameworkProperties.getProperty("osgi.support.class.certificate", "true")).booleanValue();
    AllPermission allPerm = new AllPermission();
    ALLPERMISSIONS = allPerm.newPermissionCollection();
    if (ALLPERMISSIONS != null) {
      ALLPERMISSIONS.add(allPerm);
    }
    boolean typeParallel = "parallel".equals(FrameworkProperties.getProperty("osgi.classloader.type", "parallel"));
    boolean parallelCapable = false;
    try
    {
      if (typeParallel)
      {
        Method parallelCapableMetod = ClassLoader.class.getDeclaredMethod("registerAsParallelCapable", null);
        parallelCapableMetod.setAccessible(true);
        parallelCapable = ((Boolean)parallelCapableMetod.invoke(null, null)).booleanValue();
      }
    }
    catch (Throwable localThrowable)
    {
      parallelCapable = false;
    }
    PARALLEL_CAPABLE = parallelCapable;
  }
  
  public DefaultClassLoader(ClassLoader parent, ClassLoaderDelegate delegate, ProtectionDomain domain, BaseData bundledata, String[] classpath)
  {
    super(parent);
    this.delegate = delegate;
    this.domain = domain;
    manager = new ClasspathManager(bundledata, classpath, this);
  }
  
  protected Class<?> loadClass(String name, boolean resolve)
    throws ClassNotFoundException
  {
    if (Debug.DEBUG_LOADER) {
      Debug.println("BundleClassLoader[" + delegate + "].loadClass(" + name + ")");
    }
    try
    {
      Class<?> clazz = delegate.findClass(name);
      if (resolve) {
        resolveClass(clazz);
      }
      return clazz;
    }
    catch (Error e)
    {
      if (Debug.DEBUG_LOADER)
      {
        Debug.println("BundleClassLoader[" + delegate + "].loadClass(" + name + ") failed.");
        Debug.printStackTrace(e);
      }
      throw e;
    }
    catch (ClassNotFoundException e)
    {
      if (Debug.DEBUG_LOADER)
      {
        Debug.println("BundleClassLoader[" + delegate + "].loadClass(" + name + ") failed.");
        Debug.printStackTrace(e);
      }
      throw e;
    }
  }
  
  public URL getResource(String name)
  {
    if (Debug.DEBUG_LOADER) {
      Debug.println("BundleClassLoader[" + delegate + "].getResource(" + name + ")");
    }
    URL url = delegate.findResource(name);
    if (url != null) {
      return url;
    }
    if (Debug.DEBUG_LOADER) {
      Debug.println("BundleClassLoader[" + delegate + "].getResource(" + name + ") failed.");
    }
    return null;
  }
  
  protected Enumeration<URL> findResources(String name)
    throws IOException
  {
    Enumeration<URL> result = delegate.findResources(name);
    if (result == null) {
      return EMPTY_ENUMERATION;
    }
    return result;
  }
  
  protected String findLibrary(String libname)
  {
    return manager.findLibrary(libname);
  }
  
  public ProtectionDomain getDomain()
  {
    return domain;
  }
  
  public ClasspathEntry createClassPathEntry(BundleFile bundlefile, ProtectionDomain cpDomain)
  {
    return new ClasspathEntry(bundlefile, createProtectionDomain(bundlefile, cpDomain));
  }
  
  public Class<?> defineClass(String name, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry)
  {
    return defineClass(name, classbytes, 0, classbytes.length, classpathEntry.getDomain());
  }
  
  public Class<?> publicFindLoaded(String classname)
  {
    return findLoadedClass(classname);
  }
  
  public Object publicGetPackage(String pkgname)
  {
    return getPackage(pkgname);
  }
  
  public Object publicDefinePackage(String name, String specTitle, String specVersion, String specVendor, String implTitle, String implVersion, String implVendor, URL sealBase)
  {
    return definePackage(name, specTitle, specVersion, specVendor, implTitle, implVersion, implVendor, sealBase);
  }
  
  public void initialize()
  {
    manager.initialize();
  }
  
  public URL findLocalResource(String resource)
  {
    return manager.findLocalResource(resource);
  }
  
  public Enumeration<URL> findLocalResources(String resource)
  {
    return manager.findLocalResources(resource);
  }
  
  public Class<?> findLocalClass(String classname)
    throws ClassNotFoundException
  {
    return manager.findLocalClass(classname);
  }
  
  public void close()
  {
    manager.close();
  }
  
  public void attachFragment(BundleData sourcedata, ProtectionDomain sourcedomain, String[] sourceclasspath)
  {
    manager.attachFragment(sourcedata, sourcedomain, sourceclasspath);
  }
  
  public ClassLoaderDelegate getDelegate()
  {
    return delegate;
  }
  
  public static ProtectionDomain createProtectionDomain(BundleFile bundlefile, ProtectionDomain baseDomain)
  {
    try
    {
      PermissionCollection permissions;
      PermissionCollection permissions;
      if (baseDomain != null) {
        permissions = baseDomain.getPermissions();
      } else {
        permissions = ALLPERMISSIONS;
      }
      Certificate[] certs = (Certificate[])null;
      SignedContent signedContent = null;
      if ((bundlefile instanceof BundleFileWrapperChain))
      {
        BundleFileWrapperChain wrapper = (BundleFileWrapperChain)bundlefile;
        while ((wrapper != null) && (!(wrapper.getWrapped() instanceof SignedContent))) {
          wrapper = wrapper.getNext();
        }
        signedContent = wrapper == null ? null : (SignedContent)wrapper.getWrapped();
      }
      if ((CLASS_CERTIFICATE) && (signedContent != null) && (signedContent.isSigned()))
      {
        SignerInfo[] signers = signedContent.getSignerInfos();
        if (signers.length > 0) {
          certs = signers[0].getCertificateChain();
        }
      }
      return new BundleProtectionDomain(permissions, new CodeSource(bundlefile.getBaseFile().toURL(), certs), null);
    }
    catch (MalformedURLException localMalformedURLException) {}
    return baseDomain;
  }
  
  public ClasspathManager getClasspathManager()
  {
    return manager;
  }
  
  public Bundle getBundle()
  {
    return manager.getBaseData().getBundle();
  }
  
  public boolean isParallelCapable()
  {
    return PARALLEL_CAPABLE;
  }
  
  public List<URL> findEntries(String path, String filePattern, int options)
  {
    return manager.findEntries(path, filePattern, options);
  }
  
  public Collection<String> listResources(String path, String filePattern, int options)
  {
    return delegate.listResources(path, filePattern, options);
  }
  
  public Collection<String> listLocalResources(String path, String filePattern, int options)
  {
    return manager.listLocalResources(path, filePattern, options);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.baseadaptor;

import java.io.File;
import java.security.ProtectionDomain;
import java.util.ArrayList;
import org.eclipse.osgi.baseadaptor.BaseData;
import org.eclipse.osgi.baseadaptor.HookConfigurator;
import org.eclipse.osgi.baseadaptor.HookRegistry;
import org.eclipse.osgi.baseadaptor.bundlefile.BundleEntry;
import org.eclipse.osgi.baseadaptor.bundlefile.BundleFile;
import org.eclipse.osgi.baseadaptor.hooks.ClassLoadingHook;
import org.eclipse.osgi.baseadaptor.loader.BaseClassLoader;
import org.eclipse.osgi.baseadaptor.loader.ClasspathEntry;
import org.eclipse.osgi.baseadaptor.loader.ClasspathManager;
import org.eclipse.osgi.baseadaptor.loader.FragmentClasspath;
import org.eclipse.osgi.framework.adaptor.BundleProtectionDomain;
import org.eclipse.osgi.framework.adaptor.ClassLoaderDelegate;
import org.eclipse.osgi.framework.util.KeyedElement;

public class DevClassLoadingHook
  implements ClassLoadingHook, HookConfigurator, KeyedElement
{
  public static final String KEY = DevClassLoadingHook.class.getName();
  public static final int HASHCODE = KEY.hashCode();
  private static final String FRAGMENT = "@fragment@";
  
  public byte[] processClass(String name, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager)
  {
    return null;
  }
  
  public boolean addClassPathEntry(ArrayList<ClasspathEntry> cpEntries, String cp, ClasspathManager hostmanager, BaseData sourcedata, ProtectionDomain sourcedomain)
  {
    String[] devClassPath = !DevClassPathHelper.inDevelopmentMode() ? null : DevClassPathHelper.getDevClassPath(sourcedata.getSymbolicName());
    if ((devClassPath == null) || (devClassPath.length == 0)) {
      return false;
    }
    if ((cpEntries.size() > 0) && (((ClasspathEntry)cpEntries.get(0)).getUserObject(KEY) != null)) {
      return false;
    }
    boolean result = false;
    for (int i = 0; i < devClassPath.length; i++) {
      if (ClasspathManager.addClassPathEntry(cpEntries, devClassPath[i], hostmanager, sourcedata, sourcedomain))
      {
        result = true;
      }
      else
      {
        String devCP = devClassPath[i];
        boolean fromFragment = devCP.endsWith("@fragment@");
        if ((!fromFragment) && (devCP.indexOf("..") >= 0))
        {
          File base = sourcedata.getBundleFile().getBaseFile();
          if (base.isDirectory())
          {
            ClasspathEntry entry = hostmanager.getExternalClassPath(new File(base, devCP).getAbsolutePath(), sourcedata, sourcedomain);
            if (entry != null)
            {
              cpEntries.add(entry);
              result = true;
            }
          }
        }
        else
        {
          if (fromFragment) {
            devCP = devCP.substring(0, devCP.length() - "@fragment@".length());
          }
          BaseData fragData = findFragmentSource(sourcedata, devCP, hostmanager, fromFragment);
          if (fragData != null)
          {
            ClasspathEntry entry = hostmanager.getExternalClassPath(devCP, fragData, sourcedomain);
            if (entry != null)
            {
              cpEntries.add(entry);
              result = true;
            }
          }
        }
      }
    }
    if ((result) && (cpEntries.size() > 0)) {
      ((ClasspathEntry)cpEntries.get(0)).addUserObject(this);
    }
    return result;
  }
  
  private BaseData findFragmentSource(BaseData hostData, String cp, ClasspathManager manager, boolean fromFragment)
  {
    if (hostData != manager.getBaseData()) {
      return hostData;
    }
    File file = new File(cp);
    if (!file.isAbsolute()) {
      return hostData;
    }
    FragmentClasspath[] fragCP = manager.getFragmentClasspaths();
    for (int i = 0; i < fragCP.length; i++)
    {
      BundleFile fragBase = fragCP[i].getBundleData().getBundleFile();
      File fragFile = fragBase.getBaseFile();
      if ((fragFile != null) && (file.getPath().startsWith(fragFile.getPath()))) {
        return fragCP[i].getBundleData();
      }
    }
    return fromFragment ? null : hostData;
  }
  
  public String findLibrary(BaseData data, String libName)
  {
    return null;
  }
  
  public ClassLoader getBundleClassLoaderParent()
  {
    return null;
  }
  
  public BaseClassLoader createClassLoader(ClassLoader parent, ClassLoaderDelegate delegate, BundleProtectionDomain domain, BaseData data, String[] bundleclasspath)
  {
    return null;
  }
  
  public void initializedClassLoader(BaseClassLoader baseClassLoader, BaseData data) {}
  
  public void addHooks(HookRegistry hookRegistry)
  {
    if (DevClassPathHelper.inDevelopmentMode()) {
      hookRegistry.addClassLoadingHook(new DevClassLoadingHook());
    }
  }
  
  public boolean compare(KeyedElement other)
  {
    return other.getKey() == KEY;
  }
  
  public Object getKey()
  {
    return KEY;
  }
  
  public int getKeyHashCode()
  {
    return HASHCODE;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.baseadaptor.DevClassLoadingHook
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.baseadaptor;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Dictionary;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
import org.eclipse.osgi.util.ManifestElement;

public final class DevClassPathHelper
{
  private static final String FILE_PROTOCOL = "file";
  private static final boolean inDevelopmentMode;
  private static final File devLocation;
  private static String[] devDefaultClasspath;
  private static Dictionary<String, String> devProperties = null;
  private static long lastModified = 0L;
  
  static
  {
    String osgiDev = FrameworkProperties.getProperty("osgi.dev");
    File f = null;
    boolean devMode = false;
    if (osgiDev != null) {
      try
      {
        devMode = true;
        URL location = new URL(osgiDev);
        if ("file".equals(location.getProtocol()))
        {
          f = new File(location.getFile());
          lastModified = f.lastModified();
        }
        try
        {
          load(location.openStream());
          devMode = true;
        }
        catch (IOException localIOException) {}
        inDevelopmentMode = devMode;
      }
      catch (MalformedURLException localMalformedURLException)
      {
        devDefaultClasspath = getArrayFromList(osgiDev);
      }
    }
    devLocation = f;
  }
  
  private static void updateDevProperties()
  {
    if (devLocation == null) {
      return;
    }
    if (devLocation.lastModified() == lastModified) {
      return;
    }
    try
    {
      load(new FileInputStream(devLocation));
    }
    catch (FileNotFoundException localFileNotFoundException)
    {
      return;
    }
    lastModified = devLocation.lastModified();
  }
  
  private static String[] getDevClassPath(String id, Dictionary<String, String> properties, String[] defaultClasspath)
  {
    String[] result = (String[])null;
    if ((id != null) && (properties != null))
    {
      String entry = (String)properties.get(id);
      if (entry != null) {
        result = getArrayFromList(entry);
      }
    }
    if (result == null) {
      result = defaultClasspath;
    }
    return result;
  }
  
  public static String[] getDevClassPath(String id, Dictionary<String, String> properties)
  {
    if (properties == null) {
      synchronized (DevClassPathHelper.class)
      {
        updateDevProperties();
        return getDevClassPath(id, devProperties, devDefaultClasspath);
      }
    }
    return getDevClassPath(id, properties, getArrayFromList((String)properties.get("*")));
  }
  
  public static String[] getDevClassPath(String id)
  {
    return getDevClassPath(id, null);
  }
  
  public static String[] getArrayFromList(String prop)
  {
    return ManifestElement.getArrayFromList(prop, ",");
  }
  
  public static boolean inDevelopmentMode()
  {
    return inDevelopmentMode;
  }
  
  /* Error */
  private static void load(java.io.InputStream input)
  {
    // Byte code:
    //   0: new 86	java/util/Properties
    //   3: dup
    //   4: invokespecial 159	java/util/Properties:<init>	()V
    //   7: astore_1
    //   8: aload_1
    //   9: aload_0
    //   10: invokevirtual 160	java/util/Properties:load	(Ljava/io/InputStream;)V
    //   13: goto +34 -> 47
    //   16: pop
    //   17: aload_0
    //   18: ifnull +41 -> 59
    //   21: aload_0
    //   22: invokevirtual 148	java/io/InputStream:close	()V
    //   25: goto +34 -> 59
    //   28: pop
    //   29: goto +30 -> 59
    //   32: astore_2
    //   33: aload_0
    //   34: ifnull +11 -> 45
    //   37: aload_0
    //   38: invokevirtual 148	java/io/InputStream:close	()V
    //   41: goto +4 -> 45
    //   44: pop
    //   45: aload_2
    //   46: athrow
    //   47: aload_0
    //   48: ifnull +11 -> 59
    //   51: aload_0
    //   52: invokevirtual 148	java/io/InputStream:close	()V
    //   55: goto +4 -> 59
    //   58: pop
    //   59: aload_1
    //   60: astore_2
    //   61: aload_2
    //   62: putstatic 144	org/eclipse/osgi/internal/baseadaptor/DevClassPathHelper:devProperties	Ljava/util/Dictionary;
    //   65: getstatic 144	org/eclipse/osgi/internal/baseadaptor/DevClassPathHelper:devProperties	Ljava/util/Dictionary;
    //   68: ifnull +20 -> 88
    //   71: getstatic 144	org/eclipse/osgi/internal/baseadaptor/DevClassPathHelper:devProperties	Ljava/util/Dictionary;
    //   74: ldc 1
    //   76: invokevirtual 158	java/util/Dictionary:get	(Ljava/lang/Object;)Ljava/lang/Object;
    //   79: checkcast 81	java/lang/String
    //   82: invokestatic 164	org/eclipse/osgi/internal/baseadaptor/DevClassPathHelper:getArrayFromList	(Ljava/lang/String;)[Ljava/lang/String;
    //   85: putstatic 143	org/eclipse/osgi/internal/baseadaptor/DevClassPathHelper:devDefaultClasspath	[Ljava/lang/String;
    //   88: return
    // Line number table:
    //   Java source line #141	-> byte code offset #0
    //   Java source line #143	-> byte code offset #8
    //   Java source line #144	-> byte code offset #16
    //   Java source line #147	-> byte code offset #17
    //   Java source line #149	-> byte code offset #21
    //   Java source line #150	-> byte code offset #28
    //   Java source line #146	-> byte code offset #32
    //   Java source line #147	-> byte code offset #33
    //   Java source line #149	-> byte code offset #37
    //   Java source line #150	-> byte code offset #44
    //   Java source line #153	-> byte code offset #45
    //   Java source line #147	-> byte code offset #47
    //   Java source line #149	-> byte code offset #51
    //   Java source line #150	-> byte code offset #58
    //   Java source line #155	-> byte code offset #59
    //   Java source line #156	-> byte code offset #61
    //   Java source line #157	-> byte code offset #65
    //   Java source line #158	-> byte code offset #71
    //   Java source line #159	-> byte code offset #88
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	89	0	input	java.io.InputStream
    //   7	53	1	props	java.util.Properties
    //   32	14	2	localObject1	Object
    //   60	2	2	result	Object
    //   16	1	4	localIOException1	IOException
    //   28	1	5	localIOException2	IOException
    //   44	1	6	localIOException3	IOException
    //   58	1	7	localIOException4	IOException
    // Exception table:
    //   from	to	target	type
    //   8	13	16	java/io/IOException
    //   21	25	28	java/io/IOException
    //   8	17	32	finally
    //   37	41	44	java/io/IOException
    //   51	55	58	java/io/IOException
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.baseadaptor.DevClassPathHelper
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.baseadaptor;

import org.osgi.framework.Version;

public class InvalidVersion
  extends Version
{
  private String invalidVersion;
  
  public InvalidVersion(String badVersion)
  {
    super(0, 0, 0, null);
    invalidVersion = badVersion;
  }
  
  public String getInvalidVersion()
  {
    return invalidVersion;
  }
  
  public String toString()
  {
    return invalidVersion;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.internal.baseadaptor.InvalidVersion
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.internal.baseadaptor;

import java.io.File;
import java.io.IOException;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
import org.eclipse.osgi.internal.module.ResolverImpl;
import org.eclipse.osgi.internal.resolver.ReadOnlyState;
import org.eclipse.osgi.internal.resolver.StateHelperImpl;
import org.eclipse.osgi.internal.resolver.StateImpl;
import org.eclipse.osgi.internal.resolver.StateObjectFactoryImpl;
import org.eclipse.osgi.service.resolver.DisabledInfo;
import org.eclipse.osgi.service.resolver.PlatformAdmin;
import org.eclipse.osgi.service.resolver.Resolver;
import org.eclipse.osgi.service.resolver.State;
import org.eclipse.osgi.service.resolver.StateHelper;
import org.eclipse.osgi.service.resolver.StateObjectFactory;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;

public class StateManager
  implements PlatformAdmin, Runnable
{
  public static boolean DEBUG = false;
  public static boolean DEBUG_READER = false;
  public static boolean DEBUG_PLATFORM_ADMIN = false;
  public static boolean DEBUG_PLATFORM_ADMIN_RESOLVER = false;
  public static boolean MONITOR_PLATFORM_ADMIN = false;
  public static String PROP_NO_LAZY_LOADING = "osgi.noLazyStateLoading";
  public static String PROP_LAZY_UNLOADING_TIME = "osgi.lazyStateUnloadingTime";
  private long expireTime = 300000L;
  private long readStartupTime;
  private StateImpl systemState;
  private StateObjectFactoryImpl factory;
  private long lastTimeStamp;
  private boolean cachedState = false;
  private File stateFile;
  private File lazyFile;
  private long expectedTimeStamp;
  private BundleContext context;
  private Thread dataManagerThread;
  
  public StateManager(File stateFile, File lazyFile, BundleContext context)
  {
    this(stateFile, lazyFile, context, -1L);
  }
  
  public StateManager(File stateFile, File lazyFile, BundleContext context, long expectedTimeStamp)
  {
    this.stateFile = stateFile;
    this.lazyFile = lazyFile;
    this.context = context;
    this.expectedTimeStamp = expectedTimeStamp;
    factory = new StateObjectFactoryImpl();
  }
  
  public void shutdown(File saveStateFile, File saveLazyFile)
    throws IOException
  {
    writeState(systemState, saveStateFile, saveLazyFile);
    stopDataManager();
  }
  
  public void update(File updateStateFile, File updateLazyFile)
    throws IOException
  {
    writeState(systemState, updateStateFile, updateLazyFile);
    
    lastTimeStamp = systemState.getTimeStamp();
  }
  
  /* Error */
  private void internalReadSystemState()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 263	org/eclipse/osgi/internal/baseadaptor/StateManager:stateFile	Ljava/io/File;
    //   4: ifnull +13 -> 17
    //   7: aload_0
    //   8: getfield 263	org/eclipse/osgi/internal/baseadaptor/StateManager:stateFile	Ljava/io/File;
    //   11: invokevirtual 270	java/io/File:isFile	()Z
    //   14: ifne +4 -> 18
    //   17: return
    //   18: getstatic 259	org/eclipse/osgi/internal/baseadaptor/StateManager:DEBUG_READER	Z
    //   21: ifeq +10 -> 31
    //   24: aload_0
    //   25: invokestatic 283	java/lang/System:currentTimeMillis	()J
    //   28: putfield 255	org/eclipse/osgi/internal/baseadaptor/StateManager:readStartupTime	J
    //   31: getstatic 265	org/eclipse/osgi/internal/baseadaptor/StateManager:PROP_NO_LAZY_LOADING	Ljava/lang/String;
    //   34: invokestatic 291	org/eclipse/osgi/framework/internal/core/FrameworkProperties:getProperty	(Ljava/lang/String;)Ljava/lang/String;
    //   37: invokestatic 274	java/lang/Boolean:valueOf	(Ljava/lang/String;)Ljava/lang/Boolean;
    //   40: invokevirtual 273	java/lang/Boolean:booleanValue	()Z
    //   43: ifeq +7 -> 50
    //   46: iconst_0
    //   47: goto +4 -> 51
    //   50: iconst_1
    //   51: istore_1
    //   52: aload_0
    //   53: aload_0
    //   54: getfield 268	org/eclipse/osgi/internal/baseadaptor/StateManager:factory	Lorg/eclipse/osgi/internal/resolver/StateObjectFactoryImpl;
    //   57: aload_0
    //   58: getfield 269	org/eclipse/osgi/internal/baseadaptor/StateManager:context	Lorg/osgi/framework/BundleContext;
    //   61: aload_0
    //   62: getfield 263	org/eclipse/osgi/internal/baseadaptor/StateManager:stateFile	Ljava/io/File;
    //   65: aload_0
    //   66: getfield 262	org/eclipse/osgi/internal/baseadaptor/StateManager:lazyFile	Ljava/io/File;
    //   69: iload_1
    //   70: aload_0
    //   71: getfield 252	org/eclipse/osgi/internal/baseadaptor/StateManager:expectedTimeStamp	J
    //   74: invokevirtual 317	org/eclipse/osgi/internal/resolver/StateObjectFactoryImpl:readSystemState	(Lorg/osgi/framework/BundleContext;Ljava/io/File;Ljava/io/File;ZJ)Lorg/eclipse/osgi/internal/resolver/SystemState;
    //   77: putfield 267	org/eclipse/osgi/internal/baseadaptor/StateManager:systemState	Lorg/eclipse/osgi/internal/resolver/StateImpl;
    //   80: aload_0
    //   81: getfield 267	org/eclipse/osgi/internal/baseadaptor/StateManager:systemState	Lorg/eclipse/osgi/internal/resolver/StateImpl;
    //   84: ifnull +10 -> 94
    //   87: aload_0
    //   88: invokespecial 296	org/eclipse/osgi/internal/baseadaptor/StateManager:initializeSystemState	()Z
    //   91: ifne +44 -> 135
    //   94: aload_0
    //   95: aconst_null
    //   96: putfield 267	org/eclipse/osgi/internal/baseadaptor/StateManager:systemState	Lorg/eclipse/osgi/internal/resolver/StateImpl;
    //   99: getstatic 259	org/eclipse/osgi/internal/baseadaptor/StateManager:DEBUG_READER	Z
    //   102: ifeq +32 -> 134
    //   105: getstatic 251	java/lang/System:out	Ljava/io/PrintStream;
    //   108: new 135	java/lang/StringBuffer
    //   111: dup
    //   112: ldc 2
    //   114: invokespecial 281	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   117: invokestatic 283	java/lang/System:currentTimeMillis	()J
    //   120: aload_0
    //   121: getfield 255	org/eclipse/osgi/internal/baseadaptor/StateManager:readStartupTime	J
    //   124: lsub
    //   125: invokevirtual 282	java/lang/StringBuffer:append	(J)Ljava/lang/StringBuffer;
    //   128: invokevirtual 280	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   131: invokevirtual 272	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   134: return
    //   135: aload_0
    //   136: iconst_1
    //   137: putfield 261	org/eclipse/osgi/internal/baseadaptor/StateManager:cachedState	Z
    //   140: aload_0
    //   141: getstatic 264	org/eclipse/osgi/internal/baseadaptor/StateManager:PROP_LAZY_UNLOADING_TIME	Ljava/lang/String;
    //   144: aload_0
    //   145: getfield 253	org/eclipse/osgi/internal/baseadaptor/StateManager:expireTime	J
    //   148: invokestatic 277	java/lang/Long:toString	(J)Ljava/lang/String;
    //   151: invokestatic 292	org/eclipse/osgi/framework/internal/core/FrameworkProperties:getProperty	(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    //   154: invokestatic 278	java/lang/Long:parseLong	(Ljava/lang/String;)J
    //   157: putfield 253	org/eclipse/osgi/internal/baseadaptor/StateManager:expireTime	J
    //   160: goto +9 -> 169
    //   163: pop
    //   164: aload_0
    //   165: lconst_0
    //   166: putfield 253	org/eclipse/osgi/internal/baseadaptor/StateManager:expireTime	J
    //   169: iload_1
    //   170: ifeq +100 -> 270
    //   173: aload_0
    //   174: getfield 253	org/eclipse/osgi/internal/baseadaptor/StateManager:expireTime	J
    //   177: lconst_0
    //   178: lcmp
    //   179: ifle +91 -> 270
    //   182: aload_0
    //   183: invokespecial 294	org/eclipse/osgi/internal/baseadaptor/StateManager:startDataManager	()V
    //   186: goto +84 -> 270
    //   189: astore_1
    //   190: aload_1
    //   191: invokevirtual 271	java/io/IOException:printStackTrace	()V
    //   194: getstatic 259	org/eclipse/osgi/internal/baseadaptor/StateManager:DEBUG_READER	Z
    //   197: ifeq +108 -> 305
    //   200: getstatic 251	java/lang/System:out	Ljava/io/PrintStream;
    //   203: new 135	java/lang/StringBuffer
    //   206: dup
    //   207: ldc 2
    //   209: invokespecial 281	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   212: invokestatic 283	java/lang/System:currentTimeMillis	()J
    //   215: aload_0
    //   216: getfield 255	org/eclipse/osgi/internal/baseadaptor/StateManager:readStartupTime	J
    //   219: lsub
    //   220: invokevirtual 282	java/lang/StringBuffer:append	(J)Ljava/lang/StringBuffer;
    //   223: invokevirtual 280	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   226: invokevirtual 272	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   229: goto +76 -> 305
    //   232: astore_2
    //   233: getstatic 259	org/eclipse/osgi/internal/baseadaptor/StateManager:DEBUG_READER	Z
    //   236: ifeq +32 -> 268
    //   239: getstatic 251	java/lang/System:out	Ljava/io/PrintStream;
    //   242: new 135	java/lang/StringBuffer
    //   245: dup
    //   246: ldc 2
    //   248: invokespecial 281	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   251: invokestatic 283	java/lang/System:currentTimeMillis	()J
    //   254: aload_0
    //   255: getfield 255	org/eclipse/osgi/internal/baseadaptor/StateManager:readStartupTime	J
    //   258: lsub
    //   259: invokevirtual 282	java/lang/StringBuffer:append	(J)Ljava/lang/StringBuffer;
    //   262: invokevirtual 280	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   265: invokevirtual 272	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   268: aload_2
    //   269: athrow
    //   270: getstatic 259	org/eclipse/osgi/internal/baseadaptor/StateManager:DEBUG_READER	Z
    //   273: ifeq +32 -> 305
    //   276: getstatic 251	java/lang/System:out	Ljava/io/PrintStream;
    //   279: new 135	java/lang/StringBuffer
    //   282: dup
    //   283: ldc 2
    //   285: invokespecial 281	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   288: invokestatic 283	java/lang/System:currentTimeMillis	()J
    //   291: aload_0
    //   292: getfield 255	org/eclipse/osgi/internal/baseadaptor/StateManager:readStartupTime	J
    //   295: lsub
    //   296: invokevirtual 282	java/lang/StringBuffer:append	(J)Ljava/lang/StringBuffer;
    //   299: invokevirtual 280	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   302: invokevirtual 272	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   305: return
    // Line number table:
    //   Java source line #123	-> byte code offset #0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84

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-2019. Infinite Loop Ltd