incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r1169905 - /sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
Date Mon, 12 Sep 2011 20:07:20 GMT
Author: justin
Date: Mon Sep 12 20:07:20 2011
New Revision: 1169905

URL: http://svn.apache.org/viewvc?rev=1169905&view=rev
Log:
SLING-2210 - using DS 1.1 <class>, map style bind method

Modified:
    sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java

Modified: sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java?rev=1169905&r1=1169904&r2=1169905&view=diff
==============================================================================
--- sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
(original)
+++ sling/trunk/bundles/scripting/core/src/main/java/org/apache/sling/scripting/core/impl/ScriptEngineManagerFactory.java
Mon Sep 12 20:07:20 2011
@@ -59,7 +59,7 @@ import org.slf4j.LoggerFactory;
  * Component which exposes a ScriptEngineManager service.
  *
  */
-@Component(metatype=false, immediate=true)
+@Component(metatype=false, immediate=true, specVersion="1.1")
 @Reference(name="ScriptEngineFactory", referenceInterface=ScriptEngineFactory.class,
            policy=ReferencePolicy.DYNAMIC, cardinality=ReferenceCardinality.OPTIONAL_MULTIPLE)
 public class ScriptEngineManagerFactory implements BundleListener {
@@ -253,13 +253,10 @@ public class ScriptEngineManagerFactory 
         this.bundleContext = null;
     }
 
-
-
-    protected void bindScriptEngineFactory(ServiceReference ref) {
-        final ScriptEngineFactory scriptEngineFactory = (ScriptEngineFactory) bundleContext.getService(ref);
+    protected void bindScriptEngineFactory(final ScriptEngineFactory scriptEngineFactory,
final Map<Object, Object> props) {
         if (scriptEngineFactory != null) {
             synchronized ( this ) {
-                this.engineSpiServices.put(scriptEngineFactory, getProperties(ref));
+                this.engineSpiServices.put(scriptEngineFactory, props);
                 if ( this.scriptEngineManager != null ) {
                     this.scriptEngineManager = null;
                     this.refreshScriptEngineManager();
@@ -270,7 +267,7 @@ public class ScriptEngineManagerFactory 
         }
     }
 
-    protected void unbindScriptEngineFactory(ScriptEngineFactory scriptEngineFactory) {
+    protected void unbindScriptEngineFactory(final ScriptEngineFactory scriptEngineFactory)
{
         synchronized ( this ) {
             if ( this.engineSpiServices.remove(scriptEngineFactory) != null ) {
                 if ( this.scriptEngineManager != null ) {
@@ -283,14 +280,6 @@ public class ScriptEngineManagerFactory 
         postEvent(SlingScriptConstants.TOPIC_SCRIPT_ENGINE_FACTORY_REMOVED, scriptEngineFactory);
     }
 
-    private Map<Object, Object> getProperties(final ServiceReference ref) {
-        final Map<Object, Object> props = new HashMap<Object, Object>();
-        for (final String key : ref.getPropertyKeys()) {
-            props.put(key, ref.getProperty(key));
-        }
-        return props;
-    }
-
     /**
      * Get the event admin.
      *



Mime
View raw message