felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1096719 [2/2] - in /felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm: ./ impl/ impl/dependencies/ impl/metatype/ index/ tracker/
Date Tue, 26 Apr 2011 10:47:13 GMT
Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/ObjectClassDefinitionImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/ObjectClassDefinitionImpl.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/ObjectClassDefinitionImpl.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/ObjectClassDefinitionImpl.java
Tue Apr 26 10:47:12 2011
@@ -28,9 +28,10 @@ import org.osgi.service.metatype.ObjectC
 
 /**
  * ObjectClassDefinition implementation.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-public class ObjectClassDefinitionImpl implements ObjectClassDefinition
-{
+public class ObjectClassDefinitionImpl implements ObjectClassDefinition {
     // Our OCD name (may be localized)
     private String m_name;
     
@@ -46,8 +47,7 @@ public class ObjectClassDefinitionImpl i
     // The localized resource that can be used when localizing some parameters
     private Resource m_resource;
 
-    public ObjectClassDefinitionImpl(String id, String name, String description, List propertiesMetaData,
Resource resource)
-    {
+    public ObjectClassDefinitionImpl(String id, String name, String description, List propertiesMetaData,
Resource resource) {
         m_id = id;
         m_name = name;
         m_description = description;
@@ -57,26 +57,21 @@ public class ObjectClassDefinitionImpl i
 
     // --------------------- ObjectClassDefinition ----------------------------------------
 
-    public AttributeDefinition[] getAttributeDefinitions(int filter)
-    {
+    public AttributeDefinition[] getAttributeDefinitions(int filter) {
         List attrs = new ArrayList();
-        for (int i = 0; i < m_propertiesMetaData.size(); i++)
-        {
+        for (int i = 0; i < m_propertiesMetaData.size(); i++) {
             PropertyMetaDataImpl metaData = (PropertyMetaDataImpl) m_propertiesMetaData.get(i);
-            switch (filter)
-            {
+            switch (filter) {
                 case ObjectClassDefinition.ALL:
                     attrs.add(new AttributeDefinitionImpl(metaData, m_resource));
                     break;
                 case ObjectClassDefinition.OPTIONAL:
-                    if (!metaData.isRequired())
-                    {
+                    if (!metaData.isRequired()) {
                         attrs.add(new AttributeDefinitionImpl(metaData, m_resource));
                     }
                     break;
                 case ObjectClassDefinition.REQUIRED:
-                    if (metaData.isRequired())
-                    {
+                    if (metaData.isRequired()) {
                         attrs.add(new AttributeDefinitionImpl(metaData, m_resource));
                     }
                     break;
@@ -87,24 +82,20 @@ public class ObjectClassDefinitionImpl i
         return (AttributeDefinition[]) attrs.toArray(array);
     }
 
-    public String getDescription()
-    {
+    public String getDescription() {
         return m_resource.localize(m_description);
     }
 
-    public String getID()
-    {
+    public String getID() {
         return m_id;
     }
 
-    public InputStream getIcon(int size) throws IOException
-    {
+    public InputStream getIcon(int size) throws IOException {
         // TODO Auto-generated method stub
         return null;
     }
 
-    public String getName()
-    {
+    public String getName() {
         return m_resource.localize(m_name);
     }
 }

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/PropertyMetaDataImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/PropertyMetaDataImpl.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/PropertyMetaDataImpl.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/PropertyMetaDataImpl.java
Tue Apr 26 10:47:12 2011
@@ -29,9 +29,10 @@ import org.osgi.service.metatype.Attribu
 /**
  * DependencyManager PropertyMetaData Implementation. This class describes meta informations
regarding
  * one given configuration property.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-public class PropertyMetaDataImpl implements PropertyMetaData
-{
+public class PropertyMetaDataImpl implements PropertyMetaData {
     /**
      * List of option labels (may be localized)
      */
