org.eclipse.osgi_3.7.2.v20120110-1415

     throws Exception
      {
        if ((hook instanceof ListenerHook)) {
          if (added) {
            ((ListenerHook)hook).added(listeners);
          } else {
            ((ListenerHook)hook).removed(listeners);
          }
        }
      }
      
      public String getHookClassName()
      {
        return ServiceRegistry.listenerHookName;
      }
      
      public String getHookMethodName()
      {
        return added ? "added" : "removed";
      }
    });
  }
}

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

import java.security.PrivilegedAction;
import org.eclipse.osgi.framework.internal.core.BundleContextImpl;
import org.osgi.framework.ServiceFactory;

class ServiceUse$1
  implements PrivilegedAction<S>
{
  final ServiceUse this$0;
  
  ServiceUse$1(ServiceUse paramServiceUse) {}
  
  public S run()
  {
    return (S)this$0.factory.getService(this$0.context.getBundleImpl(), this$0.registration);
  }
}

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

import java.security.PrivilegedAction;
import org.eclipse.osgi.framework.internal.core.BundleContextImpl;
import org.osgi.framework.ServiceFactory;

class ServiceUse$2
  implements PrivilegedAction<S>
{
  final ServiceUse this$0;
  
  ServiceUse$2(ServiceUse paramServiceUse, Object paramObject) {}
  
  public S run()
  {
    this$0.factory.ungetService(this$0.context.getBundleImpl(), this$0.registration, val$service);
    return null;
  }
}

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

import java.security.PrivilegedAction;
import org.eclipse.osgi.framework.internal.core.BundleContextImpl;
import org.osgi.framework.ServiceFactory;

class ServiceUse$3
  implements PrivilegedAction<S>
{
  final ServiceUse this$0;
  
  ServiceUse$3(ServiceUse paramServiceUse, Object paramObject) {}
  
  public S run()
  {
    this$0.factory.ungetService(this$0.context.getBundleImpl(), this$0.registration, val$service);
    return null;
  }
}

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

import java.security.AccessController;
import java.security.PrivilegedAction;
import org.eclipse.osgi.framework.debug.Debug;
import org.eclipse.osgi.framework.internal.core.BundleContextImpl;
import org.eclipse.osgi.framework.internal.core.Framework;
import org.eclipse.osgi.framework.internal.core.Msg;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.ServiceException;
import org.osgi.framework.ServiceFactory;

public class ServiceUse<S>
{
  final ServiceFactory<S> factory;
  final BundleContextImpl context;
  final ServiceRegistrationImpl<S> registration;
  private S cachedService;
  private int useCount;
  private boolean factoryInUse;
  
