org.eclipse.osgi.services_3.3.100.v20120522-1822

16:47:15.128 INFO  jd.cli.Main - Decompiling org.eclipse.osgi.services_3.3.100.v20120522-1822.jar
package org.osgi.service.cm;

import java.io.IOException;
import java.util.Dictionary;

public abstract interface Configuration
{
  public abstract String getPid();
  
  public abstract Dictionary<String, Object> getProperties();
  
  public abstract void update(Dictionary<String, ?> paramDictionary)
    throws IOException;
  
  public abstract void delete()
    throws IOException;
  
  public abstract String getFactoryPid();
  
  public abstract void update()
    throws IOException;
  
  public abstract void setBundleLocation(String paramString);
  
  public abstract String getBundleLocation();
  
  public abstract boolean equals(Object paramObject);
  
  public abstract int hashCode();
}

/* Location:
 * Qualified Name:     org.osgi.service.cm.Configuration
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.cm;

import java.io.IOException;
import org.osgi.framework.InvalidSyntaxException;

public abstract interface ConfigurationAdmin
{
  public static final String SERVICE_FACTORYPID = "service.factoryPid";
  public static final String SERVICE_BUNDLELOCATION = "service.bundleLocation";
  
  public abstract Configuration createFactoryConfiguration(String paramString)
    throws IOException;
  
  public abstract Configuration createFactoryConfiguration(String paramString1, String paramString2)
    throws IOException;
  
  public abstract Configuration getConfiguration(String paramString1, String paramString2)
    throws IOException;
  
  public abstract Configuration getConfiguration(String paramString)
    throws IOException;
  
  public abstract Configuration[] listConfigurations(String paramString)
    throws IOException, InvalidSyntaxException;
}

/* Location:
 * Qualified Name:     org.osgi.service.cm.ConfigurationAdmin
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.cm;

import org.osgi.framework.ServiceReference;

public class ConfigurationEvent
{
  public static final int CM_UPDATED = 1;
  public static final int CM_DELETED = 2;
  public static final int CM_LOCATION_CHANGED = 3;
  private final int type;
  private final String factoryPid;
  private final String pid;
  private final ServiceReference<ConfigurationAdmin> reference;
  
  public ConfigurationEvent(ServiceReference<ConfigurationAdmin> reference, int type, String factoryPid, String pid)
  {
    this.reference = reference;
    this.type = type;
    this.factoryPid = factoryPid;
    this.pid = pid;
    if ((reference == null) || (pid == null)) {
      throw new NullPointerException("reference and pid must not be null");
    }
  }
  
  public String getFactoryPid()
  {
    return factoryPid;
  }
  
  public String getPid()
  {
    return pid;
  }
  
  public int getType()
  {
    return type;
  }
  
  public ServiceReference<ConfigurationAdmin> getReference()
  {
    return reference;
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.cm.ConfigurationEvent
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.cm;

public class ConfigurationException
  extends Exception
{
  static final long serialVersionUID = -1690090413441769377L;
  private final String property;
  private final String reason;
  
  public ConfigurationException(String property, String reason)
  {
    super(new StringBuffer().append(property).append(" : ").append(reason).toString());
    this.property = property;
    this.reason = reason;
  }
  
  public ConfigurationException(String property, String reason, Throwable cause)
  {
    super(new StringBuffer().append(property).append(" : ").append(reason).toString(), cause);
    this.property = property;
    this.reason = reason;
  }
  
  public String getProperty()
  {
    return property;
  }
  
  public String getReason()
  {
    return reason;
  }
  
  public Throwable getCause()
  {
    return super.getCause();
  }
  
  public Throwable initCause(Throwable cause)
  {
    return super.initCause(cause);
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.cm.ConfigurationException
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.cm;

public abstract interface ConfigurationListener
{
  public abstract void configurationEvent(ConfigurationEvent paramConfigurationEvent);
}

/* Location:
 * Qualified Name:     org.osgi.service.cm.ConfigurationListener
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.cm;

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

public final class ConfigurationPermission
  extends BasicPermission
{
  static final long serialVersionUID = 5716868734811965383L;
  public static final String CONFIGURE = "configure";
  public static final String TARGET = "target";
  private static final int ACTION_CONFIGURE = 1;
  private static final int ACTION_TARGET = 2;
  private static final int ACTION_ALL = 3;
  static final int ACTION_NONE = 0;
  transient int action_mask;
  private volatile String actions = null;
  private transient List<String> substrings;
  
  public ConfigurationPermission(String name, String actions)
  {
    this(name, parseActions(actions));
  }
  
  ConfigurationPermission(String name, int mask)
  {
    super(name);
    setTransients(mask);
  }
  
  private void setTransients(int mask)
  {
    if ((mask == 0) || ((mask & 0x3) != mask)) {
      throw new IllegalArgumentException("invalid action string");
    }
    action_mask = mask;
    substrings = parseSubstring(getName());
  }
  
  private static int parseActions(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--;
      }
      if ((i >= 5) && ((a[(i - 5)] == 't') || (a[(i - 5)] == 'T')) && ((a[(i - 4)] == 'a') || (a[(i - 4)] == 'A')) && ((a[(i - 3)] == 'r') || (a[(i - 3)] == 'R')) && ((a[(i - 2)] == 'g') || (a[(i - 2)] == 'G')) && ((a[(i - 1)] == 'e') || (a[(i - 1)] == 'E')) && ((a[i] == 't') || (a[i] == 'T')))
      {
        int matchlen = 6;
        mask |= 0x2;
      }
      else if ((i >= 8) && ((a[(i - 8)] == 'c') || (a[(i - 8)] == 'C')) && ((a[(i - 7)] == 'o') || (a[(i - 7)] == 'O')) && ((a[(i - 6)] == 'n') || (a[(i - 6)] == 'N')) && ((a[(i - 5)] == 'f') || (a[(i - 5)] == 'F')) && ((a[(i - 4)] == 'i') || (a[(i - 4)] == 'I')) && ((a[(i - 3)] == 'g') || (a[(i - 3)] == 'G')) && ((a[(i - 2)] == 'u') || (a[(i - 2)] == 'U')) && ((a[(i - 1)] == 'r') || (a[(i - 1)] == 'R')) && ((a[i] == 'e') || (a[i] == 'E')))
      {
        int matchlen = 9;
        mask |= 0x1;
      }
      else
      {
        throw new IllegalArgumentException(new StringBuffer().append("invalid actions: ").append(actions).toString());
      }
      int matchlen;
      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(new StringBuffer().append("invalid permission: ").append(actions).toString());
        }
        i--;
      }
      i -= matchlen;
    }
    if (seencomma) {
      throw new IllegalArgumentException(new StringBuffer().append("invalid actions: ").append(actions).toString());
    }
    return mask;
  }
  
  private static List<String> parseSubstring(String name)
  {
    if (name.indexOf('*') < 0) {
      return null;
    }
    char[] chars = name.toCharArray();
    StringBuffer sb = new StringBuffer(chars.length);
    
    List<String> sub = new ArrayList(10);
    for (int pos = 0; pos < chars.length; pos++)
    {
      char c = chars[pos];
      switch (c)
      {
      case '*': 
        if (sb.length() > 0) {
          sub.add(sb.toString());
        }
        sb.setLength(0);
        sub.add(null);
        break;
      case '\\': 
        pos++;
        if (pos < chars.length) {
          c = chars[pos];
        }
        break;
      }
      sb.append(c);
    }
    if (sb.length() > 0) {
      sub.add(sb.toString());
    }
    int size = sub.size();
    if (size == 0) {
      return null;
    }
    if ((size == 1) && 
      (sub.get(0) != null)) {
      return null;
    }
    return sub;
  }
  
  public boolean implies(Permission p)
  {
    if (!(p instanceof ConfigurationPermission)) {
      return false;
    }
    ConfigurationPermission requested = (ConfigurationPermission)p;
    return implies0(requested, 0);
  }
  
  boolean implies0(ConfigurationPermission requested, int effective)
  {
    effective |= action_mask;
    int desired = action_mask;
    if ((effective & desired) != desired) {
      return false;
    }
    String requestedName = requested.getName();
    if (substrings == null) {
      return getName().equals(requestedName);
    }
    int i = 0;int pos = 0;
    for (int size = substrings.size(); i < size; i++)
    {
      String substr = (String)substrings.get(i);
      if (i + 1 < size)
      {
        if (substr == null)
        {
          String substr2 = (String)substrings.get(i + 1);
          if (substr2 != null)
          {
            int index = requestedName.indexOf(substr2, pos);
            if (index == -1) {
              return false;
            }
            pos = index + substr2.length();
            if (i + 2 < size) {
              i++;
            }
          }
        }
        else
        {
          int len = substr.length();
          if (requestedName.regionMatches(pos, substr, 0, len)) {
            pos += len;
          } else {
            return false;
          }
        }
      }
      else
      {
        if (substr == null) {
          return true;
        }
        return requestedName.endsWith(substr);
      }
    }
    return false;
  }
  
  public boolean equals(Object obj)
  {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof ConfigurationPermission)) {
      return false;
    }
    ConfigurationPermission cp = (ConfigurationPermission)obj;
    
    return (action_mask == action_mask) && (getName().equals(cp.getName()));
  }
  
  public int hashCode()
  {
    int h = 527 + getName().hashCode();
    h = 31 * h + getActions().hashCode();
    return h;
  }
  
  public String getActions()
  {
    String result = actions;
    if (result == null)
    {
      StringBuffer sb = new StringBuffer();
      boolean comma = false;
      
      int mask = action_mask;
      if ((mask & 0x1) == 1)
      {
        sb.append("configure");
        comma = true;
      }
      if ((mask & 0x2) == 2)
      {
        if (comma) {
          sb.append(',');
        }
        sb.append("target");
      }
      actions = (result = sb.toString());
    }
    return result;
  }
  
  public PermissionCollection newPermissionCollection()
  {
    return new ConfigurationPermissionCollection();
  }
  
  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();
    setTransients(parseActions(actions));
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.cm.ConfigurationPermission
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.cm;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectInputStream.GetField;
import java.io.ObjectOutputStream;
import java.io.ObjectOutputStream.PutField;
import java.io.ObjectStreamField;
import java.security.Permission;
import java.security.PermissionCollection;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

final class ConfigurationPermissionCollection
  extends PermissionCollection
{
  static final long serialVersionUID = -6917638867081695839L;
  private Map<String, ConfigurationPermission> permissions;
  private boolean all_allowed;
  
  public ConfigurationPermissionCollection()
  {
    permissions = new HashMap();
    all_allowed = false;
  }
  
  public void add(Permission permission)
  {
    if (!(permission instanceof ConfigurationPermission)) {
      throw new IllegalArgumentException(new StringBuffer().append("invalid permission: ").append(permission).toString());
    }
    if (isReadOnly()) {
      throw new SecurityException("attempt to add a Permission to a readonly PermissionCollection");
    }
    ConfigurationPermission cp = (ConfigurationPermission)permission;
    String name = cp.getName();
    synchronized (this)
    {
      Map<String, ConfigurationPermission> pc = permissions;
      ConfigurationPermission existing = (ConfigurationPermission)pc.get(name);
      if (existing != null)
      {
        int oldMask = action_mask;
        int newMask = action_mask;
        if (oldMask != newMask) {
          pc.put(name, new ConfigurationPermission(name, oldMask | newMask));
        }
      }
      else
      {
        pc.put(name, cp);
      }
      if ((!all_allowed) && 
        (name.equals("*"))) {
        all_allowed = true;
      }
    }
  }
  
  public boolean implies(Permission permission)
  {
    if (!(permission instanceof ConfigurationPermission)) {
      return false;
    }
    ConfigurationPermission requested = (ConfigurationPermission)permission;
    int effective = 0;
    Collection<ConfigurationPermission> perms;
    synchronized (this)
    {
      Map<String, ConfigurationPermission> pc = permissions;
      if (all_allowed)
      {
        ConfigurationPermission cp = (ConfigurationPermission)pc.get("*");
        if (cp != null)
        {
          effective |= action_mask;
          int desired = action_mask;
          if ((effective & desired) == desired) {
            return true;
          }
        }
      }
      perms = pc.values();
    }
    for (Iterator i$ = perms.iterator(); i$.hasNext();)
    {
      ConfigurationPermission perm = (ConfigurationPermission)i$.next();
      if (perm.implies0(requested, effective)) {
        return true;
      }
    }
    return false;
  }
  
  public synchronized Enumeration<Permission> elements()
  {
    List<Permission> all = new ArrayList(permissions.values());
    return Collections.enumeration(all);
  }
  
  private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField("hasElement", Boolean.TYPE), new ObjectStreamField("permissions", HashMap.class), new ObjectStreamField("all_allowed", Boolean.TYPE) };
  
  private synchronized void writeObject(ObjectOutputStream out)
    throws IOException
  {
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("hasElement", false);
    pfields.put("permissions", permissions);
    pfields.put("all_allowed", all_allowed);
    out.writeFields();
  }
  
  private synchronized void readObject(ObjectInputStream in)
    throws IOException, ClassNotFoundException
  {
    ObjectInputStream.GetField gfields = in.readFields();
    boolean hasElement = gfields.get("hasElement", false);
    if (hasElement)
    {
      permissions = new HashMap();
      permissions.put("*", new ConfigurationPermission("*", "configure"));
      
      all_allowed = true;
    }
    else
    {
      permissions = ((HashMap)gfields.get("permissions", new HashMap()));
      
      all_allowed = gfields.get("all_allowed", false);
    }
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.cm.ConfigurationPermissionCollection
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.cm;

import java.util.Dictionary;
import org.osgi.framework.ServiceReference;

public abstract interface ConfigurationPlugin
{
  public static final String CM_TARGET = "cm.target";
  public static final String CM_RANKING = "service.cmRanking";
  
  public abstract void modifyConfiguration(ServiceReference<?> paramServiceReference, Dictionary<String, Object> paramDictionary);
}

/* Location:
 * Qualified Name:     org.osgi.service.cm.ConfigurationPlugin
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.cm;

import java.util.Dictionary;

public abstract interface ManagedService
{
  public abstract void updated(Dictionary<String, ?> paramDictionary)
    throws ConfigurationException;
}

/* Location:
 * Qualified Name:     org.osgi.service.cm.ManagedService
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.cm;

import java.util.Dictionary;

public abstract interface ManagedServiceFactory
{
  public abstract String getName();
  
  public abstract void updated(String paramString, Dictionary<String, ?> paramDictionary)
    throws ConfigurationException;
  
  public abstract void deleted(String paramString);
}

/* Location:
 * Qualified Name:     org.osgi.service.cm.ManagedServiceFactory
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component;

public abstract interface ComponentConstants
{
  public static final String SERVICE_COMPONENT = "Service-Component";
  public static final String COMPONENT_NAME = "component.name";
  public static final String COMPONENT_ID = "component.id";
  public static final String COMPONENT_FACTORY = "component.factory";
  public static final String REFERENCE_TARGET_SUFFIX = ".target";
  public static final int DEACTIVATION_REASON_UNSPECIFIED = 0;
  public static final int DEACTIVATION_REASON_DISABLED = 1;
  public static final int DEACTIVATION_REASON_REFERENCE = 2;
  public static final int DEACTIVATION_REASON_CONFIGURATION_MODIFIED = 3;
  public static final int DEACTIVATION_REASON_CONFIGURATION_DELETED = 4;
  public static final int DEACTIVATION_REASON_DISPOSED = 5;
  public static final int DEACTIVATION_REASON_BUNDLE_STOPPED = 6;
}

/* Location:
 * Qualified Name:     org.osgi.service.component.ComponentConstants
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component;

import java.util.Dictionary;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;

public abstract interface ComponentContext
{
  public abstract Dictionary getProperties();
  
  public abstract Object locateService(String paramString);
  
  public abstract Object locateService(String paramString, ServiceReference paramServiceReference);
  
  public abstract Object[] locateServices(String paramString);
  
  public abstract BundleContext getBundleContext();
  
  public abstract Bundle getUsingBundle();
  
  public abstract ComponentInstance getComponentInstance();
  
  public abstract void enableComponent(String paramString);
  
  public abstract void disableComponent(String paramString);
  
  public abstract ServiceReference getServiceReference();
}

/* Location:
 * Qualified Name:     org.osgi.service.component.ComponentContext
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component;

public class ComponentException
  extends RuntimeException
{
  static final long serialVersionUID = -7438212656298726924L;
  
  public ComponentException(String message, Throwable cause)
  {
    super(message, cause);
  }
  
  public ComponentException(String message)
  {
    super(message);
  }
  
  public ComponentException(Throwable cause)
  {
    super(cause);
  }
  
  public Throwable getCause()
  {
    return super.getCause();
  }
  
  public Throwable initCause(Throwable cause)
  {
    return super.initCause(cause);
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.component.ComponentException
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component;

import java.util.Dictionary;

public abstract interface ComponentFactory
{
  public abstract ComponentInstance newInstance(Dictionary paramDictionary);
}

/* Location:
 * Qualified Name:     org.osgi.service.component.ComponentFactory
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component;

public abstract interface ComponentInstance
{
  public abstract void dispose();
  
  public abstract Object getInstance();
}

/* Location:
 * Qualified Name:     org.osgi.service.component.ComponentInstance
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component.annotations;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.CLASS)
@Target({java.lang.annotation.ElementType.METHOD})
public @interface Activate {}

/* Location:
 * Qualified Name:     org.osgi.service.component.annotations.Activate
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component.annotations;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.CLASS)
@Target({java.lang.annotation.ElementType.TYPE})
public @interface Component
{
  String name() default "";
  
  Class<?>[] service() default {};
  
  String factory() default "";
  
  boolean servicefactory() default false;
  
  boolean enabled() default true;
  
  boolean immediate() default false;
  
  String[] property() default {};
  
  String[] properties() default {};
  
  String xmlns() default "";
  
  ConfigurationPolicy configurationPolicy() default ConfigurationPolicy.OPTIONAL;
  
  String configurationPid() default "";
}

/* Location:
 * Qualified Name:     org.osgi.service.component.annotations.Component
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component.annotations;

public enum ConfigurationPolicy
{
  OPTIONAL("optional"),  REQUIRE("require"),  IGNORE("ignore");
  
  private final String value;
  
  private ConfigurationPolicy(String value)
  {
    this.value = value;
  }
  
  public String toString()
  {
    return value;
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.component.annotations.ConfigurationPolicy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component.annotations;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.CLASS)
@Target({java.lang.annotation.ElementType.METHOD})
public @interface Deactivate {}

/* Location:
 * Qualified Name:     org.osgi.service.component.annotations.Deactivate
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component.annotations;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.CLASS)
@Target({java.lang.annotation.ElementType.METHOD})
public @interface Modified {}

/* Location:
 * Qualified Name:     org.osgi.service.component.annotations.Modified
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component.annotations;

import java.lang.annotation.Annotation;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.CLASS)
@Target({java.lang.annotation.ElementType.METHOD})
public @interface Reference
{
  String name() default "";
  
  Class<?> service() default Object.class;
  
  ReferenceCardinality cardinality() default ReferenceCardinality.MANDATORY;
  
  ReferencePolicy policy() default ReferencePolicy.STATIC;
  
  String target() default "";
  
  String unbind() default "";
  
  ReferencePolicyOption policyOption() default ReferencePolicyOption.RELUCTANT;
  
  String updated() default "";
}

/* Location:
 * Qualified Name:     org.osgi.service.component.annotations.Reference
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component.annotations;

public enum ReferenceCardinality
{
  OPTIONAL("0..1"),  MANDATORY("1..1"),  MULTIPLE("0..n"),  AT_LEAST_ONE("1..n");
  
  private final String value;
  
  private ReferenceCardinality(String value)
  {
    this.value = value;
  }
  
  public String toString()
  {
    return value;
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.component.annotations.ReferenceCardinality
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component.annotations;

public enum ReferencePolicy
{
  STATIC("static"),  DYNAMIC("dynamic");
  
  private final String value;
  
  private ReferencePolicy(String value)
  {
    this.value = value;
  }
  
  public String toString()
  {
    return value;
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.component.annotations.ReferencePolicy
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.component.annotations;

public enum ReferencePolicyOption
{
  RELUCTANT("reluctant"),  GREEDY("greedy");
  
  private final String value;
  
  private ReferencePolicyOption(String value)
  {
    this.value = value;
  }
  
  public String toString()
  {
    return value;
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.component.annotations.ReferencePolicyOption
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.device;

public abstract interface Constants
{
  public static final String DRIVER_ID = "DRIVER_ID";
  public static final String DEVICE_CATEGORY = "DEVICE_CATEGORY";
  public static final String DEVICE_SERIAL = "DEVICE_SERIAL";
  public static final String DEVICE_DESCRIPTION = "DEVICE_DESCRIPTION";
}

/* Location:
 * Qualified Name:     org.osgi.service.device.Constants
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.device;

public abstract interface Device
{
  public static final int MATCH_NONE = 0;
  
  public abstract void noDriverFound();
}

/* Location:
 * Qualified Name:     org.osgi.service.device.Device
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.device;

import org.osgi.framework.ServiceReference;

public abstract interface Driver
{
  public abstract int match(ServiceReference paramServiceReference)
    throws Exception;
  
  public abstract String attach(ServiceReference paramServiceReference)
    throws Exception;
}

/* Location:
 * Qualified Name:     org.osgi.service.device.Driver
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.device;

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

public abstract interface DriverLocator
{
  public abstract String[] findDrivers(Dictionary paramDictionary);
  
  public abstract InputStream loadDriver(String paramString)
    throws IOException;
}

/* Location:
 * Qualified Name:     org.osgi.service.device.DriverLocator
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.device;

import org.osgi.framework.ServiceReference;

public abstract interface DriverSelector
{
  public static final int SELECT_NONE = -1;
  
  public abstract int select(ServiceReference paramServiceReference, Match[] paramArrayOfMatch);
}

/* Location:
 * Qualified Name:     org.osgi.service.device.DriverSelector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.device;

import org.osgi.framework.ServiceReference;

public abstract interface Match
{
  public abstract ServiceReference getDriver();
  
  public abstract int getMatchValue();
}

/* Location:
 * Qualified Name:     org.osgi.service.device.Match
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.event;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.List;

final class Event$FilterProperties
  extends Dictionary<String, Object>
{
  private final String topic;
  private final EventProperties properties;
  
  public Object put(Object x0, Object x1)
  {
    return put((String)x0, x1);
  }
  
  Event$FilterProperties(String topic, EventProperties properties)
  {
    this.topic = topic;
    this.properties = properties;
  }
  
  public Enumeration<Object> elements()
  {
    Collection<Object> values = properties.values();
    List<Object> result = new ArrayList(values.size() + 1);
    result.add(topic);
    result.addAll(values);
    return Collections.enumeration(result);
  }
  
  public Object get(Object key)
  {
    if ("event.topics".equals(key)) {
      return topic;
    }
    return properties.get(key);
  }
  
  public boolean isEmpty()
  {
    return false;
  }
  
  public Enumeration<String> keys()
  {
    Collection<String> keys = properties.keySet();
    List<String> result = new ArrayList(keys.size() + 1);
    result.add("event.topics");
    result.addAll(keys);
    return Collections.enumeration(result);
  }
  
  public Object put(String key, Object value)
  {
    throw new UnsupportedOperationException();
  }
  
  public Object remove(Object key)
  {
    throw new UnsupportedOperationException();
  }
  
  public int size()
  {
    return properties.size() + 1;
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.event.Event.FilterProperties
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.event;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.osgi.framework.Filter;

public class Event
{
  private final String topic;
  private final EventProperties properties;
  
  public Event(String topic, Map<String, ?> properties)
  {
    validateTopicName(topic);
    this.topic = topic;
    
    this.properties = ((properties instanceof EventProperties) ? (EventProperties)properties : new EventProperties(properties));
  }
  
  public Event(String topic, Dictionary<String, ?> properties)
  {
    validateTopicName(topic);
    this.topic = topic;
    
    this.properties = new EventProperties(properties);
  }
  
  public final Object getProperty(String name)
  {
    if ("event.topics".equals(name)) {
      return topic;
    }
    return properties.get(name);
  }
  
  public final boolean containsProperty(String name)
  {
    if ("event.topics".equals(name)) {
      return true;
    }
    return properties.containsKey(name);
  }
  
  public final String[] getPropertyNames()
  {
    int size = properties.size();
    String[] result = new String[size + 1];
    properties.keySet().toArray(result);
    result[size] = "event.topics";
    return result;
  }
  
  public final String getTopic()
  {
    return topic;
  }
  
  public final boolean matches(Filter filter)
  {
    return filter.matchCase(new FilterProperties(topic, properties));
  }
  
  public boolean equals(Object object)
  {
    if (object == this) {
      return true;
    }
    if (!(object instanceof Event)) {
      return false;
    }
    Event event = (Event)object;
    return (topic.equals(topic)) && (properties.equals(properties));
  }
  
  public int hashCode()
  {
    int h = 527 + topic.hashCode();
    h = 31 * h + properties.hashCode();
    return h;
  }
  
  public String toString()
  {
    return new StringBuffer().append(getClass().getName()).append(" [topic=").append(topic).append("]").toString();
  }
  
  private static void validateTopicName(String topic)
  {
    char[] chars = topic.toCharArray();
    int length = chars.length;
    if (length == 0) {
      throw new IllegalArgumentException("empty topic");
    }
    for (int i = 0; i < length; i++)
    {
      char ch = chars[i];
      if (ch == '/')
      {
        if ((i == 0) || (i == length - 1)) {
          throw new IllegalArgumentException(new StringBuffer().append("invalid topic: ").append(topic).toString());
        }
        if (chars[(i - 1)] == '/') {
          throw new IllegalArgumentException(new StringBuffer().append("invalid topic: ").append(topic).toString());
        }
      }
      else if (('A' > ch) || (ch > 'Z'))
      {
        if (('a' > ch) || (ch > 'z')) {
          if (('0' > ch) || (ch > '9')) {
            if ((ch != '_') && (ch != '-')) {
              throw new IllegalArgumentException(new StringBuffer().append("invalid topic: ").append(topic).toString());
            }
          }
        }
      }
    }
  }
  
  private static final class FilterProperties
    extends Dictionary<String, Object>
  {
    private final String topic;
    private final EventProperties properties;
    
    public Object put(Object x0, Object x1)
    {
      return put((String)x0, x1);
    }
    
    FilterProperties(String topic, EventProperties properties)
    {
      this.topic = topic;
      this.properties = properties;
    }
    
    public Enumeration<Object> elements()
    {
      Collection<Object> values = properties.values();
      List<Object> result = new ArrayList(values.size() + 1);
      result.add(topic);
      result.addAll(values);
      return Collections.enumeration(result);
    }
    
    public Object get(Object key)
    {
      if ("event.topics".equals(key)) {
        return topic;
      }
      return properties.get(key);
    }
    
    public boolean isEmpty()
    {
      return false;
    }
    
    public Enumeration<String> keys()
    {
      Collection<String> keys = properties.keySet();
      List<String> result = new ArrayList(keys.size() + 1);
      result.add("event.topics");
      result.addAll(keys);
      return Collections.enumeration(result);
    }
    
    public Object put(String key, Object value)
    {
      throw new UnsupportedOperationException();
    }
    
    public Object remove(Object key)
    {
      throw new UnsupportedOperationException();
    }
    
    public int size()
    {
      return properties.size() + 1;
    }
  }
}

/* Location:
 * Qualified Name:     org.osgi.service.event.Event
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.event;

public abstract interface EventAdmin
{
  public abstract void postEvent(Event paramEvent);
  
  public abstract void sendEvent(Event paramEvent);
}

/* Location:
 * Qualified Name:     org.osgi.service.event.EventAdmin
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.event;

public abstract interface EventConstants
{
  public static final String EVENT_TOPIC = "event.topics";
  public static final String EVENT_FILTER = "event.filter";
  public static final String EVENT_DELIVERY = "event.delivery";
  public static final String DELIVERY_ASYNC_ORDERED = "async.ordered";
  public static final String DELIVERY_ASYNC_UNORDERED = "async.unordered";
  public static final String BUNDLE_SIGNER = "bundle.signer";
  public static final String BUNDLE_SYMBOLICNAME = "bundle.symbolicName";
  public static final String BUNDLE_ID = "bundle.id";
  public static final String BUNDLE = "bundle";
  public static final String BUNDLE_VERSION = "bundle.version";
  public static final String EVENT = "event";
  public static final String EXCEPTION = "exception";
  public static final String EXCEPTION_CLASS = "exception.class";
  public static final String EXCEPTION_MESSAGE = "exception.message";
  public static final String MESSAGE = "message";
  public static final String SERVICE = "service";
  public static final String SERVICE_ID = "service.id";
  public static final String SERVICE_OBJECTCLASS = "service.objectClass";
  public static final String SERVICE_PID = "service.pid";
  public static final String TIMESTAMP = "timestamp";
  /**
   * @deprecated
   */
  public static final String EXECPTION_CLASS = "exception.class";
}

