osgi-4.0.0

16:50:52.134 INFO  jd.cli.Main - Decompiling osgi-4.0.0.jar
package org.osgi.application;

import java.util.Dictionary;
import java.util.Map;
import org.osgi.framework.ServiceRegistration;

public abstract interface ApplicationContext
{
  public abstract void addServiceListener(ApplicationServiceListener paramApplicationServiceListener, String paramString)
    throws IllegalArgumentException;
  
  public abstract void addServiceListener(ApplicationServiceListener paramApplicationServiceListener, String[] paramArrayOfString)
    throws IllegalArgumentException;
  
  public abstract void removeServiceListener(ApplicationServiceListener paramApplicationServiceListener);
  
  public abstract String getInstanceId();
  
  public abstract String getApplicationId();
  
  public abstract Object locateService(String paramString);
  
  public abstract Object[] locateServices(String paramString);
  
  public abstract Map getStartupParameters();
  
  public abstract Map getServiceProperties(Object paramObject);
  
  public abstract ServiceRegistration registerService(String[] paramArrayOfString, Object paramObject, Dictionary paramDictionary);
  
  public abstract ServiceRegistration registerService(String paramString, Object paramObject, Dictionary paramDictionary);
}

/* Location:
 * Qualified Name:     org.osgi.application.ApplicationContext
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.application;

import org.osgi.framework.ServiceEvent;
import org.osgi.framework.ServiceReference;

public class ApplicationServiceEvent
  extends ServiceEvent
{
  private static final long serialVersionUID = -4762149286971897323L;
  final Object serviceObject;
  
  public ApplicationServiceEvent(int type, ServiceReference reference, Object serviceObject)
  {
    super(type, reference);
    this.serviceObject = serviceObject;
  }
  
  public Object getServiceObject()
  {
    return serviceObject;
  }
}

/* Location:
 * Qualified Name:     org.osgi.application.ApplicationServiceEvent
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.application;

import java.util.EventListener;

public abstract interface ApplicationServiceListener
  extends EventListener
{
  public abstract void serviceChanged(ApplicationServiceEvent paramApplicationServiceEvent);
}

/* Location:
 * Qualified Name:     org.osgi.application.ApplicationServiceListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.application;

import java.util.Hashtable;

public final class Framework
{
  private static Hashtable appContextHash;
  
  public static ApplicationContext getApplicationContext(Object applicationInstance)
  {
    ApplicationContext appContext = (ApplicationContext)appContextHash.get(applicationInstance);
    if (appContext == null) {
      throw new IllegalArgumentException("ApplicationContext not found!");
    }
    return appContext;
  }
}

/* Location:
 * Qualified Name:     org.osgi.application.Framework
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.lang.reflect.Constructor;
import java.security.PrivilegedAction;

class AdminPermission$1
  implements PrivilegedAction
{
  public Object run()
  {
    String packageName = System.getProperty("org.osgi.vendor.framework");
    if (packageName == null) {
      throw new NoClassDefFoundError("org.osgi.vendor.framework property not set");
    }
    try
    {
      delegateClass = Class.forName(packageName + ".AdminPermission");
    }
    catch (ClassNotFoundException e)
    {
      Class delegateClass;
      throw new NoClassDefFoundError(e.toString());
    }
    Class delegateClass;
    Constructor[] result = new Constructor[2];
    try
    {
      result[0] = delegateClass.getConstructor(new Class[] { AdminPermission.class$java$lang$String == null ? (AdminPermission.class$java$lang$String = AdminPermission.class$("java.lang.String")) : AdminPermission.class$java$lang$String, AdminPermission.class$java$lang$String == null ? (AdminPermission.class$java$lang$String = AdminPermission.class$("java.lang.String")) : AdminPermission.class$java$lang$String });
      
      result[1] = delegateClass.getConstructor(new Class[] { AdminPermission.class$org$osgi$framework$Bundle == null ? (AdminPermission.class$org$osgi$framework$Bundle = AdminPermission.class$("org.osgi.framework.Bundle")) : AdminPermission.class$org$osgi$framework$Bundle, AdminPermission.class$java$lang$String == null ? (AdminPermission.class$java$lang$String = AdminPermission.class$("java.lang.String")) : AdminPermission.class$java$lang$String });
    }
    catch (NoSuchMethodException e)
    {
      throw new NoSuchMethodError(e.toString());
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     org.osgi.framework.AdminPermission.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.security.AccessController;
import java.security.BasicPermission;
import java.security.Permission;
import java.security.PermissionCollection;
import java.security.PrivilegedAction;

public final class AdminPermission
  extends BasicPermission
{
  static final long serialVersionUID = 307051004521261705L;
  public static final String CLASS = "class";
  public static final String EXECUTE = "execute";
  public static final String EXTENSIONLIFECYCLE = "extensionLifecycle";
  public static final String LIFECYCLE = "lifecycle";
  public static final String LISTENER = "listener";
  public static final String METADATA = "metadata";
  public static final String RESOLVE = "resolve";
  public static final String RESOURCE = "resource";
  public static final String STARTLEVEL = "startlevel";
  private static final String packageProperty = "org.osgi.vendor.framework";
  
  static
  {
    Constructor[] constructors = (Constructor[])AccessController.doPrivileged(new PrivilegedAction()
    {
      public Object run()
      {
        String packageName = System.getProperty("org.osgi.vendor.framework");
        if (packageName == null) {
          throw new NoClassDefFoundError("org.osgi.vendor.framework property not set");
        }
        try
        {
          delegateClass = Class.forName(packageName + ".AdminPermission");
        }
        catch (ClassNotFoundException e)
        {
          Class delegateClass;
          throw new NoClassDefFoundError(e.toString());
        }
        Class delegateClass;
        Constructor[] result = new Constructor[2];
        try
        {
          result[0] = delegateClass.getConstructor(new Class[] { String.class, String.class });
          
          result[1] = delegateClass.getConstructor(new Class[] { Bundle.class, String.class });
        }
        catch (NoSuchMethodException e)
        {
          throw new NoSuchMethodError(e.toString());
        }
        return result;
      }
    });
  }
  
  private static final Constructor initStringString = constructors[0];
  private static final Constructor initBundleString = constructors[1];
  private final Permission delegate;
  
  public AdminPermission()
  {
    this("*", "*");
  }
  
  public AdminPermission(String filter, String actions)
  {
    super(filter == null ? "*" : filter);
    try
    {
      try
      {
        delegate = ((Permission)initStringString.newInstance(new Object[] { filter, actions }));
      }
      catch (InvocationTargetException e)
      {
        throw e.getTargetException();
      }
    }
    catch (Error e)
    {
      throw e;
    }
    catch (RuntimeException e)
    {
      throw e;
    }
    catch (Throwable e)
    {
      throw new RuntimeException(e.toString());
    }
  }
  
  public AdminPermission(Bundle bundle, String actions)
  {
    super(createName(bundle));
    try
    {
      try
      {
        delegate = ((Permission)initBundleString.newInstance(new Object[] { bundle, actions }));
      }
      catch (InvocationTargetException e)
      {
        throw e.getTargetException();
      }
    }
    catch (Error e)
    {
      throw e;
    }
    catch (RuntimeException e)
    {
      throw e;
    }
    catch (Throwable e)
    {
      throw new RuntimeException(e.toString());
    }
  }
  
  private static String createName(Bundle bundle)
  {
    StringBuffer sb = new StringBuffer();
    sb.append("(id=");
    sb.append(bundle.getBundleId());
    sb.append(")");
    return sb.toString();
  }
  
  public boolean equals(Object obj)
  {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof AdminPermission)) {
      return false;
    }
    AdminPermission p = (AdminPermission)obj;
    
    return delegate.equals(delegate);
  }
  
  public int hashCode()
  {
    return delegate.hashCode();
  }
  
  public String getActions()
  {
    return delegate.getActions();
  }
  
  public boolean implies(Permission p)
  {
    if (!(p instanceof AdminPermission)) {
      return false;
    }
    AdminPermission pp = (AdminPermission)p;
    return delegate.implies(delegate);
  }
  
  public PermissionCollection newPermissionCollection()
  {
    return delegate.newPermissionCollection();
  }
}

/* Location:
 * Qualified Name:     org.osgi.framework.AdminPermission
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

public abstract interface AllServiceListener
  extends ServiceListener
{}

/* Location:
 * Qualified Name:     org.osgi.framework.AllServiceListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.Dictionary;
import java.util.Enumeration;

public abstract interface Bundle
{
  public static final int UNINSTALLED = 1;
  public static final int INSTALLED = 2;
  public static final int RESOLVED = 4;
  public static final int STARTING = 8;
  public static final int STOPPING = 16;
  public static final int ACTIVE = 32;
  
  public abstract int getState();
  
  public abstract void start()
    throws BundleException;
  
  public abstract void stop()
    throws BundleException;
  
  public abstract void update()
    throws BundleException;
  
  public abstract void update(InputStream paramInputStream)
    throws BundleException;
  
  public abstract void uninstall()
    throws BundleException;
  
  public abstract Dictionary getHeaders();
  
  public abstract long getBundleId();
  
  public abstract String getLocation();
  
  public abstract ServiceReference[] getRegisteredServices();
  
  public abstract ServiceReference[] getServicesInUse();
  
  public abstract boolean hasPermission(Object paramObject);
  
  public abstract URL getResource(String paramString);
  
  public abstract Dictionary getHeaders(String paramString);
  
  public abstract String getSymbolicName();
  
  public abstract Class loadClass(String paramString)
    throws ClassNotFoundException;
  
  public abstract Enumeration getResources(String paramString)
    throws IOException;
  
  public abstract Enumeration getEntryPaths(String paramString);
  
  public abstract URL getEntry(String paramString);
  
  public abstract long getLastModified();
  
  public abstract Enumeration findEntries(String paramString1, String paramString2, boolean paramBoolean);
}

/* Location:
 * Qualified Name:     org.osgi.framework.Bundle
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

public abstract interface BundleActivator
{
  public abstract void start(BundleContext paramBundleContext)
    throws Exception;
  
  public abstract void stop(BundleContext paramBundleContext)
    throws Exception;
}

/* Location:
 * Qualified Name:     org.osgi.framework.BundleActivator
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.io.File;
import java.io.InputStream;
import java.util.Dictionary;

public abstract interface BundleContext
{
  public abstract String getProperty(String paramString);
  
  public abstract Bundle getBundle();
  
  public abstract Bundle installBundle(String paramString)
    throws BundleException;
  
  public abstract Bundle installBundle(String paramString, InputStream paramInputStream)
    throws BundleException;
  
  public abstract Bundle getBundle(long paramLong);
  
  public abstract Bundle[] getBundles();
  
  public abstract void addServiceListener(ServiceListener paramServiceListener, String paramString)
    throws InvalidSyntaxException;
  
  public abstract void addServiceListener(ServiceListener paramServiceListener);
  
  public abstract void removeServiceListener(ServiceListener paramServiceListener);
  
  public abstract void addBundleListener(BundleListener paramBundleListener);
  
  public abstract void removeBundleListener(BundleListener paramBundleListener);
  
  public abstract void addFrameworkListener(FrameworkListener paramFrameworkListener);
  
  public abstract void removeFrameworkListener(FrameworkListener paramFrameworkListener);
  
  public abstract ServiceRegistration registerService(String[] paramArrayOfString, Object paramObject, Dictionary paramDictionary);
  
  public abstract ServiceRegistration registerService(String paramString, Object paramObject, Dictionary paramDictionary);
  
  public abstract ServiceReference[] getServiceReferences(String paramString1, String paramString2)
    throws InvalidSyntaxException;
  
  public abstract ServiceReference[] getAllServiceReferences(String paramString1, String paramString2)
    throws InvalidSyntaxException;
  
  public abstract ServiceReference getServiceReference(String paramString);
  
  public abstract Object getService(ServiceReference paramServiceReference);
  
  public abstract boolean ungetService(ServiceReference paramServiceReference);
  
  public abstract File getDataFile(String paramString);
  
  public abstract Filter createFilter(String paramString)
    throws InvalidSyntaxException;
}

/* Location:
 * Qualified Name:     org.osgi.framework.BundleContext
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.util.EventObject;

public class BundleEvent
  extends EventObject
{
  static final long serialVersionUID = 4080640865971756012L;
  private Bundle bundle;
  private int type;
  public static final int INSTALLED = 1;
  public static final int STARTED = 2;
  public static final int STOPPED = 4;
  public static final int UPDATED = 8;
  public static final int UNINSTALLED = 16;
  public static final int RESOLVED = 32;
  public static final int UNRESOLVED = 64;
  public static final int STARTING = 128;
  public static final int STOPPING = 256;
  
  public BundleEvent(int type, Bundle bundle)
  {
    super(bundle);
    this.bundle = bundle;
    this.type = type;
  }
  
  public Bundle getBundle()
  {
    return bundle;
  }
  
  public int getType()
  {
    return type;
  }
}

/* Location:
 * Qualified Name:     org.osgi.framework.BundleEvent
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

public class BundleException
  extends Exception
{
  static final long serialVersionUID = 3571095144220455665L;
  private Throwable cause;
  
  public BundleException(String msg, Throwable cause)
  {
    super(msg);
    this.cause = cause;
  }
  
  public BundleException(String msg)
  {
    super(msg);
    cause = null;
  }
  
  public Throwable getNestedException()
  {
    return cause;
  }
  
  public Throwable getCause()
  {
    return cause;
  }
  
  public Throwable initCause(Throwable cause)
  {
    throw new IllegalStateException();
  }
}

/* Location:
 * Qualified Name:     org.osgi.framework.BundleException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.util.EventListener;

public abstract interface BundleListener
  extends EventListener
{
  public abstract void bundleChanged(BundleEvent paramBundleEvent);
}

/* Location:
 * Qualified Name:     org.osgi.framework.BundleListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.security.BasicPermission;
import java.security.Permission;
import java.security.PermissionCollection;

public final class BundlePermission
  extends BasicPermission
{
  private static final long serialVersionUID = 3257846601685873716L;
  public static final String PROVIDE = "provide";
  public static final String REQUIRE = "require";
  public static final String HOST = "host";
  public static final String FRAGMENT = "fragment";
  private static final int ACTION_PROVIDE = 1;
  private static final int ACTION_REQUIRE = 2;
  private static final int ACTION_HOST = 4;
  private static final int ACTION_FRAGMENT = 8;
  private static final int ACTION_ALL = 15;
  private static final int ACTION_NONE = 0;
  private transient int action_mask = 0;
  private String actions = null;
  
  public BundlePermission(String symbolicName, String actions)
  {
    this(symbolicName, getMask(actions));
  }
  
  BundlePermission(String symbolicName, int mask)
  {
    super(symbolicName);
    init(mask);
  }
  
  private void init(int mask)
  {
    if ((mask == 0) || ((mask & 0xF) != mask)) {
      throw new IllegalArgumentException("invalid action string");
    }
    action_mask = mask;
  }
  
  private static int getMask(String actions)
  {
    boolean seencomma = false;
    
    int mask = 0;
    if (actions == null) {
      return mask;
    }
    char[] a = actions.toCharArray();
    
    int i = a.length - 1;
    if (i < 0) {
      return mask;
    }
    while (i != -1)
    {
      char c;
      while ((i != -1) && (((c = a[i]) == ' ') || (c == '\r') || (c == '\n') || (c == '\f') || (c == '\t'))) {
        i--;
      }
      int matchlen;
      if ((i >= 6) && ((a[(i - 6)] == 'p') || (a[(i - 6)] == 'P')) && ((a[(i - 5)] == 'r') || (a[(i - 5)] == 'R')) && ((a[(i - 4)] == 'o') || (a[(i - 4)] == 'O')) && ((a[(i - 3)] == 'v') || (a[(i - 3)] == 'V')) && ((a[(i - 2)] == 'i') || (a[(i - 2)] == 'I')) && ((a[(i - 1)] == 'd') || (a[(i - 1)] == 'D')) && ((a[i] == 'e') || (a[i] == 'E')))
      {
        int matchlen = 7;
        mask |= 0x3;
      }
      else if ((i >= 6) && ((a[(i - 6)] == 'r') || (a[(i - 6)] == 'R')) && ((a[(i - 5)] == 'e') || (a[(i - 5)] == 'E')) && ((a[(i - 4)] == 'q') || (a[(i - 4)] == 'Q')) && ((a[(i - 3)] == 'u') || (a[(i - 3)] == 'U')) && ((a[(i - 2)] == 'i') || (a[(i - 2)] == 'I')) && ((a[(i - 1)] == 'r') || (a[(i - 1)] == 'R')) && ((a[i] == 'e') || (a[i] == 'E')))
      {
        int matchlen = 7;
        mask |= 0x2;
      }
      else if ((i >= 3) && ((a[(i - 3)] == 'h') || (a[(i - 3)] == 'H')) && ((a[(i - 2)] == 'o') || (a[(i - 2)] == 'O')) && ((a[(i - 1)] == 's') || (a[(i - 1)] == 'S')) && ((a[i] == 't') || (a[i] == 'T')))
      {
        int matchlen = 4;
        mask |= 0x4;
      }
      else if ((i >= 7) && ((a[(i - 7)] == 'f') || (a[(i - 7)] == 'F')) && ((a[(i - 6)] == 'r') || (a[(i - 6)] == 'R')) && ((a[(i - 5)] == 'a') || (a[(i - 5)] == 'A')) && ((a[(i - 4)] == 'g') || (a[(i - 4)] == 'G')) && ((a[(i - 3)] == 'm') || (a[(i - 3)] == 'M')) && ((a[(i - 2)] == 'e') || (a[(i - 2)] == 'E')) && ((a[(i - 1)] == 'n') || (a[(i - 1)] == 'N')) && ((a[i] == 't') || (a[i] == 'T')))
      {
        matchlen = 8;
        mask |= 0x8;
      }
      else
      {
        throw new IllegalArgumentException("invalid permission: " + actions);
      }
      seencomma = false;
      while ((i >= matchlen) && (!seencomma))
      {
        switch (a[(i - matchlen)])
        {
        case ',': 
          seencomma = true;
        case '\t': 
        case '\n': 
        case '\f': 
        case '\r': 
        case ' ': 
          break;
        default: 
          throw new IllegalArgumentException("invalid permission: " + actions);
        }
        i--;
      }
      i -= matchlen;
    }
    if (seencomma) {
      throw new IllegalArgumentException("invalid permission: " + actions);
    }
    return mask;
  }
  
  public boolean implies(Permission p)
  {
    if ((p instanceof BundlePermission))
    {
      BundlePermission target = (BundlePermission)p;
      
      return ((action_mask & action_mask) == action_mask) && (super.implies(p));
    }
    return false;
  }
  
  public String getActions()
  {
    if (actions == null)
    {
      StringBuffer sb = new StringBuffer();
      boolean comma = false;
      if ((action_mask & 0x1) == 1)
      {
        sb.append("provide");
        comma = true;
      }
      if ((action_mask & 0x2) == 2)
      {
        if (comma) {
          sb.append(',');
        }
        sb.append("require");
        comma = true;
      }
      if ((action_mask & 0x4) == 4)
      {
        if (comma) {
          sb.append(',');
        }
        sb.append("host");
        comma = true;
      }
      if ((action_mask & 0x8) == 8)
      {
        if (comma) {
          sb.append(',');
        }
        sb.append("fragment");
      }
      actions = sb.toString();
    }
    return actions;
  }
  
  public PermissionCollection newPermissionCollection()
  {
    return new BundlePermissionCollection();
  }
  
  public boolean equals(Object obj)
  {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof BundlePermission)) {
      return false;
    }
    BundlePermission p = (BundlePermission)obj;
    
    return (action_mask == action_mask) && (getName().equals(p.getName()));
  }
  
  public int hashCode()
  {
    return getName().hashCode() ^ getActions().hashCode();
  }
  
  int getMask()
  {
    return action_mask;
  }
  
  private synchronized void writeObject(ObjectOutputStream s)
    throws IOException
  {
    if (actions == null) {
      getActions();
    }
    s.defaultWriteObject();
  }
  
  private synchronized void readObject(ObjectInputStream s)
    throws IOException, ClassNotFoundException
  {
    s.defaultReadObject();
    init(getMask(actions));
  }
}

/* Location:
 * Qualified Name:     org.osgi.framework.BundlePermission
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.security.Permission;
import java.security.PermissionCollection;
import java.util.Enumeration;
import java.util.Hashtable;

final class BundlePermissionCollection
  extends PermissionCollection
{
  private static final long serialVersionUID = 3258407326846433079L;
  private Hashtable permissions;
  private boolean all_allowed;
  
  public BundlePermissionCollection()
  {
    permissions = new Hashtable();
    all_allowed = false;
  }
  
  public void add(Permission permission)
  {
    if (!(permission instanceof BundlePermission)) {
      throw new IllegalArgumentException("invalid permission: " + permission);
    }
    if (isReadOnly()) {
      throw new SecurityException("attempt to add a Permission to a readonly PermissionCollection");
    }
    BundlePermission bp = (BundlePermission)permission;
    String name = bp.getName();
    
    BundlePermission existing = (BundlePermission)permissions.get(name);
    if (existing != null)
    {
      int oldMask = existing.getMask();
      int newMask = bp.getMask();
      if (oldMask != newMask) {
        permissions.put(name, new BundlePermission(name, oldMask | newMask));
      }
    }
    else
    {
      permissions.put(name, permission);
    }
    if ((!all_allowed) && 
      (name.equals("*"))) {
      all_allowed = true;
    }
  }
  
  public boolean implies(Permission permission)
  {
    if (!(permission instanceof BundlePermission)) {
      return false;
    }
    BundlePermission bp = (BundlePermission)permission;
    
    int desired = bp.getMask();
    int effective = 0;
    if (all_allowed)
    {
      BundlePermission x = (BundlePermission)permissions.get("*");
      if (x != null)
      {
        effective |= x.getMask();
        if ((effective & desired) == desired) {
          return true;
        }
      }
    }
    String name = bp.getName();
    
    BundlePermission x = (BundlePermission)permissions.get(name);
    if (x != null)
    {
      effective |= x.getMask();
      if ((effective & desired) == desired) {
        return true;
      }
    }
    int offset = name.length() - 1;
    int last;
    while ((last = name.lastIndexOf(".", offset)) != -1)
    {
      name = name.substring(0, last + 1) + "*";
      x = (BundlePermission)permissions.get(name);
      if (x != null)
      {
        effective |= x.getMask();
        if ((effective & desired) == desired) {
          return true;
        }
      }
      offset = last - 1;
    }
    return false;
  }
  
  public Enumeration elements()
  {
    return permissions.elements();
  }
}

/* Location:
 * Qualified Name:     org.osgi.framework.BundlePermissionCollection
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

/**
 * @deprecated
 */