  static
  {
    try {}catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
  
  ServiceUse(BundleContextImpl context, ServiceRegistrationImpl<S> registration)
  {
    useCount = 0;
    factoryInUse = false;
    S service = registration.getServiceObject();
    if ((service instanceof ServiceFactory))
    {
      ServiceFactory<S> f = (ServiceFactory)service;
      factory = f;
      cachedService = null;
    }
    else
    {
      factory = null;
      cachedService = service;
    }
    this.context = context;
    this.registration = registration;
  }
  
  /* Error */
  S getService()
  {
    // Byte code:
    //   0: getstatic 213	org/eclipse/osgi/internal/serviceregistry/ServiceUse:$assertionsDisabled	Z
    //   3: ifne +18 -> 21
    //   6: aload_0
    //   7: invokestatic 231	java/lang/Thread:holdsLock	(Ljava/lang/Object;)Z
    //   10: ifne +11 -> 21
    //   13: new 104	java/lang/AssertionError
    //   16: dup
    //   17: invokespecial 219	java/lang/AssertionError:<init>	()V
    //   20: athrow
    //   21: aload_0
    //   22: getfield 212	org/eclipse/osgi/internal/serviceregistry/ServiceUse:useCount	I
    //   25: ifgt +10 -> 35
    //   28: aload_0
    //   29: getfield 218	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factory	Lorg/osgi/framework/ServiceFactory;
    //   32: ifnonnull +18 -> 50
    //   35: aload_0
    //   36: dup
    //   37: getfield 212	org/eclipse/osgi/internal/serviceregistry/ServiceUse:useCount	I
    //   40: iconst_1
    //   41: iadd
    //   42: putfield 212	org/eclipse/osgi/internal/serviceregistry/ServiceUse:useCount	I
    //   45: aload_0
    //   46: getfield 215	org/eclipse/osgi/internal/serviceregistry/ServiceUse:cachedService	Ljava/lang/Object;
    //   49: areturn
    //   50: getstatic 207	org/eclipse/osgi/framework/debug/Debug:DEBUG_SERVICES	Z
    //   53: ifeq +60 -> 113
    //   56: new 109	java/lang/StringBuffer
    //   59: dup
    //   60: ldc 10
    //   62: invokespecial 228	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   65: aload_0
    //   66: getfield 217	org/eclipse/osgi/internal/serviceregistry/ServiceUse:registration	Lorg/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl;
    //   69: invokevirtual 242	org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl:getBundle	()Lorg/osgi/framework/Bundle;
    //   72: invokevirtual 229	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   75: ldc 8
    //   77: invokevirtual 230	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   80: aload_0
    //   81: getfield 216	org/eclipse/osgi/internal/serviceregistry/ServiceUse:context	Lorg/eclipse/osgi/framework/internal/core/BundleContextImpl;
    //   84: invokevirtual 236	org/eclipse/osgi/framework/internal/core/BundleContextImpl:getBundleImpl	()Lorg/eclipse/osgi/framework/internal/core/AbstractBundle;
    //   87: invokevirtual 229	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   90: ldc 2
    //   92: invokevirtual 230	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   95: aload_0
    //   96: getfield 217	org/eclipse/osgi/internal/serviceregistry/ServiceUse:registration	Lorg/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl;
    //   99: invokevirtual 229	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   102: ldc 1
    //   104: invokevirtual 230	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   107: invokevirtual 227	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   110: invokestatic 234	org/eclipse/osgi/framework/debug/Debug:println	(Ljava/lang/String;)V
    //   113: aload_0
    //   114: getfield 214	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factoryInUse	Z
    //   117: ifeq +84 -> 201
    //   120: getstatic 207	org/eclipse/osgi/framework/debug/Debug:DEBUG_SERVICES	Z
    //   123: ifeq +28 -> 151
    //   126: new 109	java/lang/StringBuffer
    //   129: dup
    //   130: invokespecial 226	java/lang/StringBuffer:<init>	()V
    //   133: aload_0
    //   134: getfield 218	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factory	Lorg/osgi/framework/ServiceFactory;
    //   137: invokevirtual 229	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   140: ldc 4
    //   142: invokevirtual 230	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   145: invokevirtual 227	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   148: invokestatic 234	org/eclipse/osgi/framework/debug/Debug:println	(Ljava/lang/String;)V
    //   151: new 125	org/osgi/framework/ServiceException
    //   154: dup
    //   155: getstatic 210	org/eclipse/osgi/framework/internal/core/Msg:SERVICE_FACTORY_RECURSION	Ljava/lang/String;
    //   158: aload_0
    //   159: getfield 218	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factory	Lorg/osgi/framework/ServiceFactory;
    //   162: invokevirtual 225	java/lang/Object:getClass	()Ljava/lang/Class;
    //   165: invokevirtual 221	java/lang/Class:getName	()Ljava/lang/String;
    //   168: ldc 9
    //   170: invokestatic 248	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
    //   173: bipush 6
    //   175: invokespecial 249	org/osgi/framework/ServiceException:<init>	(Ljava/lang/String;I)V
    //   178: astore_1
    //   179: aload_0
    //   180: getfield 216	org/eclipse/osgi/internal/serviceregistry/ServiceUse:context	Lorg/eclipse/osgi/framework/internal/core/BundleContextImpl;
    //   183: invokevirtual 237	org/eclipse/osgi/framework/internal/core/BundleContextImpl:getFramework	()Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   186: bipush 16
    //   188: aload_0
    //   189: getfield 217	org/eclipse/osgi/internal/serviceregistry/ServiceUse:registration	Lorg/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl;
    //   192: invokevirtual 242	org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl:getBundle	()Lorg/osgi/framework/Bundle;
    //   195: aload_1
    //   196: invokevirtual 239	org/eclipse/osgi/framework/internal/core/Framework:publishFrameworkEvent	(ILorg/osgi/framework/Bundle;Ljava/lang/Throwable;)V
    //   199: aconst_null
    //   200: areturn
    //   201: aload_0
    //   202: iconst_1
    //   203: putfield 214	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factoryInUse	Z
    //   206: new 121	org/eclipse/osgi/internal/serviceregistry/ServiceUse$1
    //   209: dup
    //   210: aload_0
    //   211: invokespecial 244	org/eclipse/osgi/internal/serviceregistry/ServiceUse$1:<init>	(Lorg/eclipse/osgi/internal/serviceregistry/ServiceUse;)V
    //   214: invokestatic 233	java/security/AccessController:doPrivileged	(Ljava/security/PrivilegedAction;)Ljava/lang/Object;
    //   217: astore_1
    //   218: goto +126 -> 344
    //   221: astore_2
    //   222: getstatic 207	org/eclipse/osgi/framework/debug/Debug:DEBUG_SERVICES	Z
    //   225: ifeq +39 -> 264
    //   228: new 109	java/lang/StringBuffer
    //   231: dup
    //   232: invokespecial 226	java/lang/StringBuffer:<init>	()V
    //   235: aload_0
    //   236: getfield 218	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factory	Lorg/osgi/framework/ServiceFactory;
    //   239: invokevirtual 229	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   242: ldc 3
    //   244: invokevirtual 230	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   247: aload_2
    //   248: invokevirtual 232	java/lang/Throwable:getMessage	()Ljava/lang/String;
    //   251: invokevirtual 230	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   254: invokevirtual 227	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   257: invokestatic 234	org/eclipse/osgi/framework/debug/Debug:println	(Ljava/lang/String;)V
    //   260: aload_2
    //   261: invokestatic 235	org/eclipse/osgi/framework/debug/Debug:printStackTrace	(Ljava/lang/Throwable;)V
    //   264: aload_0
    //   265: getfield 216	org/eclipse/osgi/internal/serviceregistry/ServiceUse:context	Lorg/eclipse/osgi/framework/internal/core/BundleContextImpl;
    //   268: invokevirtual 237	org/eclipse/osgi/framework/internal/core/BundleContextImpl:getFramework	()Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   271: invokevirtual 238	org/eclipse/osgi/framework/internal/core/Framework:getAdaptor	()Lorg/eclipse/osgi/framework/adaptor/FrameworkAdaptor;
    //   274: aload_2
    //   275: invokeinterface 251 2 0
    //   280: new 125	org/osgi/framework/ServiceException
    //   283: dup
    //   284: getstatic 208	org/eclipse/osgi/framework/internal/core/Msg:SERVICE_FACTORY_EXCEPTION	Ljava/lang/String;
    //   287: aload_0
    //   288: getfield 218	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factory	Lorg/osgi/framework/ServiceFactory;
    //   291: invokevirtual 225	java/lang/Object:getClass	()Ljava/lang/Class;
    //   294: invokevirtual 221	java/lang/Class:getName	()Ljava/lang/String;
    //   297: ldc 9
    //   299: invokestatic 248	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
    //   302: iconst_3
    //   303: aload_2
    //   304: invokespecial 250	org/osgi/framework/ServiceException:<init>	(Ljava/lang/String;ILjava/lang/Throwable;)V
    //   307: astore_3
    //   308: aload_0
    //   309: getfield 216	org/eclipse/osgi/internal/serviceregistry/ServiceUse:context	Lorg/eclipse/osgi/framework/internal/core/BundleContextImpl;
    //   312: invokevirtual 237	org/eclipse/osgi/framework/internal/core/BundleContextImpl:getFramework	()Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   315: iconst_2
    //   316: aload_0
    //   317: getfield 217	org/eclipse/osgi/internal/serviceregistry/ServiceUse:registration	Lorg/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl;
    //   320: invokevirtual 242	org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl:getBundle	()Lorg/osgi/framework/Bundle;
    //   323: aload_3
    //   324: invokevirtual 239	org/eclipse/osgi/framework/internal/core/Framework:publishFrameworkEvent	(ILorg/osgi/framework/Bundle;Ljava/lang/Throwable;)V
    //   327: aload_0
    //   328: iconst_0
    //   329: putfield 214	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factoryInUse	Z
    //   332: aconst_null
    //   333: areturn
    //   334: astore 4
    //   336: aload_0
    //   337: iconst_0
    //   338: putfield 214	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factoryInUse	Z
    //   341: aload 4
    //   343: athrow
    //   344: aload_0
    //   345: iconst_0
    //   346: putfield 214	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factoryInUse	Z
    //   349: aload_1
    //   350: ifnonnull +81 -> 431
    //   353: getstatic 207	org/eclipse/osgi/framework/debug/Debug:DEBUG_SERVICES	Z
    //   356: ifeq +28 -> 384
    //   359: new 109	java/lang/StringBuffer
    //   362: dup
    //   363: invokespecial 226	java/lang/StringBuffer:<init>	()V
    //   366: aload_0
    //   367: getfield 218	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factory	Lorg/osgi/framework/ServiceFactory;
    //   370: invokevirtual 229	java/lang/StringBuffer:append	(Ljava/lang/Object;)Ljava/lang/StringBuffer;
    //   373: ldc 5
    //   375: invokevirtual 230	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   378: invokevirtual 227	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   381: invokestatic 234	org/eclipse/osgi/framework/debug/Debug:println	(Ljava/lang/String;)V
    //   384: new 125	org/osgi/framework/ServiceException
    //   387: dup
    //   388: getstatic 211	org/eclipse/osgi/framework/internal/core/Msg:SERVICE_OBJECT_NULL_EXCEPTION	Ljava/lang/String;
    //   391: aload_0
    //   392: getfield 218	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factory	Lorg/osgi/framework/ServiceFactory;
    //   395: invokevirtual 225	java/lang/Object:getClass	()Ljava/lang/Class;
    //   398: invokevirtual 221	java/lang/Class:getName	()Ljava/lang/String;
    //   401: invokestatic 247	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   404: iconst_2
    //   405: invokespecial 249	org/osgi/framework/ServiceException:<init>	(Ljava/lang/String;I)V
    //   408: astore_2
    //   409: aload_0
    //   410: getfield 216	org/eclipse/osgi/internal/serviceregistry/ServiceUse:context	Lorg/eclipse/osgi/framework/internal/core/BundleContextImpl;
    //   413: invokevirtual 237	org/eclipse/osgi/framework/internal/core/BundleContextImpl:getFramework	()Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   416: bipush 16
    //   418: aload_0
    //   419: getfield 217	org/eclipse/osgi/internal/serviceregistry/ServiceUse:registration	Lorg/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl;
    //   422: invokevirtual 242	org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl:getBundle	()Lorg/osgi/framework/Bundle;
    //   425: aload_2
    //   426: invokevirtual 239	org/eclipse/osgi/framework/internal/core/Framework:publishFrameworkEvent	(ILorg/osgi/framework/Bundle;Ljava/lang/Throwable;)V
    //   429: aconst_null
    //   430: areturn
    //   431: aload_0
    //   432: getfield 217	org/eclipse/osgi/internal/serviceregistry/ServiceUse:registration	Lorg/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl;
    //   435: invokevirtual 241	org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl:getClasses	()[Ljava/lang/String;
    //   438: astore_2
    //   439: aload_2
    //   440: aload_1
    //   441: invokestatic 243	org/eclipse/osgi/internal/serviceregistry/ServiceRegistry:checkServiceClass	([Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   444: astore_3
    //   445: aload_3
    //   446: ifnull +77 -> 523
    //   449: getstatic 207	org/eclipse/osgi/framework/debug/Debug:DEBUG_SERVICES	Z
    //   452: ifeq +22 -> 474
    //   455: new 109	java/lang/StringBuffer
    //   458: dup
    //   459: ldc 7
    //   461: invokespecial 228	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   464: aload_3
    //   465: invokevirtual 230	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   468: invokevirtual 227	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   471: invokestatic 234	org/eclipse/osgi/framework/debug/Debug:println	(Ljava/lang/String;)V
    //   474: new 125	org/osgi/framework/ServiceException
    //   477: dup
    //   478: getstatic 209	org/eclipse/osgi/framework/internal/core/Msg:SERVICE_FACTORY_NOT_INSTANCEOF_CLASS_EXCEPTION	Ljava/lang/String;
    //   481: aload_0
    //   482: getfield 218	org/eclipse/osgi/internal/serviceregistry/ServiceUse:factory	Lorg/osgi/framework/ServiceFactory;
    //   485: invokevirtual 225	java/lang/Object:getClass	()Ljava/lang/Class;
    //   488: invokevirtual 221	java/lang/Class:getName	()Ljava/lang/String;
    //   491: aload_3
    //   492: invokestatic 248	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/String;
    //   495: iconst_2
    //   496: invokespecial 249	org/osgi/framework/ServiceException:<init>	(Ljava/lang/String;I)V
    //   499: astore 4
    //   501: aload_0
    //   502: getfield 216	org/eclipse/osgi/internal/serviceregistry/ServiceUse:context	Lorg/eclipse/osgi/framework/internal/core/BundleContextImpl;
    //   505: invokevirtual 237	org/eclipse/osgi/framework/internal/core/BundleContextImpl:getFramework	()Lorg/eclipse/osgi/framework/internal/core/Framework;
    //   508: iconst_2
    //   509: aload_0
    //   510: getfield 217	org/eclipse/osgi/internal/serviceregistry/ServiceUse:registration	Lorg/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl;
    //   513: invokevirtual 242	org/eclipse/osgi/internal/serviceregistry/ServiceRegistrationImpl:getBundle	()Lorg/osgi/framework/Bundle;
    //   516: aload 4
    //   518: invokevirtual 239	org/eclipse/osgi/framework/internal/core/Framework:publishFrameworkEvent	(ILorg/osgi/framework/Bundle;Ljava/lang/Throwable;)V
    //   521: aconst_null
    //   522: areturn
    //   523: aload_0
    //   524: aload_1
    //   525: putfield 215	org/eclipse/osgi/internal/serviceregistry/ServiceUse:cachedService	Ljava/lang/Object;
    //   528: aload_0
    //   529: dup
    //   530: getfield 212	org/eclipse/osgi/internal/serviceregistry/ServiceUse:useCount	I
    //   533: iconst_1
    //   534: iadd
    //   535: putfield 212	org/eclipse/osgi/internal/serviceregistry/ServiceUse:useCount	I
    //   538: aload_1
    //   539: areturn
    // Line number table:
    //   Java source line #114	-> byte code offset #0
    //   Java source line #115	-> byte code offset #21
    //   Java source line #116	-> byte code offset #35
    //   Java source line #117	-> byte code offset #45
    //   Java source line #120	-> byte code offset #50
    //   Java source line #121	-> byte code offset #56
    //   Java source line #124	-> byte code offset #113
    //   Java source line #125	-> byte code offset #120
    //   Java source line #126	-> byte code offset #126
    //   Java source line #129	-> byte code offset #151
    //   Java source line #130	-> byte code offset #179
    //   Java source line #131	-> byte code offset #199
    //   Java source line #133	-> byte code offset #201
    //   Java source line #136	-> byte code offset #206
    //   Java source line #141	-> byte code offset #221
    //   Java source line #142	-> byte code offset #222
    //   Java source line #143	-> byte code offset #228
    //   Java source line #144	-> byte code offset #260
    //   Java source line #147	-> byte code offset #264
    //   Java source line #148	-> byte code offset #280
    //   Java source line #149	-> byte code offset #308
    //   Java source line #152	-> byte code offset #327
    //   Java source line #150	-> byte code offset #332
    //   Java source line #151	-> byte code offset #334
    //   Java source line #152	-> byte code offset #336
    //   Java source line #153	-> byte code offset #341
    //   Java source line #152	-> byte code offset #344
    //   Java source line #155	-> byte code offset #349
    //   Java source line #156	-> byte code offset #353
    //   Java source line #157	-> byte code offset #359
    //   Java source line #160	-> byte code offset #384
    //   Java source line #161	-> byte code offset #409
    //   Java source line #162	-> byte code offset #429
    //   Java source line #165	-> byte code offset #431
    //   Java source line #166	-> byte code offset #439
    //   Java source line #167	-> byte code offset #445
    //   Java source line #168	-> byte code offset #449
    //   Java source line #169	-> byte code offset #455
    //   Java source line #171	-> byte code offset #474
    //   Java source line #172	-> byte code offset #501
    //   Java source line #173	-> byte code offset #521
    //   Java source line #176	-> byte code offset #523
    //   Java source line #177	-> byte code offset #528
    //   Java source line #179	-> byte code offset #538
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	540	0	this	ServiceUse<S>
    //   178	18	1	se	ServiceException
    //   217	2	1	service	S
    //   344	195	1	service	S
    //   221	83	2	t	Throwable
    //   408	18	2	se	ServiceException
    //   438	2	2	clazzes	String[]
    //   307	17	3	se	ServiceException
    //   444	48	3	invalidService	String
    //   334	8	4	localObject	Object
    //   499	18	4	se	ServiceException
    // Exception table:
    //   from	to	target	type
    //   206	218	221	java/lang/Throwable
    //   206	327	334	finally
  }
  
  boolean ungetService()
  {
    assert (Thread.holdsLock(this));
    if (useCount == 0) {
      return true;
    }
    useCount -= 1;
    if (useCount > 0) {
      return false;
    }
    if (factory == null) {
      return true;
    }
    final S service = cachedService;
    cachedService = null;
    if (Debug.DEBUG_SERVICES) {
      Debug.println("ungetService[factory=" + registration.getBundle() + "](" + context.getBundleImpl() + "," + registration + ")");
    }
    try
    {
      AccessController.doPrivileged(new PrivilegedAction()
      {
        public S run()
        {
          factory.ungetService(context.getBundleImpl(), registration, service);
          return null;
        }
      });
    }
    catch (Throwable t)
    {
      if (Debug.DEBUG_GENERAL)
      {
        Debug.println(factory + ".ungetService() exception");
        Debug.printStackTrace(t);
      }
      ServiceException se = new ServiceException(NLS.bind(Msg.SERVICE_FACTORY_EXCEPTION, factory.getClass().getName(), "ungetService"), 3, t);
      context.getFramework().publishFrameworkEvent(2, registration.getBundle(), se);
    }
    return true;
  }
  
  void releaseService()
  {
    assert (Thread.holdsLock(this));
    if ((useCount == 0) || (factory == null)) {
      return;
    }
    final S service = cachedService;
    cachedService = null;
    useCount = 0;
    if (Debug.DEBUG_SERVICES) {
      Debug.println("releaseService[factory=" + registration.getBundle() + "](" + context.getBundleImpl() + "," + registration + ")");
    }
    try
    {
      AccessController.doPrivileged(new PrivilegedAction()
      {
        public S run()
        {
          factory.ungetService(context.getBundleImpl(), registration, service);
          return null;
        }
      });
    }
    catch (Throwable t)
    {
      if (Debug.DEBUG_SERVICES)
      {
        Debug.println(factory + ".ungetService() exception");
        Debug.printStackTrace(t);
      }
      ServiceException se = new ServiceException(NLS.bind(Msg.SERVICE_FACTORY_EXCEPTION, factory.getClass().getName(), "ungetService"), 3, t);
      context.getFramework().publishFrameworkEvent(2, registration.getBundle(), se);
    }
  }
}

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

import java.util.Collection;
import java.util.Iterator;
import java.util.List;

class ShrinkableCollection$1
  implements Iterator<E>
{
  private E last;
  final ShrinkableCollection this$0;
  
  ShrinkableCollection$1(ShrinkableCollection paramShrinkableCollection, Iterator paramIterator, List paramList) {}
  
  public boolean hasNext()
  {
    return val$iter.hasNext();
  }
  
  public E next()
  {
    last = val$iter.next();
    return (E)last;
  }
  
  public void remove()
  {
    val$iter.remove();
    for (Iterator localIterator = val$collections.iterator(); localIterator.hasNext();)
    {
      Collection<? extends E> c = (Collection)localIterator.next();
      c.remove(last);
    }
  }
}

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

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

public class ShrinkableCollection<E>
  implements Collection<E>
{
  private final Collection<? extends E> collection;
  private final List<Collection<? extends E>> list;
  
  static
  {
    try {}catch (ClassNotFoundException localClassNotFoundException)
    {
      throw new NoClassDefFoundError(localClassNotFoundException.getMessage());
    }
  }
  
  public ShrinkableCollection(Collection<? extends E> c)
  {
    if (c == null) {
      throw new NullPointerException();
    }
    List<Collection<? extends E>> empty = Collections.EMPTY_LIST;
    list = empty;
    collection = c;
  }
  
  public ShrinkableCollection(Collection<? extends E> c1, Collection<? extends E> c2)
  {
    list = new ArrayList(2);
    list.add(c1);
    list.add(c2);
    collection = initComposite(list);
  }
  
  public ShrinkableCollection(List<Collection<? extends E>> l)
  {
    list = new ArrayList(l);
    collection = initComposite(list);
  }
  
  private static <E> Collection<? extends E> initComposite(List<Collection<? extends E>> collections)
  {
    int size = 0;
    for (Iterator localIterator1 = collections.iterator(); localIterator1.hasNext();)
    {
      Collection<? extends E> c = (Collection)localIterator1.next();
      assert (verifyNoDuplicates(c));
      size += c.size();
    }
    Collection<E> result = new ArrayList(size);
    Iterator localIterator3;
    for (Iterator localIterator2 = collections.iterator(); localIterator2.hasNext(); localIterator3.hasNext())
    {
      Object c = (Collection)localIterator2.next();
      localIterator3 = ((Collection)c).iterator(); continue;E e = (Object)localIterator3.next();
      if (!result.contains(e)) {
        result.add(e);
      }
    }
    return result;
  }
  
  private static <E> boolean verifyNoDuplicates(Collection<? extends E> c)
  {
    for (Iterator localIterator1 = c.iterator(); localIterator1.hasNext();)
    {
      E e = (Object)localIterator1.next();
      int count = 0;
      for (Iterator localIterator2 = c.iterator(); localIterator2.hasNext();)
      {
        E f = (Object)localIterator2.next();
        if (e == null)
        {
          if (f == null) {
            count++;
          }
        }
        else if (e.equals(f)) {
          count++;
        }
      }
      if (count != 1) {
        return false;
      }
    }
    return true;
  }
  
  public boolean add(E e)
  {
    throw new UnsupportedOperationException();
  }
  
  public boolean addAll(Collection<? extends E> c)
  {
    throw new UnsupportedOperationException();
  }
  
  public void clear()
  {
    collection.clear();
    for (Iterator localIterator = list.iterator(); localIterator.hasNext();)
    {
      Collection<? extends E> c = (Collection)localIterator.next();
      c.clear();
    }
  }
  
  public boolean contains(Object o)
  {
    return collection.contains(o);
  }
  
  public boolean containsAll(Collection<?> c)
  {
    return collection.containsAll(c);
  }
  
  public boolean isEmpty()
  {
    return collection.isEmpty();
  }
  
  public Iterator<E> iterator()
  {
    final Iterator<E> iter = collection.iterator();
    final List<Collection<? extends E>> collections = list;
    if (collections.isEmpty()) {
      return iter;
    }
    new Iterator()
    {
      private E last;
      
      public boolean hasNext()
      {
        return iter.hasNext();
      }
      
      public E next()
      {
        last = iter.next();
        return (E)last;
      }
      
      public void remove()
      {
        iter.remove();
        for (Iterator localIterator = collections.iterator(); localIterator.hasNext();)
        {
          Collection<? extends E> c = (Collection)localIterator.next();
          c.remove(last);
        }
      }
    };
  }
  
  public boolean remove(Object o)
  {
    boolean result = collection.remove(o);
    if (result) {
      for (Iterator localIterator = list.iterator(); localIterator.hasNext();)
      {
        Collection<? extends E> c = (Collection)localIterator.next();
        c.remove(o);
      }
    }
    return result;
  }
  
  public boolean removeAll(Collection<?> c)
  {
    boolean result = collection.removeAll(c);
    if (result) {
      for (Iterator localIterator = list.iterator(); localIterator.hasNext();)
      {
        Collection<? extends E> cc = (Collection)localIterator.next();
        cc.removeAll(c);
      }
    }
    return result;
  }
  
  public boolean retainAll(Collection<?> c)
  {
    boolean result = collection.retainAll(c);
    if (result) {
      for (Iterator localIterator = list.iterator(); localIterator.hasNext();)
      {
        Collection<? extends E> cc = (Collection)localIterator.next();
        cc.retainAll(c);
      }
    }
    return result;
  }
  
  public int size()
  {
    return collection.size();
  }
  
  public Object[] toArray()
  {
    return collection.toArray();
  }
  
  public <T> T[] toArray(T[] var0)
  {
    return collection.toArray(var0);
  }
  
  public String toString()
  {
    return collection.toString();
  }
}

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

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

final class ShrinkableEntrySetValueCollection$ValueIterator<E>
  implements Iterator<E>
{
  private final Iterator<? extends Map.Entry<?, ? extends E>> iter;
  
  ShrinkableEntrySetValueCollection$ValueIterator(Iterator<? extends Map.Entry<?, ? extends E>> i)
  {
    iter = i;
  }
  
  public boolean hasNext()
  {
    return iter.hasNext();
  }
  
  public E next()
  {
    Map.Entry<?, ? extends E> entry = (Map.Entry)iter.next();
    return (E)entry.getValue();
  }
  
  public void remove()
  {
    iter.remove();
  }
}

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

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

public class ShrinkableEntrySetValueCollection<E>
  extends AbstractCollection<E>
  implements Collection<E>
{
  private final Set<? extends Map.Entry<?, ? extends E>> entrySet;
  
  public ShrinkableEntrySetValueCollection(Set<? extends Map.Entry<?, ? extends E>> e)
  {
    if (e == null) {
      throw new NullPointerException();
    }
    entrySet = e;
  }
  
  public void clear()
  {
    entrySet.clear();
  }
  
  public boolean isEmpty()
  {
    return entrySet.isEmpty();
  }
  
  public Iterator<E> iterator()
  {
    return new ValueIterator(entrySet.iterator());
  }
  
  public int size()
  {
    return entrySet.size();
  }
  
  private static final class ValueIterator<E>
    implements Iterator<E>
  {
    private final Iterator<? extends Map.Entry<?, ? extends E>> iter;
    
    ValueIterator(Iterator<? extends Map.Entry<?, ? extends E>> i)
    {
      iter = i;
    }
    
    public boolean hasNext()
    {
      return iter.hasNext();
    }
    
    public E next()
    {
      Map.Entry<?, ? extends E> entry = (Map.Entry)iter.next();
      return (E)entry.getValue();
    }
    
    public void remove()
    {
      iter.remove();
    }
  }
}

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

import java.util.Collection;
import java.util.Map.Entry;

final class ShrinkableValueCollectionMap$Entry
  implements Map.Entry<K, Collection<V>>
{
  private final K key;
  private Collection<V> value;
  final ShrinkableValueCollectionMap this$0;
  
  ShrinkableValueCollectionMap$Entry(K arg1)
  {
    key = k;
  }
  
  public K getKey()
  {
    return (K)key;
  }
  
  public Collection<V> getValue()
  {
    if (value == null) {
      value = this$0.get(key);
    }
    return value;
  }
  
  public Collection<V> setValue(Collection<V> value)
  {
    throw new UnsupportedOperationException();
  }
  
  public String toString()
  {
    return getKey() + "=" + getValue();
  }
  
  public int hashCode()
  {
    return ShrinkableValueCollectionMap.hash(getKey()) ^ ShrinkableValueCollectionMap.hash(getValue());
  }
  
  public boolean equals(Object obj)
  {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof Map.Entry)) {
      return false;
    }
    Map.Entry<?, ?> other = (Map.Entry)obj;
    return (ShrinkableValueCollectionMap.equality(getKey(), other.getKey())) && (ShrinkableValueCollectionMap.equality(getValue(), other.getValue()));
  }
}

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

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