@@ -83,68 +84,56 @@ public class PropertyMetaDataImpl implem
      * Mapping between java types and valid MetaType types.
      * @see {@link AttributeDefinition#getType()}
      */
-    private final static Map m_typeMapping = new HashMap()
-    {
-        {
-            put(Boolean.class, new Integer(AttributeDefinition.BOOLEAN));
-            put(Byte.class, new Integer(AttributeDefinition.BYTE));
-            put(Character.class, new Integer(AttributeDefinition.CHARACTER));
-            put(Double.class, new Integer(AttributeDefinition.FLOAT));
-            put(Integer.class, new Integer(AttributeDefinition.INTEGER));
-            put(Long.class, new Integer(AttributeDefinition.LONG));
-            put(Short.class, new Integer(AttributeDefinition.SHORT));
-            put(String.class, new Integer(AttributeDefinition.STRING));
-        }
-    };
+    private final static Map m_typeMapping = new HashMap() {{
+        put(Boolean.class, new Integer(AttributeDefinition.BOOLEAN));
+        put(Byte.class, new Integer(AttributeDefinition.BYTE));
+        put(Character.class, new Integer(AttributeDefinition.CHARACTER));
+        put(Double.class, new Integer(AttributeDefinition.FLOAT));
+        put(Integer.class, new Integer(AttributeDefinition.INTEGER));
+        put(Long.class, new Integer(AttributeDefinition.LONG));
+        put(Short.class, new Integer(AttributeDefinition.SHORT));
+        put(String.class, new Integer(AttributeDefinition.STRING));
+    }};
 
-    public PropertyMetaData addOption(String optionLabel, String optionValue)
-    {
+    public PropertyMetaData addOption(String optionLabel, String optionValue) {
         m_optionsLabels.add(optionLabel);
         m_optionsValues.add(optionValue);
         return this;
     }
 
-    public PropertyMetaData setCardinality(int cardinality)
-    {
+    public PropertyMetaData setCardinality(int cardinality) {
         m_cardinality = cardinality;
         return this;
     }
 
-    public PropertyMetaData setDefaults(String[] defaults)
-    {
+    public PropertyMetaData setDefaults(String[] defaults) {
         m_defaults = defaults;
         return this;
     }
 
-    public PropertyMetaData setDescription(String description)
-    {
+    public PropertyMetaData setDescription(String description) {
         m_description = description;
         return this;
     }
 
-    public PropertyMetaData setHeading(String heading)
-    {
+    public PropertyMetaData setHeading(String heading) {
         m_heading = heading;
         return this;
     }
 
-    public PropertyMetaData setId(String id)
-    {
+    public PropertyMetaData setId(String id) {
         m_id = id;
         return this;
     }
 
-    public PropertyMetaData setRequired(boolean required)
-    {
+    public PropertyMetaData setRequired(boolean required) {
         m_required = required;
         return this;
     }
 
-    public PropertyMetaData setType(Class classType)
-    {
+    public PropertyMetaData setType(Class classType) {
         Integer type = (Integer) m_typeMapping.get(classType);
-        if (type == null)
-        {
+        if (type == null) {
             throw new IllegalArgumentException("Invalid type: " + classType + ". Valid types
are "
                 + m_typeMapping.keySet());
         }
@@ -152,50 +141,41 @@ public class PropertyMetaDataImpl implem
         return this;
     }
 
-    public String[] getOptionLabels()
-    {
+    public String[] getOptionLabels() {
         String[] optionLabels = new String[m_optionsLabels.size()];
         return (String[]) m_optionsLabels.toArray(optionLabels);
     }
 
-    public String[] getOptionValues()
-    {
+    public String[] getOptionValues() {
         String[] optionValues = new String[m_optionsValues.size()];
         return (String[]) m_optionsValues.toArray(optionValues);
     }
 
-    public int getCardinality()
-    {
+    public int getCardinality() {
         return m_cardinality;
     }
 
-    public String[] getDefaults()
-    {
+    public String[] getDefaults() {
         return m_defaults;
     }
 
-    public String getDescription()
-    {
+    public String getDescription() {
         return m_description;
     }
 
-    public String getHeading()
-    {
+    public String getHeading() {
         return m_heading;
     }
 
-    public String getId()
-    {
+    public String getId() {
         return m_id;
     }
 
-    public boolean isRequired()
-    {
+    public boolean isRequired() {
         return m_required;
     }
 
-    public int getType()
-    {
+    public int getType() {
         return m_type;
     }
     

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/Resource.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/Resource.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/Resource.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/impl/metatype/Resource.java
Tue Apr 26 10:47:12 2011
@@ -22,19 +22,18 @@ import java.util.Properties;
 
 /**
  * Helper class used to localize a given Property Meta Data.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
-public class Resource
-{
+public class Resource {
     private Properties m_properties;
 
     public Resource(Properties properties) {
         m_properties = properties;
     }
     
-    public String localize(String param)
-    {
-        if (m_properties != null && param != null && param.startsWith("%"))
-        {
+    public String localize(String param) {
+        if (m_properties != null && param != null && param.startsWith("%"))
{
             param = param.substring(1);
             return m_properties.getProperty(param);
         }

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/AspectFilterIndex.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/AspectFilterIndex.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/AspectFilterIndex.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/AspectFilterIndex.java
Tue Apr 26 10:47:12 2011
@@ -41,6 +41,9 @@ import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
 
+/**
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
 public class AspectFilterIndex implements FilterIndex, ServiceTrackerCustomizer {
     private static final String FILTER_START = "(&(" + Constants.OBJECTCLASS + "=";
     private static final String FILTER_SUBSTRING_0 = ")(&(|(!(" + Constants.SERVICE_RANKING
+ "=*))(" + Constants.SERVICE_RANKING + "<=";

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/BundleContextInterceptor.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/BundleContextInterceptor.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/BundleContextInterceptor.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/BundleContextInterceptor.java
Tue Apr 26 10:47:12 2011
@@ -29,6 +29,9 @@ import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
 
+/**
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
 public class BundleContextInterceptor extends BundleContextInterceptorBase {
     private final ServiceRegistryCache m_cache;
 
@@ -43,6 +46,7 @@ public class BundleContextInterceptor ex
             filterIndex.addServiceListener(listener, filter);
         }
         else {
+//            System.out.println("BCI:Listener " + listener.getClass().getName() + " filter
" + filter);
             m_context.addServiceListener(listener, filter);
         }
     }
@@ -53,6 +57,7 @@ public class BundleContextInterceptor ex
             filterIndex.addServiceListener(listener, null);
         }
         else {
+//            System.out.println("BCI:Listener " + listener.getClass().getName() + " without
filter");
             m_context.addServiceListener(listener);
         }
     }

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/BundleContextInterceptorBase.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/BundleContextInterceptorBase.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/BundleContextInterceptorBase.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/BundleContextInterceptorBase.java
Tue Apr 26 10:47:12 2011
@@ -36,7 +36,11 @@ import org.osgi.framework.ServiceListene
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.ServiceRegistration;
 
-/** Base class for bundle context interceptors that keep track of service listeners and delegate
incoming changes to them. */
+/**
+ * Base class for bundle context interceptors that keep track of service listeners and delegate
incoming changes to them.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
 public abstract class BundleContextInterceptorBase implements BundleContext, ServiceListener
{
     protected final BundleContext m_context;
     /** Keeps track of all service listeners and their optional filters. */

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/FilterIndex.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/FilterIndex.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/FilterIndex.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/FilterIndex.java
Tue Apr 26 10:47:12 2011
@@ -26,6 +26,8 @@ import org.osgi.framework.ServiceListene
 
 /**
  * A filter index is an interface you can implement to create your own, optimized index for
specific filter expressions.
+ * 
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public interface FilterIndex {
     /** Opens this filter index. */

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/FilterIndexBundleContext.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/FilterIndexBundleContext.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/FilterIndexBundleContext.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/FilterIndexBundleContext.java
Tue Apr 26 10:47:12 2011
@@ -25,6 +25,9 @@ import org.osgi.framework.InvalidSyntaxE
 import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 
+/**
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
 public class FilterIndexBundleContext extends BundleContextInterceptorBase {
     public FilterIndexBundleContext(BundleContext context) {
         super(context);

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/MultiPropertyExactFilter.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/MultiPropertyExactFilter.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/MultiPropertyExactFilter.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/MultiPropertyExactFilter.java
Tue Apr 26 10:47:12 2011
@@ -37,6 +37,9 @@ import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceReference;
 
+/**
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
 public class MultiPropertyExactFilter implements FilterIndex, ServiceTrackerCustomizer {
     private final Object m_lock = new Object();
     private ServiceTracker m_tracker;

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/ServiceRegistryCache.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/ServiceRegistryCache.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/ServiceRegistryCache.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/index/ServiceRegistryCache.java
Tue Apr 26 10:47:12 2011
@@ -29,6 +29,9 @@ import org.osgi.framework.ServiceEvent;
 import org.osgi.framework.ServiceListener;
 import org.osgi.framework.ServiceRegistration;
 
+/**
+ * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
+ */
 public class ServiceRegistryCache implements ServiceListener/*, CommandProvider*/ {
     private final List /* <FilterIndex> */ m_filterIndexList = new CopyOnWriteArrayList();
     private final BundleContext m_context;

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/BundleTracker.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/BundleTracker.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/BundleTracker.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/BundleTracker.java
Tue Apr 26 10:47:12 2011
@@ -1,5 +1,4 @@
 package org.apache.felix.dm.tracker;
-
 /*
  * Copyright (c) OSGi Alliance (2007, 2008). All Rights Reserved.
  * 

Modified: felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/ServiceTrackerCustomizer.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/ServiceTrackerCustomizer.java?rev=1096719&r1=1096718&r2=1096719&view=diff
==============================================================================
--- felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/ServiceTrackerCustomizer.java
(original)
+++ felix/trunk/dependencymanager/core/src/main/java/org/apache/felix/dm/tracker/ServiceTrackerCustomizer.java
Tue Apr 26 10:47:12 2011
@@ -1,5 +1,4 @@
 package org.apache.felix.dm.tracker;
-
 /*
  * Copyright (c) OSGi Alliance (2000, 2008). All Rights Reserved.
  * 



Mime
View raw message