public abstract interface Configurable
{
  /**
   * @deprecated
   */
  public abstract Object getConfigurationObject();
}

/* Location:
 * Qualified Name:     org.osgi.framework.Configurable
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

public abstract interface Constants
{
  public static final String SYSTEM_BUNDLE_LOCATION = "System Bundle";
  public static final String SYSTEM_BUNDLE_SYMBOLICNAME = "system.bundle";
  public static final String BUNDLE_CATEGORY = "Bundle-Category";
  public static final String BUNDLE_CLASSPATH = "Bundle-ClassPath";
  public static final String BUNDLE_COPYRIGHT = "Bundle-Copyright";
  public static final String BUNDLE_DESCRIPTION = "Bundle-Description";
  public static final String BUNDLE_NAME = "Bundle-Name";
  public static final String BUNDLE_NATIVECODE = "Bundle-NativeCode";
  public static final String EXPORT_PACKAGE = "Export-Package";
  public static final String EXPORT_SERVICE = "Export-Service";
  public static final String IMPORT_PACKAGE = "Import-Package";
  public static final String DYNAMICIMPORT_PACKAGE = "DynamicImport-Package";
  public static final String IMPORT_SERVICE = "Import-Service";
  public static final String BUNDLE_VENDOR = "Bundle-Vendor";
  public static final String BUNDLE_VERSION = "Bundle-Version";
  public static final String BUNDLE_DOCURL = "Bundle-DocURL";
  public static final String BUNDLE_CONTACTADDRESS = "Bundle-ContactAddress";
  public static final String BUNDLE_ACTIVATOR = "Bundle-Activator";
  public static final String BUNDLE_UPDATELOCATION = "Bundle-UpdateLocation";
  /**
   * @deprecated
   */
  public static final String PACKAGE_SPECIFICATION_VERSION = "specification-version";
  public static final String BUNDLE_NATIVECODE_PROCESSOR = "processor";
  public static final String BUNDLE_NATIVECODE_OSNAME = "osname";
  public static final String BUNDLE_NATIVECODE_OSVERSION = "osversion";
  public static final String BUNDLE_NATIVECODE_LANGUAGE = "language";
  public static final String BUNDLE_REQUIREDEXECUTIONENVIRONMENT = "Bundle-RequiredExecutionEnvironment";
  public static final String FRAMEWORK_VERSION = "org.osgi.framework.version";
  public static final String FRAMEWORK_VENDOR = "org.osgi.framework.vendor";
  public static final String FRAMEWORK_LANGUAGE = "org.osgi.framework.language";
  public static final String FRAMEWORK_OS_NAME = "org.osgi.framework.os.name";
  public static final String FRAMEWORK_OS_VERSION = "org.osgi.framework.os.version";
  public static final String FRAMEWORK_PROCESSOR = "org.osgi.framework.processor";
  public static final String FRAMEWORK_EXECUTIONENVIRONMENT = "org.osgi.framework.executionenvironment";
  public static final String FRAMEWORK_BOOTDELEGATION = "org.osgi.framework.bootdelegation";
  public static final String FRAMEWORK_SYSTEMPACKAGES = "org.osgi.framework.system.packages";
  public static final String SUPPORTS_FRAMEWORK_EXTENSION = "org.osgi.supports.framework.extension";
  public static final String SUPPORTS_BOOTCLASSPATH_EXTENSION = "org.osgi.supports.bootclasspath.extension";
  public static final String SUPPORTS_FRAMEWORK_FRAGMENT = "org.osgi.supports.framework.fragment";
  public static final String SUPPORTS_FRAMEWORK_REQUIREBUNDLE = "org.osgi.supports.framework.requirebundle";
  public static final String OBJECTCLASS = "objectClass";
  public static final String SERVICE_ID = "service.id";
  public static final String SERVICE_PID = "service.pid";
  public static final String SERVICE_RANKING = "service.ranking";
  public static final String SERVICE_VENDOR = "service.vendor";
  public static final String SERVICE_DESCRIPTION = "service.description";
  public static final String BUNDLE_SYMBOLICNAME = "Bundle-SymbolicName";
  public static final String SINGLETON_DIRECTIVE = "singleton";
  public static final String FRAGMENT_ATTACHMENT_DIRECTIVE = "fragment-attachment";
  public static final String FRAGMENT_ATTACHMENT_ALWAYS = "always";
  public static final String FRAGMENT_ATTACHMENT_RESOLVETIME = "resolve-time";
  public static final String FRAGMENT_ATTACHMENT_NEVER = "never";
  public static final String BUNDLE_LOCALIZATION = "Bundle-Localization";
  public static final String BUNDLE_LOCALIZATION_DEFAULT_BASENAME = "OSGI-INF/l10n/bundle";
  public static final String REQUIRE_BUNDLE = "Require-Bundle";
  public static final String BUNDLE_VERSION_ATTRIBUTE = "bundle-version";
  public static final String FRAGMENT_HOST = "Fragment-Host";
  public static final String SELECTION_FILTER_ATTRIBUTE = "selection-filter";
  public static final String BUNDLE_MANIFESTVERSION = "Bundle-ManifestVersion";
  public static final String VERSION_ATTRIBUTE = "version";
  public static final String BUNDLE_SYMBOLICNAME_ATTRIBUTE = "bundle-symbolic-name";
  public static final String RESOLUTION_DIRECTIVE = "resolution";
  public static final String RESOLUTION_MANDATORY = "mandatory";
  public static final String RESOLUTION_OPTIONAL = "optional";
  public static final String USES_DIRECTIVE = "uses";
  public static final String INCLUDE_DIRECTIVE = "include";
  public static final String EXCLUDE_DIRECTIVE = "exclude";
  public static final String MANDATORY_DIRECTIVE = "mandatory";
  public static final String VISIBILITY_DIRECTIVE = "visibility";
  public static final String VISIBILITY_PRIVATE = "private";
  public static final String VISIBILITY_REEXPORT = "reexport";
  public static final String EXTENSION_DIRECTIVE = "extension";
  public static final String EXTENSION_FRAMEWORK = "framework";
  public static final String EXTENSION_BOOTCLASSPATH = "bootclasspath";
}

