felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r1380118 - in /felix/trunk/scr/src/main/java/org/apache/felix/scr/impl: Activator.java ScrCommand.java config/ConfigurationSupport.java config/ScrConfiguration.java manager/ComponentContextImpl.java
Date Mon, 03 Sep 2012 03:07:16 GMT
Author: fmeschbe
Date: Mon Sep  3 03:07:15 2012
New Revision: 1380118

URL: http://svn.apache.org/viewvc?rev=1380118&view=rev
Log:
FELIX-3649 Remove CT workaround because it is not needed any longer

Modified:
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfiguration.java
    felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/Activator.java?rev=1380118&r1=1380117&r2=1380118&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/Activator.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/Activator.java Mon Sep  3 03:07:15
2012
@@ -69,10 +69,6 @@ public class Activator implements Bundle
     //  thread acting upon configurations
     private ComponentActorThread m_componentActor;
 
-    // whether to support two workarounds to run the OSGi R 4.2 CT
-    // See hasCtWorkaround()
-    private static boolean m_ctWorkaround;
-
     /**
      * Registers this instance as a (synchronous) bundle listener and loads the
      * components of already registered bundles.
@@ -99,9 +95,6 @@ public class Activator implements Bundle
         log( LogService.LOG_INFO, context.getBundle(), " Version = "
             + context.getBundle().getHeaders().get( Constants.BUNDLE_VERSION ), null );
 
-        // check whether we workaround OSGi CT issues
-        m_ctWorkaround = ScrConfiguration.hasCtWorkaround( context );
-
         // create and start the component actor
         m_componentActor = new ComponentActorThread();
         Thread t = new Thread(m_componentActor, "SCR Component Actor");
@@ -455,33 +448,4 @@ public class Activator implements Bundle
 
         return m_packageAdmin.getService();
     }
-
-
-    /**
-     * Returns <code>true</code> if the <code>ds.ctworkaround</code>
framework
-     * property has been set to <code>true</code>. Otherwise <code>false</code>
-     * is returned.
-     * <p>
-     * If this method returns <code>true</code>, two workarounds for the OSGi
-     * Compendium R 4.2 CT for Declarative Services are active:
-     * <ul>
-     * <li>The <code>ComponentContext.getProperties()</code> implementation
-     * always returns the same writeable <code>Dictionary</code> instead of
-     * a read-only dictionary</li>
-     * <li>Location binding of <code>Configuration</code> objects supplied
to
-     * components is ignored.</li>
-     * </ul>
-     * <p>
-     * Setting the <code>ds.ctworkaround</code> framework property is required
-     * to pass the CT but setting the property in a productive environment
-     * is strongly discouraged.
-     *
-     * @return <code>true</code> if the <code>ds.ctworkaround</code>
framework
-     *      property is set to <code>true</code>.
-     * @see <a href="https://issues.apache.org/jira/browse/FELIX-2526">FELIX-2526</a>
-     */
-    public static boolean hasCtWorkaround()
-    {
-        return m_ctWorkaround;
-    }
 }
\ No newline at end of file

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java?rev=1380118&r1=1380117&r2=1380118&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java Mon Sep  3 03:07:15
2012
@@ -358,11 +358,6 @@ class ScrCommand
         out.println(scrConfiguration.getLogLevel());
         out.print("Component Factory with Factory Configuration: ");
         out.println(scrConfiguration.isFactoryEnabled() ? "Supported" : "Unsupported");
-
-        if (ScrConfiguration.hasCtWorkaround(bundleContext))
-        {
-            out.println("CT Issue workaround enabled");
-        }
     }
 
     private String pad(String value, int size)

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java?rev=1380118&r1=1380117&r2=1380118&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
Mon Sep  3 03:07:15 2012
@@ -256,7 +256,7 @@ public class ConfigurationSupport implem
         try
         {
             final Configuration cfg = ca.getConfiguration(pid);
-            if (bundleLocation.equals(cfg.getBundleLocation()) || Activator.hasCtWorkaround())
+            if (bundleLocation.equals(cfg.getBundleLocation()))
             {
                 return cfg.getProperties();
             }

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfiguration.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfiguration.java?rev=1380118&r1=1380117&r2=1380118&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfiguration.java (original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfiguration.java Mon
Sep  3 03:07:15 2012
@@ -22,7 +22,6 @@ package org.apache.felix.scr.impl.config
 import java.util.Dictionary;
 import java.util.Hashtable;
 
-import org.apache.felix.scr.impl.Activator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
@@ -64,9 +63,6 @@ public class ScrConfiguration
 
     public static final String PROP_LOGLEVEL = "ds.loglevel";
 
-    // framework property to enable the CT workarounds (see FELIX-2526)
-    private static final String PROP_CT_WORKAROUND = "ds.ctworkaround";
-
     private static final String LOG_LEVEL_DEBUG = "debug";
 
     private static final String LOG_LEVEL_INFO = "info";
@@ -167,28 +163,6 @@ public class ScrConfiguration
     }
 
 
-    public static boolean hasCtWorkaround( final BundleContext bundleContext )
-    {
-        boolean ctWorkaround = VALUE_TRUE.equals( bundleContext.getProperty( PROP_CT_WORKAROUND
) );
-        if ( ctWorkaround )
-        {
-            Activator
-                .log(
-                    LogService.LOG_WARNING,
-                    bundleContext.getBundle(),
-                    "OSGi CT Workaround enabled. This Declarative Services instance is not
operating specification compliant:",
-                    null );
-            Activator.log( LogService.LOG_WARNING, bundleContext.getBundle(),
-                " - Dictionary returned from ComponentContext.getProperties() is writeable",
null );
-            Activator.log( LogService.LOG_WARNING, bundleContext.getBundle(),
-                " - Location Binding of Configuration is ignored", null );
-            Activator.log( LogService.LOG_WARNING, bundleContext.getBundle(), "Remove " +
PROP_CT_WORKAROUND
-                + " framework property to operate specification compliant", null );
-        }
-        return ctWorkaround;
-    }
-
-
     private boolean getDefaultFactoryEnabled()
     {
         return VALUE_TRUE.equals( bundleContext.getProperty( PROP_FACTORY_ENABLED ) );

Modified: felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java?rev=1380118&r1=1380117&r2=1380118&view=diff
==============================================================================
--- felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
(original)
+++ felix/trunk/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
Mon Sep  3 03:07:15 2012
@@ -22,7 +22,6 @@ package org.apache.felix.scr.impl.manage
 import java.util.Dictionary;
 
 import org.apache.felix.scr.component.ExtComponentContext;
-import org.apache.felix.scr.impl.Activator;
 import org.apache.felix.scr.impl.helper.ReadOnlyDictionary;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -54,11 +53,7 @@ public class ComponentContextImpl implem
     {
         // 112.12.3.5 The Dictionary is read-only and cannot be modified
         Dictionary ctxProperties = m_componentManager.getProperties();
-        if ( !Activator.hasCtWorkaround() )
-        {
-            ctxProperties = new ReadOnlyDictionary( ctxProperties );
-        }
-        return ctxProperties;
+        return new ReadOnlyDictionary( ctxProperties );
     }
 
 



Mime
View raw message