org.eclipse.osgi.services_3.3.0.v20110513

16:47:14.425 INFO  jd.cli.Main - Decompiling org.eclipse.osgi.services_3.3.0.v20110513.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 getProperties();
  
  public abstract void update(Dictionary 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;
  private final int type;
  private final String factoryPid;
  private final String pid;
  private final ServiceReference reference;
  
  public ConfigurationEvent(ServiceReference 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 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.security.BasicPermission;
import java.security.Permission;
import java.security.PermissionCollection;

public final class ConfigurationPermission
  extends BasicPermission
{
  static final long serialVersionUID = 5716868734811965383L;
  public static final String CONFIGURE = "configure";
  
  public ConfigurationPermission(String name, String actions)
  {
    super(name);
    if (!name.equals("*")) {
      throw new IllegalArgumentException("name must be *");
    }
    actions = actions.trim();
    if ((actions.equalsIgnoreCase("configure")) || (actions.equals("*"))) {
      return;
    }
    throw new IllegalArgumentException("actions must be configure");
  }
  
  public boolean implies(Permission p)
  {
    return p instanceof ConfigurationPermission;
  }
  
  public boolean equals(Object obj)
  {
    return obj instanceof ConfigurationPermission;
  }
  
  public int hashCode()
  {
    int h = 527 + getName().hashCode();
    h = 31 * h + getActions().hashCode();
    return h;
  }
  
  public String getActions()
  {
    return "configure";
  }
  
  public PermissionCollection newPermissionCollection()
  {
    return new ConfigurationPermissionCollection();
  }
}

/* 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.util.Enumeration;
import java.util.NoSuchElementException;

class ConfigurationPermissionCollection$1
  implements Enumeration
{
  private boolean more = val$nonEmpty;
  private final ConfigurationPermissionCollection this$0;
  
  ConfigurationPermissionCollection$1(ConfigurationPermissionCollection paramConfigurationPermissionCollection, boolean paramBoolean) {}
  
  public boolean hasMoreElements()
  {
    return more;
  }
  
  public Object nextElement()
  {
    if (more)
    {
      more = false;
      
      return new ConfigurationPermission("*", "configure");
    }
    throw new NoSuchElementException();
  }
}

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

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

final class ConfigurationPermissionCollection
  extends PermissionCollection
{
  static final long serialVersionUID = -6917638867081695839L;
  private volatile boolean hasElement;
  
  public ConfigurationPermissionCollection()
  {
    hasElement = 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");
    }
    hasElement = true;
  }
  
  public boolean implies(Permission p)
  {
    return (hasElement) && ((p instanceof ConfigurationPermission));
  }
  
  public Enumeration elements()
  {
    final boolean nonEmpty = hasElement;
    new Enumeration()
    {
      private boolean more = nonEmpty;
      
      public boolean hasMoreElements()
      {
        return more;
      }
      
      public Object nextElement()
      {
        if (more)
        {
          more = false;
          
          return new ConfigurationPermission("*", "configure");
        }
        throw new NoSuchElementException();
      }
    };
  }
}

/* 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 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 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 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.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;
    return properties.equals(properties);
  }
  
  public int hashCode()
  {
    return properties.hashCode();
  }
  
  public String toString()
  {
    return properties.toString();
  }
}

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

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

public final class TopicPermission
  extends Permission
{
  static final long serialVersionUID = -5855563886961618300L;
  public static final String PUBLISH = "publish";
  public static final String SUBSCRIBE = "subscribe";
  private static final int ACTION_PUBLISH = 1;
  private static final int ACTION_SUBSCRIBE = 2;
  private static final int ACTION_ALL = 3;
  private static final int ACTION_NONE = 0;
  private transient int action_mask;
  private volatile transient String prefix;
  private volatile String actions = null;
  
  public TopicPermission(String name, String actions)
  {
    this(name, parseActions(actions));
  }
  
  TopicPermission(String name, int mask)
  {
    super(name);
    setTransients(mask);
  }
  
  private synchronized void setTransients(int mask)
  {
    String name = getName();
    if ((name == null) || (name.length() == 0)) {
      throw new IllegalArgumentException("invalid name");
    }
    if ((mask == 0) || ((mask & 0x3) != mask)) {
      throw new IllegalArgumentException("invalid action string");
    }
    action_mask = mask;
    if (name.equals("*")) {
      prefix = "";
    } else if (name.endsWith("/*")) {
      prefix = name.substring(0, name.length() - 1);
    } else {
      prefix = null;
    }
  }
  
  synchronized int getActionsMask()
  {
    return action_mask;
  }
  
  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 >= 8) && ((a[(i - 8)] == 's') || (a[(i - 8)] == 'S')) && ((a[(i - 7)] == 'u') || (a[(i - 7)] == 'U')) && ((a[(i - 6)] == 'b') || (a[(i - 6)] == 'B')) && ((a[(i - 5)] == 's') || (a[(i - 5)] == 'S')) && ((a[(i - 4)] == 'c') || (a[(i - 4)] == 'C')) && ((a[(i - 3)] == 'r') || (a[(i - 3)] == 'R')) && ((a[(i - 2)] == 'i') || (a[(i - 2)] == 'I')) && ((a[(i - 1)] == 'b') || (a[(i - 1)] == 'B')) && ((a[i] == 'e') || (a[i] == 'E')))
      {
        int matchlen = 9;
        mask |= 0x2;
      }
      else if ((i >= 6) && ((a[(i - 6)] == 'p') || (a[(i - 6)] == 'P')) && ((a[(i - 5)] == 'u') || (a[(i - 5)] == 'U')) && ((a[(i - 4)] == 'b') || (a[(i - 4)] == 'B')) && ((a[(i - 3)] == 'l') || (a[(i - 3)] == 'L')) && ((a[(i - 2)] == 'i') || (a[(i - 2)] == 'I')) && ((a[(i - 1)] == 's') || (a[(i - 1)] == 'S')) && ((a[i] == 'h') || (a[i] == 'H')))
      {
        int matchlen = 7;
        mask |= 0x1;
      }
      else
      {
        throw new IllegalArgumentException(new StringBuffer().append("invalid permission: ").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 permission: ").append(actions).toString());
    }
    return mask;
  }
  
  public boolean implies(Permission p)
  {
    if ((p instanceof TopicPermission))
    {
      TopicPermission requested = (TopicPermission)p;
      int requestedMask = requested.getActionsMask();
      if ((getActionsMask() & requestedMask) == requestedMask)
      {
        String requestedName = requested.getName();
        String pre = prefix;
        if (pre != null) {
          return requestedName.startsWith(pre);
        }
        return requestedName.equals(getName());
      }
    }
    return false;
  }
  
  public String getActions()
  {
    String result = actions;
    if (result == null)
    {
      StringBuffer sb = new StringBuffer();
      boolean comma = false;
      int mask = getActionsMask();
      if ((mask & 0x1) == 1)
      {
        sb.append("publish");
        comma = true;
      }
      if ((mask & 0x2) == 2)
      {
        if (comma) {
          sb.append(',');
        }
        sb.append("subscribe");
      }
      actions = (result = sb.toString());
    }
    return result;
  }
  
  public PermissionCollection newPermissionCollection()
  {
    return new TopicPermissionCollection();
  }
  
  public boolean equals(Object obj)
  {
    if (obj == this) {
      return true;
    }
    if (!(obj instanceof TopicPermission)) {
      return false;
    }
    TopicPermission tp = (TopicPermission)obj;
    return (getActionsMask() == tp.getActionsMask()) && (getName().equals(tp.getName()));
  }
  
  public int hashCode()
  {
    int h = 527 + getName().hashCode();
    h = 31 * h + getActions().hashCode();
    return h;
  }
  
  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.event.TopicPermission
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.osgi.service.event;

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.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;

final class TopicPermissionCollection
  extends PermissionCollection
{
  static final long serialVersionUID = -614647783533924048L;
  private transient Map<String, TopicPermission> permissions;
  private boolean all_allowed;
  
  public TopicPermissionCollection()
  {
    permissions = new HashMap();
    all_allowed = false;
  }
  
  public void add(Permission permission)
  {
    if (!(permission instanceof TopicPermission)) {
      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");
    }
    TopicPermission tp = (TopicPermission)permission;
    String name = tp.getName();
    int newMask = tp.getActionsMask();
    synchronized (this)
    {
      TopicPermission existing = (TopicPermission)permissions.get(name);
      if (existing != null)
      {
        int oldMask = existing.getActionsMask();
        if (oldMask != newMask) {
          permissions.put(name, new TopicPermission(name, oldMask | newMask));
        }
      }
      else
      {
        permissions.put(name, tp);
      }
      if ((!all_allowed) && 
        (name.equals("*"))) {
        all_allowed = true;
      }
    }
  }
  
  public boolean implies(Permission permission)
  {
    if (!(permission instanceof TopicPermission)) {
      return false;
    }
    TopicPermission requested = (TopicPermission)permission;
    String name = requested.getName();
    int desired = requested.getActionsMask();
    int effective = 0;
    TopicPermission x;
    synchronized (this)
    {
      if (all_allowed)
      {
        TopicPermission x = (TopicPermission)permissions.get("*");
        if (x != null)
        {
          effective |= x.getActionsMask();
          if ((effective & desired) == desired) {
            return true;
          }
        }
      }
      x = (TopicPermission)permissions.get(name);
    }
    if (x != null)
    {
      effective |= x.getActionsMask();
      if ((effective & desired) == desired) {
        return true;
      }
    }
    int offset = name.length() - 1;
    int last;
    while ((last = name.lastIndexOf("/", offset)) != -1)
    {
      name = new StringBuffer().append(name.substring(0, last + 1)).append("*").toString();
      synchronized (this)
      {
        x = (TopicPermission)permissions.get(name);
      }
      if (x != null)
      {
        effective |= x.getActionsMask();
        if ((effective & desired) == desired) {
          return true;
        }
      }
      offset = last - 1;
    }
    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("permissions", Hashtable.class), new ObjectStreamField("all_allowed", Boolean.TYPE) };
  
  private synchronized void writeObject(ObjectOutputStream out)
    throws IOException
  {
    Hashtable<String, TopicPermission> hashtable = new Hashtable(permissions);
    
    ObjectOutputStream.PutField pfields = out.putFields();
    pfields.put("permissions", hashtable);
    pfields.put("all_allowed", all_allowed);
    out.writeFields();
  }
  
  private synchronized void readObject(ObjectInputStream in)
    throws IOException, ClassNotFoundException
  {
    ObjectInputStream.GetField gfields = in.readFields();
    Hashtable<String, TopicPermission> hashtable = (Hashtable)gfields.get("permissions", null);
    
    permissions = new HashMap(hashtable);
    all_allowed = gfields.get("all_allowed", false);
  }
}

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

import java.io.IOException;
import java.net.URL;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public abstract interface HttpContext
{
  public static final String REMOTE_USER = "org.osgi.service.http.authentication.remote.user";
  public static final String AUTHENTICATION_TYPE = "org.osgi.service.http.authentication.type";
  public static final String AUTHORIZATION = "org.osgi.service.useradmin.authorization";
  
  public abstract boolean handleSecurity(HttpServletRequest paramHttpServletRequest, HttpServletResponse paramHttpServletResponse)
    throws IOException;
  
  public abstract URL getResource(String paramString);
  
  public abstract String getMimeType(String paramString);
}

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

import java.util.Dictionary;
import javax.servlet.Servlet;
import javax.servlet.ServletException;

public abstract interface HttpService
{
  public abstract void registerServlet(String paramString, Servlet paramServlet, Dictionary paramDictionary, HttpContext paramHttpContext)
    throws ServletException, NamespaceException;
  
  public abstract void registerResources(String paramString1, String paramString2, HttpContext paramHttpContext)
    throws NamespaceException;
  
  public abstract void unregister(String paramString);
  
  public abstract HttpContext createDefaultHttpContext();
}

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

public class NamespaceException
  extends Exception
{
  static final long serialVersionUID = 7235606031147877747L;
  
  public NamespaceException(String message)
  {
    super(message);
  }
  
  public NamespaceException(String message, Throwable cause)
  {
    super(message, cause);
  }
  
  public Throwable getException()
  {
    return getCause();
  }
  
  public Throwable getCause()
  {
    return super.getCause();
  }
  
  public Throwable initCause(Throwable cause)
  {
    return super.initCause(cause);
  }
}

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

import java.io.IOException;
import javax.microedition.io.Connection;

public abstract interface ConnectionFactory
{
  public static final String IO_SCHEME = "io.scheme";
  
  public abstract Connection createConnection(String paramString, int paramInt, boolean paramBoolean)
    throws IOException;
}

/* Location:
 * Qualified Name:     org.osgi.service.io.Con
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