/* Location:
 * Qualified Name:     org.osgi.framework.Constants
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.util.Dictionary;

public abstract interface Filter
{
  public abstract boolean match(ServiceReference paramServiceReference);
  
  public abstract boolean match(Dictionary paramDictionary);
  
  public abstract String toString();
  
  public abstract boolean equals(Object paramObject);
  
  public abstract int hashCode();
  
  public abstract boolean matchCase(Dictionary paramDictionary);
}

/* Location:
 * Qualified Name:     org.osgi.framework.Filter
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.util.EventObject;

public class FrameworkEvent
  extends EventObject
{
  static final long serialVersionUID = 207051004521261705L;
  private Bundle bundle;
  private Throwable throwable;
  private int type;
  public static final int STARTED = 1;
  public static final int ERROR = 2;
  public static final int PACKAGES_REFRESHED = 4;
  public static final int STARTLEVEL_CHANGED = 8;
  public static final int WARNING = 16;
  public static final int INFO = 32;
  
  /**
   * @deprecated
   */
  public FrameworkEvent(int type, Object source)
  {
    super(source);
    this.type = type;
    bundle = null;
    throwable = null;
  }
  
  public FrameworkEvent(int type, Bundle bundle, Throwable throwable)
  {
    super(bundle);
    this.type = type;
    this.bundle = bundle;
    this.throwable = throwable;
  }
  
  public Throwable getThrowable()
  {
    return throwable;
  }
  
  public Bundle getBundle()
  {
    return bundle;
  }
  
  public int getType()
  {
    return type;
  }
}

