org.eclipse.osgi_3.7.2.v20120110-1415

 line #337	-> byte code offset #5
      //   Java source line #338	-> byte code offset #9
      //   Java source line #340	-> byte code offset #10
      //   Java source line #344	-> byte code offset #29
      //   Java source line #335	-> byte code offset #31
      //   Java source line #346	-> byte code offset #34
      //   Java source line #350	-> byte code offset #35
      //   Java source line #351	-> byte code offset #37
      //   Java source line #355	-> byte code offset #38
      // Local variable table:
      //   start	length	slot	name	signature
      //   0	40	0	this	EventThread<K, V, E>
      //   4	27	1	item	Queued<K, V, E>
      //   34	2	1	e	RuntimeException
      //   37	2	1	e	Error
      // Exception table:
      //   from	to	target	type
      //   0	9	34	java/lang/RuntimeException
      //   10	34	34	java/lang/RuntimeException
      //   0	9	37	java/lang/Error
      //   10	34	37	java/lang/Error
    }
    
    synchronized void postEvent(Set<Map.Entry<K, V>> l, EventDispatcher<K, V, E> d, int a, E o)
    {
      if (!isAlive()) {
        throw new IllegalStateException();
      }
      Queued<K, V, E> item = new Queued(l, d, a, o);
      if (head == null)
      {
        head = item;
        tail = item;
      }
      else
      {
        tail.next = item;
        tail = item;
      }
      notify();
    }
    
    private synchronized Queued<K, V, E> getNextEvent()
    {
      while ((running) && (head == null)) {
        try
        {
          wait();
        }
        catch (InterruptedException localInterruptedException) {}
      }
      if (!running) {
        return null;
      }
      Queued<K, V, E> item = head;
      head = next;
      if (head == null) {
        tail = null;
      }
      return item;
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.osgi.framework.eventmgr.EventManager
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.osgi.framework.eventmgr;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class ListenerQueue<K, V, E>
{
  protected final EventManager manager;
  private final Map<Set<Map.Entry<K, V>>, EventDispatcher<K, V, E>> queue;
  private boolean readOnly;
  
  public ListenerQueue(EventManager manager)
  {
    if (manager == null) {
      throw new IllegalArgumentException();
    }
    this.manager = manager;
    queue = new CopyOnWriteIdentityMap();
    readOnly = false;
  }
  
  /**
   * @deprecated
   */
  public void queueListeners(EventListeners<K, V> listeners, EventDispatcher<K, V, E> dispatcher)
  {
    queueListeners(listeners.entrySet(), dispatcher);
  }
  
  public synchronized void queueListeners(Set<Map.Entry<K, V>> listeners, EventDispatcher<K, V, E> dispatcher)
  {
    if (readOnly) {
      throw new IllegalStateException();
    }
    if (!listeners.isEmpty()) {
      queue.put(listeners, dispatcher);
    }
  }
  
  public void dispatchEventAsynchronous(int eventAction, E eventObject)
  {
    synchronized (this)
    {
      readOnly = true;
    }
    EventManager.EventThread<K, V, E> eventThread = manager.getEventThread();
    synchronized (eventThread)
    {
      for (Iterator localIterator = queue.entrySet().iterator(); localIterator.hasNext();)
      {
        Map.Entry<Set<Map.Entry<K, V>>, EventDispatcher<K, V, E>> entry = (Map.Entry)localIterator.next();
        eventThread.postEvent((Set)entry.getKey(), (EventDispatcher)entry.getValue(), eventAction, eventObject);
      }
    }
  }
  
  public void dispatchEventSynchronous(int eventAction, E eventObject)
  {
    synchronized (this)
    {
      readOnly = true;
    }
    for (Iterator localIterator = queue.entrySet().iterator(); localIterator.hasNext();)
    {
      Map.Entry<Set<Map.Entry<K, V>>, EventDispatcher<K, V, E>> entry = (Map.Entry)localIterator.next();
      EventManager.dispatchEvent((Set)entry.getKey(), (EventDispatcher)entry.getValue(), eventAction, eventObject);
    }
  }
}

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

import java.io.IOException;
import java.security.PrivilegedExceptionAction;
import org.eclipse.osgi.framework.adaptor.BundleData;

class AbstractBundle$1
  implements PrivilegedExceptionAction<Object>
{
  final AbstractBundle this$0;
  
  AbstractBundle$1(AbstractBundle paramAbstractBundle, int paramInt, boolean paramBoolean) {}
  
  public Object run()
    throws IOException
  {
    int status = this$0.bundledata.getStatus();
    boolean test = (status & val$mask) != 0;
    if (test != val$state)
    {
      this$0.bundledata.setStatus(val$state ? status | val$mask : status & (val$mask ^ 0xFFFFFFFF));
      this$0.bundledata.save();
    }
    return null;
  }
}

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

import java.io.InputStream;
import java.net.URLConnection;
import java.security.AccessControlContext;
import java.security.PrivilegedExceptionAction;
import java.util.Dictionary;
import org.eclipse.osgi.framework.adaptor.BundleData;
import org.eclipse.osgi.framework.adaptor.FrameworkAdaptor;
import org.eclipse.osgi.framework.debug.Debug;
import org.osgi.framework.BundleException;

class AbstractBundle$2
  implements PrivilegedExceptionAction<Object>
{
  final AbstractBundle this$0;
  
  AbstractBundle$2(AbstractBundle paramAbstractBundle, InputStream paramInputStream, AccessControlContext paramAccessControlContext) {}
  
  public Object run()
    throws BundleException
  {
    URLConnection source = null;
    if (val$in == null)
    {
      String updateLocation = (String)this$0.bundledata.getManifest().get("Bundle-UpdateLocation");
      if (updateLocation == null) {
        updateLocation = this$0.bundledata.getLocation();
      }
      if (Debug.DEBUG_GENERAL) {
        Debug.println("   from location: " + updateLocation);
      }
      source = this$0.framework.adaptor.mapLocationToURLConnection(updateLocation);
    }
    else
    {
      source = new BundleSource(val$in);
    }
    this$0.updateWorkerPrivileged(source, val$callerContext);
    return null;
  }
}

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

import java.security.PrivilegedExceptionAction;

class AbstractBundle$3
  implements PrivilegedExceptionAction<Object>
{
  final AbstractBundle this$0;
  
  AbstractBundle$3(AbstractBundle paramAbstractBundle1, AbstractBundle paramAbstractBundle2, boolean paramBoolean) {}
  
  public Object run()
    throws Exception
  {
    this$0.framework.checkAdminPermission(val$newBundle, "lifecycle");
    if (val$extension) {
      this$0.framework.checkAdminPermission(val$newBundle, "extensionLifecycle");
    }
    return null;
  }
}

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

import java.security.PrivilegedExceptionAction;
import org.osgi.framework.BundleException;

class AbstractBundle$4
  implements PrivilegedExceptionAction<Object>
{
  final AbstractBundle this$0;
  
  AbstractBundle$4(AbstractBundle paramAbstractBundle) {}
  
  public Object run()
    throws BundleException
  {
    this$0.uninstallWorkerPrivileged();
    return null;
  }
}

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

import java.security.PrivilegedAction;
import java.util.Enumeration;
import org.eclipse.osgi.framework.adaptor.BundleData;

class AbstractBundle$5
  implements PrivilegedAction<Enumeration<String>>
{
  final AbstractBundle this$0;
  
  AbstractBundle$5(AbstractBundle paramAbstractBundle, String paramString) {}
  
  public Enumeration<String> run()
  {
    return this$0.bundledata.getEntryPaths(val$path);
  }
}

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

import org.eclipse.osgi.framework.adaptor.StatusException;

class AbstractBundle$BundleStatusException
  extends Throwable
  implements StatusException
{
  private static final long serialVersionUID = 7201911791818929100L;
  private int code;
  private Object status;
  final AbstractBundle this$0;
  
  AbstractBundle$BundleStatusException(AbstractBundle paramAbstractBundle, String message, int code, Object status)
  {
    super(message);
    this.code = code;
    this.status = status;
  }
  
  public Object getStatus()
  {
    return status;
  }
  
  public int getStatusCode()
  {
    return code;
  }
}

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

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.net.URL;
import java.net.URLConnection;
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.AllPermission;
import java.security.Permission;
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
import java.security.ProtectionDomain;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import org.eclipse.osgi.framework.adaptor.BundleData;
import org.eclipse.osgi.framework.adaptor.BundleOperation;
import org.eclipse.osgi.framework.adaptor.BundleProtectionDomain;
import org.eclipse.osgi.framework.adaptor.FrameworkAdaptor;
import org.eclipse.osgi.framework.adaptor.StatusException;
import org.eclipse.osgi.framework.debug.Debug;
import org.eclipse.osgi.framework.util.KeyedElement;
import org.eclipse.osgi.internal.composite.CompositeImpl;
import org.eclipse.osgi.internal.composite.SurrogateImpl;
import org.eclipse.osgi.internal.loader.BundleLoader;
import org.eclipse.osgi.internal.permadmin.EquinoxSecurityManager;
import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.service.resolver.ResolverError;
import org.eclipse.osgi.service.resolver.State;
import org.eclipse.osgi.signedcontent.SignedContent;
import org.eclipse.osgi.signedcontent.SignedContentFactory;
import org.eclipse.osgi.signedcontent.SignerInfo;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.AdaptPermission;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.framework.BundleReference;
import org.osgi.framework.Version;
import org.osgi.framework.startlevel.BundleStartLevel;
import org.osgi.framework.wiring.BundleRevision;
import org.osgi.framework.wiring.BundleRevisions;
import org.osgi.framework.wiring.BundleWiring;

public abstract class AbstractBundle
  implements Bundle, Comparable<Bundle>, KeyedElement, BundleStartLevel, BundleReference, BundleRevisions
{
  private static final long STATE_CHANGE_TIMEOUT;
  protected final Framework framework;
  protected volatile int state;
  protected volatile Thread stateChanging;
  protected BundleData bundledata;
  
  static
  {
    long stateChangeWait = 5000L;
    try
    {
      String prop = FrameworkProperties.getProperty("equinox.statechange.timeout");
      if (prop != null) {
        stateChangeWait = Long.parseLong(prop);
      }
    }
    catch (Throwable localThrowable)
    {
      stateChangeWait = 5000L;
    }
    STATE_CHANGE_TIMEOUT = stateChangeWait;
  }
  
  protected final Object statechangeLock = new Object();
  protected BundleProtectionDomain domain;
  protected volatile ManifestLocalization manifestLocalization = null;
  
  protected static AbstractBundle createBundle(BundleData bundledata, Framework framework, boolean setBundle)
    throws BundleException
  {
    AbstractBundle result;
    AbstractBundle result;
    if ((bundledata.getType() & 0x1) > 0)
    {
      result = new BundleFragment(bundledata, framework);
    }
    else
    {
      AbstractBundle result;
      if ((bundledata.getType() & 0x20) > 0)
      {
        result = new CompositeImpl(bundledata, framework);
      }
      else
      {
        AbstractBundle result;
        if ((bundledata.getType() & 0x40) > 0) {
          result = new SurrogateImpl(bundledata, framework);
        } else {
          result = new BundleHost(bundledata, framework);
        }
      }
    }
    if (setBundle) {
      bundledata.setBundle(result);
    }
    return result;
  }
  
  protected AbstractBundle(BundleData bundledata, Framework framework)
  {
    state = 2;
    stateChanging = null;
    this.bundledata = bundledata;
    this.framework = framework;
  }
  
  protected abstract void load();
  
  protected abstract boolean reload(AbstractBundle paramAbstractBundle);
  
  protected abstract void refresh();
  
  protected abstract boolean unload();
  
  protected void close()
  {
    if ((Debug.DEBUG_GENERAL) && 
      ((state & 0x2) == 0))
    {
      Debug.println("Bundle.close called when state != INSTALLED: " + this);
      Debug.printStackTrace(new Exception("Stack trace"));
    }
    state = 1;
  }
  
  protected BundleActivator loadBundleActivator()
    throws BundleException
  {
    String activatorClassName = bundledata.getActivator();
    if (activatorClassName != null) {
      try
      {
        Class<?> activatorClass = loadClass(activatorClassName, false);
        
        return (BundleActivator)activatorClass.newInstance();
      }
      catch (Throwable t)
      {
        if (Debug.DEBUG_GENERAL) {
          Debug.printStackTrace(t);
        }
        throw new BundleException(NLS.bind(Msg.BUNDLE_INVALID_ACTIVATOR_EXCEPTION, activatorClassName, bundledata.getSymbolicName()), 5, t);
      }
    }
    return null;
  }
  
  protected abstract Class<?> loadClass(String paramString, boolean paramBoolean)
    throws ClassNotFoundException;
  
  public int getState()
  {
    return state;
  }
  
  public Framework getFramework()
  {
    return framework;
  }
  
  protected boolean isActive()
  {
    return (state & 0x28) != 0;
  }
  
  boolean isLazyStart()
  {
    int status = bundledata.getStatus();
    return ((status & 0x4) != 0) && ((status & 0x2) != 0);
  }
  
  public boolean isResolved()
  {
    return (state & 0x3) == 0;
  }
  
  public void start()
    throws BundleException
  {
    start(0);
  }
  
  /* Error */
  public void start(int options)
    throws BundleException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 773	org/eclipse/osgi/framework/internal/core/AbstractBundle:framework	Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   4: aload_0
    //   5: ldc 4
    //   7: invokevirtual 889	org/eclipse/osgi/framework/internal/core/Framework:checkAdminPermission	(Lorg/osgi/framework/Bundle;Ljava/lang/String;)V
    //   10: aload_0
    //   11: invokevirtual 839	org/eclipse/osgi/framework/internal/core/AbstractBundle:checkValid	()V
    //   14: aload_0
    //   15: invokevirtual 838	org/eclipse/osgi/framework/internal/core/AbstractBundle:beginStateChange	()V
    //   18: aload_0
    //   19: iload_1
    //   20: invokevirtual 848	org/eclipse/osgi/framework/internal/core/AbstractBundle:startWorker	(I)V
    //   23: goto +10 -> 33
    //   26: astore_2
    //   27: aload_0
    //   28: invokevirtual 841	org/eclipse/osgi/framework/internal/core/AbstractBundle:completeStateChange	()V
    //   31: aload_2
    //   32: athrow
    //   33: aload_0
    //   34: invokevirtual 841	org/eclipse/osgi/framework/internal/core/AbstractBundle:completeStateChange	()V
    //   37: return
    // Line number table:
    //   Java source line #295	-> byte code offset #0
    //   Java source line #296	-> byte code offset #10
    //   Java source line #297	-> byte code offset #14
    //   Java source line #299	-> byte code offset #18
    //   Java source line #300	-> byte code offset #26
    //   Java source line #301	-> byte code offset #27
    //   Java source line #302	-> byte code offset #31
    //   Java source line #301	-> byte code offset #33
    //   Java source line #303	-> byte code offset #37
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	38	0	this	AbstractBundle
    //   0	38	1	options	int
    //   26	6	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   18	26	26	finally
  }
  
  protected abstract void startWorker(int paramInt)
    throws BundleException;
  
  protected boolean readyToResume()
  {
    return false;
  }
  
  /* Error */
  protected void resume()
    throws BundleException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 764	org/eclipse/osgi/framework/internal/core/AbstractBundle:state	I
    //   4: iconst_1
    //   5: if_icmpne +4 -> 9
    //   8: return
    //   9: aload_0
    //   10: invokevirtual 838	org/eclipse/osgi/framework/internal/core/AbstractBundle:beginStateChange	()V
    //   13: aload_0
    //   14: invokevirtual 845	org/eclipse/osgi/framework/internal/core/AbstractBundle:readyToResume	()Z
    //   17: ifeq +18 -> 35
    //   20: aload_0
    //   21: iconst_1
    //   22: invokevirtual 848	org/eclipse/osgi/framework/internal/core/AbstractBundle:startWorker	(I)V
    //   25: goto +10 -> 35
    //   28: astore_1
    //   29: aload_0
    //   30: invokevirtual 841	org/eclipse/osgi/framework/internal/core/AbstractBundle:completeStateChange	()V
    //   33: aload_1
    //   34: athrow
    //   35: aload_0
    //   36: invokevirtual 841	org/eclipse/osgi/framework/internal/core/AbstractBundle:completeStateChange	()V
    //   39: return
    // Line number table:
    //   Java source line #383	-> byte code offset #0
    //   Java source line #384	-> byte code offset #8
    //   Java source line #386	-> byte code offset #9
    //   Java source line #388	-> byte code offset #13
    //   Java source line #389	-> byte code offset #20
    //   Java source line #390	-> byte code offset #28
    //   Java source line #391	-> byte code offset #29
    //   Java source line #392	-> byte code offset #33
    //   Java source line #391	-> byte code offset #35
    //   Java source line #393	-> byte code offset #39
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	40	0	this	AbstractBundle
    //   28	6	1	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   13	28	28	finally
  }
  
  public void stop()
    throws BundleException
  {
    stop(0);
  }
  
  /* Error */
  public void stop(int options)
    throws BundleException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 773	org/eclipse/osgi/framework/internal/core/AbstractBundle:framework	Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   4: aload_0
    //   5: ldc 4
    //   7: invokevirtual 889	org/eclipse/osgi/framework/internal/core/Framework:checkAdminPermission	(Lorg/osgi/framework/Bundle;Ljava/lang/String;)V
    //   10: aload_0
    //   11: invokevirtual 839	org/eclipse/osgi/framework/internal/core/AbstractBundle:checkValid	()V
    //   14: aload_0
    //   15: invokevirtual 838	org/eclipse/osgi/framework/internal/core/AbstractBundle:beginStateChange	()V
    //   18: aload_0
    //   19: iload_1
    //   20: invokevirtual 850	org/eclipse/osgi/framework/internal/core/AbstractBundle:stopWorker	(I)V
    //   23: goto +10 -> 33
    //   26: astore_2
    //   27: aload_0
    //   28: invokevirtual 841	org/eclipse/osgi/framework/internal/core/AbstractBundle:completeStateChange	()V
    //   31: aload_2
    //   32: athrow
    //   33: aload_0
    //   34: invokevirtual 841	org/eclipse/osgi/framework/internal/core/AbstractBundle:completeStateChange	()V
    //   37: return
    // Line number table:
    //   Java source line #460	-> byte code offset #0
    //   Java source line #461	-> byte code offset #10
    //   Java source line #462	-> byte code offset #14
    //   Java source line #464	-> byte code offset #18
    //   Java source line #465	-> byte code offset #26
    //   Java source line #466	-> byte code offset #27
    //   Java source line #467	-> byte code offset #31
    //   Java source line #466	-> byte code offset #33
    //   Java source line #468	-> byte code offset #37
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	38	0	this	AbstractBundle
    //   0	38	1	options	int
    //   26	6	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   18	26	26	finally
  }
  
  protected abstract void stopWorker(int paramInt)
    throws BundleException;
  
  protected void setStatus(final int mask, final boolean state)
  {
    try
    {
      AccessController.doPrivileged(new PrivilegedExceptionAction()
      {
        public Object run()
          throws IOException
        {
          int status = bundledata.getStatus();
          boolean test = (status & mask) != 0;
          if (test != state)
          {
            bundledata.setStatus(state ? status | mask : status & (mask ^ 0xFFFFFFFF));
            bundledata.save();
          }
          return null;
        }
      });
    }
    catch (PrivilegedActionException pae)
    {
      framework.publishFrameworkEvent(2, this, pae.getException());
    }
  }
  
  /* Error */
  protected void suspend(boolean lock)
    throws BundleException
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 764	org/eclipse/osgi/framework/internal/core/AbstractBundle:state	I
    //   4: iconst_1
    //   5: if_icmpne +4 -> 9
    //   8: return
    //   9: aload_0
    //   10: invokevirtual 838	org/eclipse/osgi/framework/internal/core/AbstractBundle:beginStateChange	()V
    //   13: aload_0
    //   14: iconst_1
    //   15: invokevirtual 850	org/eclipse/osgi/framework/internal/core/AbstractBundle:stopWorker	(I)V
    //   18: goto +14 -> 32
    //   21: astore_2
    //   22: iload_1
    //   23: ifne +7 -> 30
    //   26: aload_0
    //   27: invokevirtual 841	org/eclipse/osgi/framework/internal/core/AbstractBundle:completeStateChange	()V
    //   30: aload_2
    //   31: athrow
    //   32: iload_1
    //   33: ifne +7 -> 40
    //   36: aload_0
    //   37: invokevirtual 841	org/eclipse/osgi/framework/internal/core/AbstractBundle:completeStateChange	()V
    //   40: return
    // Line number table:
    //   Java source line #560	-> byte code offset #0
    //   Java source line #561	-> byte code offset #8
    //   Java source line #563	-> byte code offset #9
    //   Java source line #565	-> byte code offset #13
    //   Java source line #566	-> byte code offset #21
    //   Java source line #567	-> byte code offset #22
    //   Java source line #568	-> byte code offset #26
    //   Java source line #570	-> byte code offset #30
    //   Java source line #567	-> byte code offset #32
    //   Java source line #568	-> byte code offset #36
    //   Java source line #571	-> byte code offset #40
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	41	0	this	AbstractBundle
    //   0	41	1	lock	boolean
    //   21	10	2	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   13	21	21	finally
  }
  
  public void update()
    throws BundleException
  {
    update(null);
  }
  
  /* Error */
  public void update(final InputStream in)
    throws BundleException
  {
    // Byte code:
    //   0: getstatic 763	org/eclipse/osgi/framework/debug/Debug:DEBUG_GENERAL	Z
    //   3: ifeq +51 -> 54
    //   6: new 387	java/lang/StringBuffer
    //   9: dup
    //   10: ldc_w 371
    //   13: invokespecial 808	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   16: aload_0
    //   17: getfield 771	org/eclipse/osgi/framework/internal/core/AbstractBundle:bundledata	Lorg/eclipse/osgi/framework/adaptor/BundleData;
    //   20: invokeinterface 915 1 0
    //   25: invokevirtual 813	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   28: invokevirtual 807	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   31: invokestatic 833	org/eclipse/osgi/framework/debug/Debug:println	(Ljava/lang/String;)V
    //   34: new 387	java/lang/StringBuffer
    //   37: dup
    //   38: ldc_w 352
    //   41: invokespecial 808	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   44: aload_1
    //   45: invokevirtual 812	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   48: invokevirtual 807	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   51: invokestatic 833	org/eclipse/osgi/framework/debug/Debug:println	(Ljava/lang/String;)V
    //   54: aload_0
    //   55: getfield 773	org/eclipse/osgi/framework/internal/core/AbstractBundle:framework	Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   58: aload_0
    //   59: ldc_w 363
    //   62: invokevirtual 889	org/eclipse/osgi/framework/internal/core/Framework:checkAdminPermission	(Lorg/osgi/framework/Bundle;Ljava/lang/String;)V
    //   65: aload_0
    //   66: getfield 771	org/eclipse/osgi/framework/internal/core/AbstractBundle:bundledata	Lorg/eclipse/osgi/framework/adaptor/BundleData;
    //   69: invokeinterface 911 1 0
    //   74: bipush 22
    //   76: iand
    //   77: ifeq +14 -> 91
    //   80: aload_0
    //   81: getfield 773	org/eclipse/osgi/framework/internal/core/AbstractBundle:framework	Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   84: aload_0
    //   85: ldc_w 362
    //   88: invokevirtual 889	org/eclipse/osgi/framework/internal/core/Framework:checkAdminPermission	(Lorg/osgi/framework/Bundle;Ljava/lang/String;)V
    //   91: aload_0
    //   92: invokevirtual 839	org/eclipse/osgi/framework/internal/core/AbstractBundle:checkValid	()V
    //   95: aload_0
    //   96: invokevirtual 838	org/eclipse/osgi/framework/internal/core/AbstractBundle:beginStateChange	()V
    //   99: invokestatic 820	java/security/AccessController:getContext	()Ljava/security/AccessControlContext;
    //   102: astore_2
    //   103: aload_0
    //   104: new 414	org/eclipse/osgi/framework/internal/core/AbstractBundle$2
    //   107: dup
    //   108: aload_0
    //   109: aload_1
    //   110: aload_2
    //   111: invokespecial 874	org/eclipse/osgi/framework/internal/core/AbstractBundle$2:<init>	(Lorg/eclipse/osgi/framework/internal/core/AbstractBundle;Ljava/io/InputStream;Ljava/security/AccessControlContext;)V
    //   114: invokevirtual 857	org/eclipse/osgi/framework/internal/core/AbstractBundle:updateWorker	(Ljava/security/PrivilegedExceptionAction;)V
    //   117: goto +10 -> 127
    //   120: astore_3
    //   121: aload_0
    //   122: invokevirtual 841	org/eclipse/osgi/framework/internal/core/AbstractBundle:completeStateChange	()V
    //   125: aload_3
    //   126: athrow
    //   127: aload_0
    //   128: invokevirtual 841	org/eclipse/osgi/framework/internal/core/AbstractBundle:completeStateChange	()V
    //   131: return
    // Line number table:
    //   Java source line #578	-> byte code offset #0
    //   Java source line #579	-> byte code offset #6
    //   Java source line #580	-> byte code offset #34
    //   Java source line #582	-> byte code offset #54
    //   Java source line #583	-> byte code offset #65
    //   Java source line #585	-> byte code offset #80
    //   Java source line #586	-> byte code offset #91
    //   Java source line #587	-> byte code offset #95
    //   Java source line #589	-> byte code offset #99
    //   Java source line #591	-> byte code offset #103
    //   Java source line #612	-> byte code offset #120
    //   Java source line #613	-> byte code offset #121
    //   Java source line #614	-> byte code offset #125
    //   Java source line #613	-> byte code offset #127
    //   Java source line #615	-> byte code offset #131
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	132	0	this	AbstractBundle
    //   0	132	1	in	InputStream
    //   102	9	2	callerContext	AccessControlContext
    //   120	6	3	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   99	120	120	finally
  }
  
  /* Error */
  protected void updateWorker(PrivilegedExceptionAction<Object> action)
    throws BundleException
  {
    // Byte code:
    //   0: iconst_0
    //   1: istore_2
    //   2: aload_0
    //   3: invokevirtual 843	org/eclipse/osgi/framework/internal/core/AbstractBundle:isFragment	()Z
    //   6: ifne +8 -> 14
    //   9: aload_0
    //   10: getfield 764	org/eclipse/osgi/framework/internal/core/AbstractBundle:state	I
    //   13: istore_2
    //   14: iload_2
    //   15: bipush 40
    //   17: iand
    //   18: ifeq +34 -> 52
    //   21: aload_0
    //   22: iconst_1
    //   23: invokevirtual 850	org/eclipse/osgi/framework/internal/core/AbstractBundle:stopWorker	(I)V
    //   26: goto +26 -> 52
    //   29: astore_3
    //   30: aload_0
    //   31: getfield 773	org/eclipse/osgi/framework/internal/core/AbstractBundle:framework	Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   34: iconst_2
    //   35: aload_0
    //   36: aload_3
    //   37: invokevirtual 890	org/eclipse/osgi/framework/internal/core/Framework:publishFrameworkEvent	(ILorg/osgi/framework/Bundle;Ljava/lang/Throwable;)V
    //   40: aload_0
    //   41: getfield 764	org/eclipse/osgi/framework/internal/core/AbstractBundle:state	I
    //   44: bipush 40
    //   46: iand
    //   47: ifeq +5 -> 52
    //   50: aload_3
    //   51: athrow
    //   52: aload_1
    //   53: invokestatic 822	java/security/AccessController:doPrivileged	(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;
    //   56: pop
    //   57: aload_0
    //   58: getfield 773	org/eclipse/osgi/framework/internal/core/AbstractBundle:framework	Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   61: bipush 8
    //   63: aload_0
    //   64: invokevirtual 888	org/eclipse/osgi/framework/internal/core/Framework:publishBundleEvent	(ILorg/osgi/framework/Bundle;)V
    //   67: goto +76 -> 143
    //   70: astore_3
    //   71: aload_3
    //   72: invokevirtual 825	java/security/PrivilegedActionException:getException	()Ljava/lang/Exception;
    //   75: instanceof 383
    //   78: ifeq +11 -> 89
    //   81: aload_3
    //   82: invokevirtual 825	java/security/PrivilegedActionException:getException	()Ljava/lang/Exception;
    //   85: checkcast 383	java/lang/RuntimeException
    //   88: athrow
    //   89: aload_3
    //   90: invokevirtual 825	java/security/PrivilegedActionException:getException	()Ljava/lang/Exception;
    //   93: checkcast 442	org/osgi/framework/BundleException
    //   96: athrow
    //   97: astore 4
    //   99: iload_2
    //   100: bipush 40
    //   102: iand
    //   103: ifeq +37 -> 140
    //   106: aload_0
    //   107: iconst_1
    //   108: iload_2
    //   109: bipush 8
    //   111: iand
    //   112: ifeq +7 -> 119
    //   115: iconst_2
    //   116: goto +4 -> 120
    //   119: iconst_0
    //   120: ior
    //   121: invokevirtual 848	org/eclipse/osgi/framework/internal/core/AbstractBundle:startWorker	(I)V
    //   124: goto +16 -> 140
    //   127: astore 5
    //   129: aload_0
    //   130: getfield 773	org/eclipse/osgi/framework/internal/core/AbstractBundle:framework	Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   133: iconst_2
    //   134: aload_0
    //   135: aload 5
    //   137: invokevirtual 890	org/eclipse/osgi/framework/internal/core/Framework:publishFrameworkEvent	(ILorg/osgi/framework/Bundle;Ljava/lang/Throwable;)V
    //   140: aload 4
    //   142: athrow
    //   143: iload_2
    //   144: bipush 40
    //   146: iand
    //   147: ifeq +37 -> 184
    //   150: aload_0
    //   151: iconst_1
    //   152: iload_2
    //   153: bipush 8
    //   155: iand
    //   156: ifeq +7 -> 163
    //   159: iconst_2
    //   160: goto +4 -> 164
    //   163: iconst_0
    //   164: ior
    //   165: invokevirtual 848	org/eclipse/osgi/framework/internal/core/AbstractBundle:startWorker	(I)V
    //   168: goto +16 -> 184
    //   171: astore 5
    //   173: aload_0
    //   174: getfield 773	org/eclipse/osgi/framework/internal/core/AbstractBundle:framework	Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   177: iconst_2
    //   178: aload_0
    //   179: aload 5
    //   181: invokevirtual 890	org/eclipse/osgi/framework/internal/core/Framework:publishFrameworkEvent	(ILorg/osgi/framework/Bundle;Ljava/lang/Throwable;)V
    //   184: return
    // Line number table:
    //   Java source line #621	-> byte code offset #0
    //   Java source line #622	-> byte code offset #2
    //   Java source line #623	-> byte code offset #9
    //   Java source line #624	-> byte code offset #14
    //   Java source line #626	-> byte code offset #21
    //   Java source line #627	-> byte code offset #29
    //   Java source line #628	-> byte code offset #30
    //   Java source line #629	-> byte code offset #40
    //   Java source line #630	-> byte code offset #50
    //   Java source line #635	-> byte code offset #52
    //   Java source line #636	-> byte code offset #57
    //   Java source line #637	-> byte code offset #70
    //   Java source line #638	-> byte code offset #71
    //   Java source line #639	-> byte code offset #81
    //   Java source line #640	-> byte code offset #89
    //   Java source line #641	-> byte code offset #97
    //   Java source line #642	-> byte code offset #99
    //   Java source line #644	-> byte code offset #106
    //   Java source line #645	-> byte code offset #127
    //   Java source line #646	-> byte code offset #129
    //   Java source line #649	-> byte code offset #140
    //   Java source line #642	-> byte code offset #143
    //   Java source line #644	-> byte code offset #150
    //   Java source line #645	-> byte code offset #171
    //   Java source line #646	-> byte code offset #173
    //   Java source line #650	-> byte code offset #184
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	185	0	this	AbstractBundle
    //   0	185	1	action	PrivilegedExceptionAction<Object>
    //   1	152	2	previousState	int
    //   29	22	3	e	BundleException
    //   70	20	3	pae	PrivilegedActionException
    //   97	44	4	localObject	Object
    //   127	9	5	e	BundleException
    //   171	9	5	e	BundleException
    // Exception table:
    //   from	to	target	type
    //   21	26	29	org/osgi/framework/BundleException
    //   52	67	70	java/security/PrivilegedActionException
    //   52	97	97	finally
    //   106	124	127	org/osgi/framework/BundleException
    //   150	168	171	org/osgi/framework/BundleException
  }
  
  protected void updateWorkerPrivileged(URLConnection source, AccessControlContext callerContext)
    throws BundleException
  {
    AbstractBundle oldBundle = createBundle(bundledata, framework, false);
    boolean reloaded = false;
    BundleOperation storage = framework.adaptor.updateBundle(bundledata, source);
    BundleRepository bundles = framework.getBundles();
    try
    {
      BundleData newBundleData = storage.begin();
      
      final AbstractBundle newBundle = framework.createAndVerifyBundle(newBundleData, false);
      
      int st = getState();
      synchronized (bundles)
      {
        String oldBSN = getSymbolicName();
        boolean exporting = reload(newBundle);
        
        bundles.update(oldBSN, this);
        manifestLocalization = null;
      }
      boolean exporting;
      reloaded = true;
      if (System.getSecurityManager() != null)
      {
        final boolean extension = (bundledata.getType() & 0x16) != 0;
        if ((extension) && (!hasPermission(new AllPermission()))) {
          throw new BundleException(Msg.BUNDLE_EXTENSION_PERMISSION, 6, new SecurityException(Msg.BUNDLE_EXTENSION_PERMISSION));
        }
        try
        {
          AccessController.doPrivileged(new PrivilegedExceptionAction()
          {
            public Object run()
              throws Exception
            {
              framework.checkAdminPermission(newBundle, "lifecycle");
              if (extension) {
                framework.checkAdminPermission(newBundle, "extensionLifecycle");
              }
              return null;
            }
          }, callerContext);
        }
        catch (PrivilegedActionException e)
        {
          throw e.getException();
        }
      }
      if (st == 4) {
        framework.publishBundleEvent(64, this);
      }
      storage.commit(exporting);
    }
    catch (Throwable t)
    {
      try
      {
        storage.undo();
        if (reloaded) {
          synchronized (bundles)
          {
            String oldBSN = getSymbolicName();
            reload(oldBundle);
            
            bundles.update(oldBSN, this);
          }
        }
      }
      catch (BundleException ee)
      {
        framework.publishFrameworkEvent(2, this, ee);
        if ((t instanceof SecurityException)) {
          throw ((SecurityException)t);
        }
        if ((t instanceof BundleException)) {
          throw ((BundleException)t);
        }
        throw new BundleException(t.getMessage(), t);
      }
    }
  }
  
  /* Error */
  public void uninstall()
    throws BundleException
  {
    // Byte code:
    //   0: getstatic 763	org/eclipse/osgi/framework/debug/Debug:DEBUG_GENERAL	Z
    //   3: ifeq +31 -> 34
    //   6: new 387	java/lang/StringBuffer
    //   9: dup
    //   10: ldc_w 369
    //   13: invokespecial 808	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   16: aload_0
    //   17: getfield 771	org/eclipse/osgi/framework/internal/core/AbstractBundle:bundledata	Lorg/eclipse/osgi/framework/adaptor/BundleData;
    //   20: invokeinterface 915 1 0
    //   25: invokevirtual 813	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   28: invokevirtual 807	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   31: invokestatic 833	org/eclipse/osgi/framework/debug/Debug:println	(Ljava/lang/String;)V
    //   34: aload_0
    //   35: getfield 773	org/eclipse/osgi/framework/internal/core/AbstractBundle:framework	Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   38: aload_0
    //   39: ldc_w 363
    //   42: invokevirtual 889	org/eclipse/osgi/framework/internal/core/Framework:checkAdminPermission	(Lorg/osgi/framework/Bundle;Ljava/lang/String;)V
    //   45: aload_0
    //   46: getfield 771	org/eclipse/osgi/framework/internal/core/AbstractBundle:bundledata	Lorg/eclipse/osgi/framework/adaptor/BundleData;
    //   49: invokeinterface 911 1 0
    //   54: bipush 22
    //   56: iand
    //   57: ifeq +14 -> 71
    //   60: aload_0
    //   61: getfield 773	org/eclipse/osgi/framework/internal/core/AbstractBundle:framework	Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   64: aload_0
    //   65: ldc_w 362
    //   68: invokevirtual 889	org/eclipse/osgi/framework/internal/core/Framework:checkAdminPermission	(Lorg/osgi/framework/Bundle;Ljava/lang/String;)V
    //   71: aload_0
    //   72: invokevirtual 839	org/eclipse/osgi/framework/internal/core/AbstractBundle:checkValid	()V
    //   75: aload_0
    //   76: invokevirtual 838	or
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-2017. Infinite Loop Ltd