final class ShrinkableValueCollectionMap$EntryIterator
  implements Iterator<Map.Entry<K, Collection<V>>>
{
  private final Iterator<? extends K> iter;
  private K last;
  final ShrinkableValueCollectionMap this$0;
  
  ShrinkableValueCollectionMap$EntryIterator(ShrinkableValueCollectionMap paramShrinkableValueCollectionMap)
  {
    iter = map.keySet().iterator();
  }
  
  public boolean hasNext()
  {
    return iter.hasNext();
  }
  
  public Map.Entry<K, Collection<V>> next()
  {
    last = iter.next();
    return new ShrinkableValueCollectionMap.Entry(this$0, last);
  }
  
  public void remove()
  {
    iter.remove();
    if (this$0.values != null) {
      this$0.values.remove(last);
    }
  }
}

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

import java.util.AbstractSet;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map.Entry;

final class ShrinkableValueCollectionMap$EntrySet
  extends AbstractSet<Map.Entry<K, Collection<V>>>
{
  final ShrinkableValueCollectionMap this$0;
  
  ShrinkableValueCollectionMap$EntrySet(ShrinkableValueCollectionMap paramShrinkableValueCollectionMap) {}
  
  public Iterator<Map.Entry<K, Collection<V>>> iterator()
  {
    return new ShrinkableValueCollectionMap.EntryIterator(this$0);
  }
  
  public int size()
  {
    return this$0.size();
  }
}

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

