You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemind.apache.org by ah...@apache.org on 2007/01/27 21:45:13 UTC

svn commit: r500613 - in /hivemind/hivemind2/trunk: framework/src/java/org/apache/hivemind/impl/ framework/src/java/org/apache/hivemind/util/ xml/src/java/org/apache/hivemind/impl/

Author: ahuegen
Date: Sat Jan 27 12:45:12 2007
New Revision: 500613

URL: http://svn.apache.org/viewvc?view=rev&rev=500613
Log:
Error messages and javadoc improved

Modified:
    hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java
    hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/ExtensionResolver.java
    hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UniqueHashMap.java
    hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UtilMessages.java
    hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UtilStrings.properties
    hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlExtensionResolver.java
    hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlImplMessages.java
    hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlImplStrings.properties
    hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java

Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java?view=diff&rev=500613&r1=500612&r2=500613
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/ConfigurationPointImpl.java Sat Jan 27 12:45:12 2007
@@ -65,6 +65,7 @@
 
     private boolean _building;
 
+    // TODO: use ShutdownCoordinator 
     private ShutdownCoordinator _shutdownCoordinator;
 
     public ConfigurationPointImpl(Module module, ConfigurationPointDefinition definition)
@@ -108,7 +109,7 @@
     }
 
     /**
-     * @return true if configuration should be create lazy, that means a proxy must be created.
+     * @return true if configuration should be created lazy, that means a proxy must be created.
      */
     public boolean isLazy()
     {

Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/ExtensionResolver.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/ExtensionResolver.java?view=diff&rev=500613&r1=500612&r2=500613
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/ExtensionResolver.java (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/ExtensionResolver.java Sat Jan 27 12:45:12 2007
@@ -179,7 +179,6 @@
             } else {
                 if (Visibility.PRIVATE.equals(configurationPoint.getVisibility())
                    && !module.getId().equals(IdUtils.extractModule(configurationPointId))) {
-                    // TODO: Ids are not qualified
                     _errorHandler.error(
                             LOG,
                             DefinitionMessages.configurationPointNotVisible(

Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UniqueHashMap.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UniqueHashMap.java?view=diff&rev=500613&r1=500612&r2=500613
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UniqueHashMap.java (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UniqueHashMap.java Sat Jan 27 12:45:12 2007
@@ -17,8 +17,7 @@
     public Object put(Object key, Object value)
     {
         if (containsKey(key)) {
-            // TODO annotations: Exception-Handling
-            throw new ApplicationRuntimeException("Key '" + key + "' already contained in map");
+            throw new ApplicationRuntimeException(UtilMessages.duplicateKeyInMap(key));
         }
         return super.put(key, value);
     }

Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UtilMessages.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UtilMessages.java?view=diff&rev=500613&r1=500612&r2=500613
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UtilMessages.java (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UtilMessages.java Sat Jan 27 12:45:12 2007
@@ -104,4 +104,11 @@
     {
         return _formatter.format("unable-to-instantiate-instance-of-class", clazz.getName(), cause);
     }
+    
+    /** @since 2.0 */
+    static String duplicateKeyInMap(Object key)
+    {
+        return _formatter.format("duplicate-key-in-map", key);
+    }
+
 }

Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UtilStrings.properties
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UtilStrings.properties?view=diff&rev=500613&r1=500612&r2=500613
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UtilStrings.properties (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/util/UtilStrings.properties Sat Jan 27 12:45:12 2007
@@ -26,3 +26,5 @@
 no-property-editor=No property editor exists for property {0} of class {1}.
 unable-to-convert=Unable to convert ''{0}'' to type {1} (for property {2} of object {3}): {4}
 unable-to-instantiate-instance-of-class=Unable to instantiate instance of class {0}: {1}
+duplicate-key-in-map=Key ''{0}'' already contained in map
+

Modified: hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlExtensionResolver.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlExtensionResolver.java?view=diff&rev=500613&r1=500612&r2=500613
==============================================================================
--- hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlExtensionResolver.java (original)
+++ hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlExtensionResolver.java Sat Jan 27 12:45:12 2007
@@ -138,8 +138,7 @@
             String configurationPointId = IdUtils.qualify(sourceModule.getId(), schemaAssignment.getConfigurationId());
             ConfigurationPointDefinition cpd = _definition.getConfigurationPoint(configurationPointId);
             if (cpd == null) {
-                // TODO annotations: Exception handling
-                throw new ApplicationRuntimeException("Unknown configuration point");
+                throw new ApplicationRuntimeException(XmlImplMessages.unknownConfigurationPointOfSchemaAssignment(configurationPointId, schemaAssignment));
             }
             
             String schemaId = IdUtils.qualify(sourceModule.getId(), schemaAssignment.getSchemaId());
@@ -148,7 +147,6 @@
             if (schema != null) {
                 // TODO: check if schema has already been set
                 // TODO: more type related error handling, check root type of schema
-                // TODO: set parser here instead of schema
                 
                 // Add parser constructor with direct reference to schema
                 ConfigurationParserDefinition parserDef = new ConfigurationParserDefinitionImpl(

Modified: hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlImplMessages.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlImplMessages.java?view=diff&rev=500613&r1=500612&r2=500613
==============================================================================
--- hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlImplMessages.java (original)
+++ hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlImplMessages.java Sat Jan 27 12:45:12 2007
@@ -145,5 +145,10 @@
     {
         return _formatter.getMessage("symbol-source-contribution");
     }
+    
+    static String unknownConfigurationPointOfSchemaAssignment(String configurationId, SchemaAssignment schemaAssignment)
+    {
+        return _formatter.format("unknown-configurationpoint-in-schema-assignment", configurationId, schemaAssignment.getLocation());
+    }
 
 }

Modified: hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlImplStrings.properties
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlImplStrings.properties?view=diff&rev=500613&r1=500612&r2=500613
==============================================================================
--- hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlImplStrings.properties (original)
+++ hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlImplStrings.properties Sat Jan 27 12:45:12 2007
@@ -42,4 +42,6 @@
 
 no-such-symbol=No value available for symbol ''{0}''.
 symbol-source-contribution=symbol source
+unknown-configurationpoint-in-schema-assignment=Unknown configuration point {0} referenced from schema assignment at {1}
+
 

Modified: hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java?view=diff&rev=500613&r1=500612&r2=500613
==============================================================================
--- hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java (original)
+++ hivemind/hivemind2/trunk/xml/src/java/org/apache/hivemind/impl/XmlModuleDescriptorProcessor.java Sat Jan 27 12:45:12 2007
@@ -70,6 +70,9 @@
         _errorHandler = errorHandler;
     }
 
+    /**
+     * Adds all elements to the registry definition that are defined in a module descriptor. 
+     */
     public void processModuleDescriptor(ModuleDescriptor md)
     {
         String id = md.getModuleId();
@@ -99,6 +102,9 @@
         
     }
     
+    /**
+     * Adds all module dependencies to the module definition.
+     */
     private void addDependencies(ModuleDefinition module, ModuleDescriptor md)
     {
         int count = size(md.getDependencies());
@@ -110,6 +116,9 @@
         }
     }
 
+    /**
+     * Adds all schemas to the module definition.
+     */
     private void addSchemas(XmlModuleDefinitionImpl module, ModuleDescriptor md)
     {
         for (Iterator schemas = md.getSchemas().iterator(); schemas.hasNext();)
@@ -120,6 +129,9 @@
         }
     }
     
+    /**
+     * Adds all schema assignments to the module definition.
+     */
     private void addSchemaAssignments(XmlModuleDefinitionImpl module, ModuleDescriptor md)
     {
         if (md.getSchemaAssignment() == null)
@@ -134,6 +146,9 @@
         }
     }
     
+    /**
+     * Adds all service points to the module definition.
+     */
     private void addServicePoints(XmlModuleDefinitionImpl module, ModuleDescriptor md)
     {
         List services = md.getServicePoints();
@@ -162,6 +177,9 @@
         }
     }
 
+    /**
+     * Adds all service implementations to the module definition.
+     */
     private void addImplementations(ModuleDefinition module, ModuleDescriptor md)
     {
         String moduleId = md.getModuleId();
@@ -186,7 +204,7 @@
     }
 
     /**
-     * Adds ordinary service contributions.
+     * Adds one implementation and its interceptors to a module definition.
      */
     private void addImplementationAndInterceptors(ModuleDefinition sourceModule, String qualifiedPointId, ImplementationDescriptor id)
     {
@@ -242,6 +260,9 @@
         }
     }
 
+    /**
+     * Adds all configuratin points to a module definition.
+     */
     private void addConfigurationPoints(XmlModuleDefinitionImpl module, ModuleDescriptor md)
     {
         List points = md.getConfigurationPoints();
@@ -282,6 +303,9 @@
         }
     }
 
+    /**
+     * Adds all contributions to a module definition.
+     */
     private void addContributions(ModuleDefinition module, ModuleDescriptor md)
     {
         String moduleId = md.getModuleId();
@@ -306,12 +330,14 @@
         }
     }
 
+    /**
+     * Adds all interceptors to a module definition.
+     */
     private void addInterceptor(ModuleDefinition module, String qualifiedPointId, InterceptorDescriptor id)
     {
         if (_log.isDebugEnabled())
             _log.debug("Adding " + id + " to service extension point " + qualifiedPointId);
         
-        // TODO annotations: generic container for parameter 
         InvokeFactoryInterceptorConstructor constructor = new InvokeFactoryInterceptorConstructor(id.getLocation());
         constructor.setFactoryServiceId(id.getFactoryServiceId());
         constructor.setParameters(id.getParameters());