geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r767894 - in /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace: ComponentDefinitionRegistryImpl.java ParserContextImpl.java
Date Thu, 23 Apr 2009 11:35:54 GMT
Author: gnodet
Date: Thu Apr 23 11:35:54 2009
New Revision: 767894

URL: http://svn.apache.org/viewvc?rev=767894&view=rev
Log:
Clean ParserContextImpl and ComponentDefinitionRegistryImpl

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ParserContextImpl.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java?rev=767894&r1=767893&r2=767894&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ComponentDefinitionRegistryImpl.java
Thu Apr 23 11:35:54 2009
@@ -24,6 +24,8 @@
 import java.util.Set;
 import java.util.List;
 import java.util.ArrayList;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.ConcurrentHashMap;
 
 import org.osgi.service.blueprint.namespace.ComponentDefinitionRegistry;
 import org.osgi.service.blueprint.namespace.ComponentNameAlreadyInUseException;
@@ -34,7 +36,10 @@
 import org.osgi.service.blueprint.reflect.Target;
 
 /**
- * TODO: javadoc
+ * ComponentDefinitionRegistry implementation.
+ *
+ * This implementation uses concurrent lists and maps to store components and converters
metadata
+ * to allow its use by concurrent threads. 
  *
  * @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
  * @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
@@ -47,8 +52,8 @@
     private String defaultDestroyMethod;
 
     public ComponentDefinitionRegistryImpl() {
-        components = new HashMap<String, ComponentMetadata>();
-        typeConverters = new ArrayList<Target>();
+        components = new ConcurrentHashMap<String, ComponentMetadata>();
+        typeConverters = new CopyOnWriteArrayList<Target>();
     }
 
     public boolean containsComponentDefinition(String name) {
@@ -63,7 +68,7 @@
         return Collections.unmodifiableSet(components.keySet());
     }
 
-    public void registerComponentDefinition(ComponentMetadata component) throws ComponentNameAlreadyInUseException
{
+    public void registerComponentDefinition(ComponentMetadata component) {
         String name = component.getId();
         if (components.containsKey(name)) {
             throw new ComponentNameAlreadyInUseException(name);

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ParserContextImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ParserContextImpl.java?rev=767894&r1=767893&r2=767894&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ParserContextImpl.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/namespace/ParserContextImpl.java
Thu Apr 23 11:35:54 2009
@@ -25,7 +25,9 @@
 import org.osgi.service.blueprint.reflect.ComponentMetadata;
 
 /**
- * TODO: javadoc
+ * A simple ParserContext implementation.
+ * 
+ * This class is supposed to be short lived and only used for calling a given namespace handler.
  *
  * @author <a href="mailto:dev@geronimo.apache.org">Apache Geronimo Project</a>
  * @version $Rev: 760378 $, $Date: 2009-03-31 11:31:38 +0200 (Tue, 31 Mar 2009) $
@@ -36,7 +38,9 @@
     private final ComponentMetadata enclosingComponent;
     private final Node sourceNode;
 
-    public ParserContextImpl(ComponentDefinitionRegistry componentDefinitionRegistry, ComponentMetadata
enclosingComponent, Node sourceNode) {
+    public ParserContextImpl(ComponentDefinitionRegistry componentDefinitionRegistry,
+                             ComponentMetadata enclosingComponent,
+                             Node sourceNode) {
         this.componentDefinitionRegistry = componentDefinitionRegistry;
         this.enclosingComponent = enclosingComponent;
         this.sourceNode = sourceNode;



Mime
View raw message