import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class ShrinkableValueCollectionMap<K, V>
  extends AbstractMap<K, Collection<V>>
  implements Map<K, Collection<V>>
{
  final Map<? extends K, ? extends Set<? extends Map.Entry<?, ? extends V>>> map;
  Map<Object, Collection<V>> values;
  
  public ShrinkableValueCollectionMap(Map<? extends K, ? extends Set<? extends Map.Entry<?, ? extends V>>> m)
  {
    if (m == null) {
      throw new NullPointerException();
    }
    map = m;
    values = null;
  }
  
  public void clear()
  {
    map.clear();
    if (values != null) {
      values.clear();
    }
  }
  
  public boolean containsKey(Object key)
  {
    return map.containsKey(key);
  }
  
  public boolean containsValue(Object value)
  {
    if (values == null) {
      return false;
    }
    return values.containsValue(value);
  }
  
  public Set<Map.Entry<K, Collection<V>>> entrySet()
  {
    return new EntrySet();
  }
  
  public Collection<V> get(Object key)
  {
    Collection<V> value = null;
    if (values != null) {
      value = (Collection)values.get(key);
    }
    if (value == null)
    {
      Set<? extends Map.Entry<?, ? extends V>> entrySet = (Set)map.get(key);
      if (entrySet == null) {
        return null;
      }
      value = new ShrinkableEntrySetValueCollection(entrySet);
      if (values == null) {
        values = new HashMap(map.size());
      }
      values.put(key, value);
    }
    return value;
  }
  
  public boolean isEmpty()
  {
    return map.isEmpty();
  }
  
  public Collection<V> remove(Object key)
  {
    Set<? extends Map.Entry<?, ? extends V>> entrySet = (Set)map.remove(key);
    Collection<V> value = null;
    if (values != null) {
      value = (Collection)values.remove(key);
    }
    if ((value == null) && (entrySet != null)) {
      value = new ShrinkableEntrySetValueCollection(entrySet);
    }
    return value;
  }
  
  public int size()
  {
    return map.size();
  }
  
  private final class EntrySet
    extends AbstractSet<Map.Entry<K, Collection<V>>>
  {
    EntrySet() {}
    
    public Iterator<Map.Entry<K, Collection<V>>> iterator()
    {
      return new Shrinkab
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