/* Location:
 * Qualified Name:     org.osgi.framework.FrameworkEvent
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.util.EventListener;

public abstract interface FrameworkListener
  extends EventListener
{
  public abstract void frameworkEvent(FrameworkEvent paramFrameworkEvent);
}

/* Location:
 * Qualified Name:     org.osgi.framework.FrameworkListener
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.security.PrivilegedAction;

class FrameworkUtil$1
  implements PrivilegedAction
{
  public Object run()
  {
    String packageName = System.getProperty("org.osgi.vendor.framework");
    if (packageName == null) {
      throw new NoClassDefFoundError("org.osgi.vendor.framework property not set");
    }
    try
    {
      delegateClass = Class.forName(packageName + ".FrameworkUtil");
    }
    catch (ClassNotFoundException e)
    {
      Class delegateClass;
      throw new NoClassDefFoundError(e.toString());
    }
    try
    {
      Class delegateClass;
      result = delegateClass.getMethod("createFilter", new Class[] { FrameworkUtil.class$java$lang$String == null ? (FrameworkUtil.class$java$lang$String = FrameworkUtil.class$("java.lang.String")) : FrameworkUtil.class$java$lang$String });
    }
    catch (NoSuchMethodException e)
    {
      Method result;
      throw new NoSuchMethodError(e.toString());
    }
    Method result;
    if (!Modifier.isStatic(result.getModifiers())) {
      throw new NoSuchMethodError("createFilter method must be static");
    }
    return result;
  }
}

/* Location:
 * Qualified Name:     org.osgi.framework.FrameworkUtil.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedAction;

public class FrameworkUtil
{
  private static final String packageProperty = "org.osgi.vendor.framework";
  private static final Method createFilter = (Method)AccessController.doPrivileged(new PrivilegedAction()
  {
    public Object run()
    {
      String packageName = System.getProperty("org.osgi.vendor.framework");
      if (packageName == null) {
        throw new NoClassDefFoundError("org.osgi.vendor.framework property not set");
      }
      try
      {
        delegateClass = Class.forName(packageName + ".FrameworkUtil");
      }
      catch (ClassNotFoundException e)
      {
        Class delegateClass;
        throw new NoClassDefFoundError(e.toString());
      }
      try
      {
        Class delegateClass;
        result = delegateClass.getMethod("createFilter", new Class[] { String.class });
      }
      catch (NoSuchMethodException e)
      {
        Method result;
        throw new NoSuchMethodError(e.toString());
      }
      Method result;
      if (!Modifier.isStatic(result.getModifiers())) {
        throw new NoSuchMethodError("createFilter method must be static");
      }
      return result;
    }
  });
  
  public static Filter createFilter(String filter)
    throws InvalidSyntaxException
  {
    try
    {
      return (Filter)createFilter.invoke(null, new Object[] { filter });
    }
    catch (InvocationTargetException e)
    {
      throw e.getTargetException();
    }
    catch (InvalidSyntaxException e)
    {
      throw e;
    }
    catch (Error e)
    {
      throw e;
    }
    catch (RuntimeException e)
    {
      throw e;
    }
    catch (Throwable e)
    {
      throw new RuntimeException(e.toString());
    }
  }
}

/* Location:
 * Qualified Name:     org.osgi.framework.FrameworkUtil
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

public class InvalidSyntaxException
  extends Exception
{
  static final long serialVersionUID = -4295194420816491875L;
  private String filter;
  private Throwable cause;
  
  public InvalidSyntaxException(String msg, String filter)
  {
    super(msg);
    this.filter = filter;
    cause = null;
  }
  
  public InvalidSyntaxException(String msg, String filter, Throwable cause)
  {
    super(msg);
    this.filter = filter;
    this.cause = cause;
  }
  
  public String getFilter()
  {
    return filter;
  }
  
  public Throwable getCause()
  {
    return cause;
  }
  
  public Throwable initCause(Throwable cause)
  {
    throw new IllegalStateException();
  }
}

/* Location:
 * Qualified Name:     org.osgi.framework.InvalidSyntaxException
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.framework;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.security.BasicPermission;
import java.security.Permission;
import java.security.PermissionCollection;

public final class PackagePermission
  extends BasicPermission
{
  static final long serialVersionUID = -5107705877071099135L;
  public static final String EXPORT = "export";
  public static final String IMPORT = "import";
  private static final int ACTION_EXPORT = 1;
  private static final int ACTION_IMPORT = 2;
  private static final int ACTION_ALL = 3;
  private static final int ACTION_NONE = 0;
  private transient int action_mask = 0;
  private String actions = null;
  
  public PackagePermission(String name, String actions)
  {
    this(name, getMask(actions));
  }
  
  PackagePermission(String name, int mask)
  {
    super(name);
    init(mask);
  }
  
  private void init(int mask)
  {
    if ((mask == 0) || ((mask & 0x3) != mask)) {
      throw new IllegalArgumentException("invalid action string");
    }
    action_mask = mask;
  }
  
  private static int getMask(String actions)
  {
    boolean seencomma = false;
    
    int mask = 0;
    if (actions == null) {
      return mask;
    }
    char[] a = actions.toCharArray();
    
    int i = a.length - 1;
    if (i < 0) {
      return mask;
    }
    while (i != -1)
    {
      char c;
      while ((i != -1) && (((c = a[i]) == ' ') || (c == '\r') || (c == '\n') || (c == '\f') || (c == '\t'))) {
        i--;
      }
      int matchlen;
      if ((i >= 5) && ((a[(i - 5)] == 'i') || (a[(i - 5)] == 'I')) && ((a[(i - 4)] == 'm') || (a[(i - 4)] == 'M')) && ((a[(i - 3)] == 'p') || (a[(i - 3)] == 'P')) && ((a[(i - 2)] == 'o') || (a[(i - 2)] == 'O')) && ((a[(i - 1)] == 'r') || (a[(i - 1)] == 'R')) && ((a[i] == 't') || (a[i] == 'T')))
      {
        int matchlen = 6;
        mask |= 0x2;
      }
      else if ((i >= 5) && ((a[(i - 5)] == 'e') || (a[(i - 5)] == 'E')) && ((a[(i - 4)] == 'x') || (a[(i - 4)] == 'X')) && ((a[(i - 3)] == 'p') || (a[(i - 3)] == 'P')) && ((a[(i - 2)] == 'o') || (a[(i - 2)] == 'O')) && ((a[(i - 1)] == 'r') || (a[(i - 1)] == 'R')) && ((a[i] == 't') || (a[i] == 'T')))
      {
        matchlen = 6;
        mask |= 0x3;
      }
      else
      {
        throw new IllegalArgumentException("invalid permission: " + actions);
      }
      seencomma = false;
      while ((i >= matchlen) && (!seencomma))
      {
        switch (a[(i - matchlen)])
        {
        case ',': 
          seencomma = true;
        case '\t': 
        case '\n': 
        case '\f': 
        case '\r': 
        case ' ': 
          break;
        default: 
          throw new IllegalArgumentException("invalid permission: " + actions);
        }
        i--;
      }
      i -= matchlen;
    }
    if (seen
1 2 3 4 5 6 7 8 9

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