/* Location:
 * Qualified Name:     org.osgi.service.event.EventConstants
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.event;

public abstract interface EventHandler
{
  public abstract void handleEvent(Event paramEvent);
}

/* Location:
 * Qualified Name:     org.osgi.service.event.EventHandler
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.event;

import java.util.Collection;
import java.util.Collections;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class EventProperties
  implements Map<String, Object>
{
  private final Map<String, Object> properties;
  
  public Object put(Object x0, Object x1)
  {
    return put((String)x0, x1);
  }
  
  public EventProperties(Map<String, ?> properties)
  {
    int size = properties == null ? 0 : properties.size();
    Map<String, Object> p = new HashMap(size);
    Iterator i$;
    if (size > 0) {
      for (i$ = properties.keySet().iterator(); i$.hasNext();)
      {
        Object key = i$.next();
        if (((key instanceof String)) && (!"event.topics".equals(key)))
        {
          Object value = properties.get(key);
          p.put((String)key, value);
        }
      }
    }
    this.properties = Collections.unmodifiableMap(p);
  }
  
  EventProperties(Dictionary<String, ?> properties)
  {
    int size = properties == null ? 0 : properties.size();
    Map<String, Object> p = new HashMap(size);
    Enumeration<?> e;
    if (size > 0) {
      for (e = properties.keys(); e.hasMoreElements();)
      {
        Object key = e.nextElement();
        if (((key instanceof String)) && (!"event.topics".equals(key)))
        {
          Object value = properties.get(key);
          p.put((String)key, value);
        }
      }
    }
    this.properties = Collections.unmodifiableMap(p);
  }
  
  public void clear()
  {
    properties.clear();
  }
  
  public boolean containsKey(Object name)
  {
    return properties.containsKey(name);
  }
  
  public boolean containsValue(Object value)
  {
    return properties.containsValue(value);
  }
  
  public Set<Map.Entry<String, Object>> entrySet()
  {
    return properties.entrySet();
  }
  
  public Object get(Object name)
  {
    return properties.get(name);
  }
  
  public boolean isEmpty()
  {
    return properties.isEmpty();
  }
  
  public Set<String> keySet()
  {
    return properties.keySet();
  }
  
  public Object put(String key, Object value)
  {
    return properties.put(key, value);
  }
  
  public void putAll(Map<? extends String, ? extends Object> map)
  {
    properties.putAll(map);
  }
  
  public Object remove(Object key)
  {
    return properties.remove(key);
  }
  
  public int size()
  {
    return properties.size();
  }
  
  public Collection<Object> values()
  {
    return properties.values();
  }
  
  public boolean equals(Object object)
  {
    if (this == object) {
      return true;
    }
    if (!(object instanceof EventProperties)) {
      return false;
    }
    EventProperties other = (EventProperties)object;
1 2 3

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