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/02/06 22:11:50 UTC

svn commit: r504293 - in /hivemind/hivemind2/trunk/framework/src: java/org/apache/hivemind/definition/ServicePointDefinition.java java/org/apache/hivemind/impl/RegistryBuilder.java test/org/apache/hivemind/impl/TestVisibility.java

Author: ahuegen
Date: Tue Feb  6 13:11:49 2007
New Revision: 504293

URL: http://svn.apache.org/viewvc?view=rev&rev=504293
Log:
Improved javadoc

Modified:
    hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ServicePointDefinition.java
    hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java
    hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/TestVisibility.java

Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ServicePointDefinition.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ServicePointDefinition.java?view=diff&rev=504293&r1=504292&r2=504293
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ServicePointDefinition.java (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/definition/ServicePointDefinition.java Tue Feb  6 13:11:49 2007
@@ -2,16 +2,34 @@
 
 import java.util.Collection;
 
+/**
+ * Defines a service extension point.
+ * The definition includes the service interface, implementations
+ * and interceptors.
+ * 
+ * @author Achim Huegen
+ */
 public interface ServicePointDefinition extends ExtensionPointDefinition
 {
-
+    /**
+     * @return  the fully qualified class name of the service interface. 
+     * This may be the name of a ordinary class or an interface.
+     */
     public String getInterfaceClassName();
 
-    public Collection getImplementations();
-
+    /**
+     * @return  the default implementation of the service. The default is selected 
+     *   by {@link ImplementationDefinition#isDefault()} if multiple exist.
+     */
     public ImplementationDefinition getDefaultImplementation();
 
+    /**
+     * Adds a implementation definition to the module.
+     * @param implementation  the implementation
+     */
     public void addImplementation(ImplementationDefinition implementation);
+
+    public Collection getImplementations();
 
     public Collection getInterceptors();
 

Modified: hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java?view=diff&rev=504293&r1=504292&r2=504293
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java (original)
+++ hivemind/hivemind2/trunk/framework/src/java/org/apache/hivemind/impl/RegistryBuilder.java Tue Feb  6 13:11:49 2007
@@ -33,6 +33,7 @@
 
 /**
  * Class used to build a {@link org.apache.hivemind.Registry} from a {@link org.apache.hivemind.definition.RegistryDefinition}. 
+ * 
  * A note about threadsafety: The assumption is that a single thread will access the RegistryBuilder
  * at one time (typically, a startup class within some form of server or application). Code here and
  * in many of the related classes is divided into construction-time logic and runtime logic. Runtime
@@ -82,12 +83,20 @@
 
     private RegistryDefinition _registryDefinition;
 
+    /**
+     * Constructs a new instance that starts with a empty {@link RegistryDefinition} which can be 
+     * requested by {@link #getRegistryDefinition()}.
+     */
     public RegistryBuilder()
     {
         this(new RegistryDefinitionImpl(), new DefaultErrorHandler());
     }
     
-    public RegistryBuilder(RegistryDefinition registryDefinition)
+    /**
+     * Constructs a new instance that starts with the provided {@link RegistryDefinition}.
+     * The definition can still be altered afterwards.
+     */
+   public RegistryBuilder(RegistryDefinition registryDefinition)
     {
         this(registryDefinition, new DefaultErrorHandler());
     }
@@ -103,6 +112,9 @@
         _errorHandler = errorHandler;
     }
 
+    /**
+     * @return  the contained registry definition
+     */
     public RegistryDefinition getRegistryDefinition()
     {
         return _registryDefinition;
@@ -119,6 +131,7 @@
     
     /**
      * Constructs the registry from its {@link RegistryDefinition}.
+     * @param locale  the locale used for translating resources
      */
     public Registry constructRegistry(Locale locale)
     {
@@ -160,6 +173,10 @@
     
     /**
      * Constructs the registry from a specified {@link RegistryDefinition}.
+     * @param definition  the registry definition
+     * @param errorHandler  errorHandler used for handling recoverable errors
+     * @param locale  the locale used for translating resources
+     * @return  the registry
      */
     public static Registry constructRegistry(RegistryDefinition definition, ErrorHandler errorHandler,
             Locale locale)
@@ -168,6 +185,9 @@
         return builder.constructRegistry(locale);
     }
 
+    /**
+     * Checks if all dependencies of modules are present.
+     */
     private void checkDependencies(RegistryDefinition definition)
     {
         for (Iterator iterModules = definition.getModules().iterator(); iterModules.hasNext();)
@@ -188,7 +208,7 @@
         ModuleDefinition requiredModule = (ModuleDefinition) definition.getModule(requiredModuleId);
         if (requiredModule == null)
         {
-            // TODO annotation: Location in Dependencies aufnehmen
+            // TODO: Include Location in Dependencies 
             _errorHandler.error(
                     LOG,
                     DefinitionMessages.dependencyOnUnknownModule(requiredModuleId),

Modified: hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/TestVisibility.java
URL: http://svn.apache.org/viewvc/hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/TestVisibility.java?view=diff&rev=504293&r1=504292&r2=504293
==============================================================================
--- hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/TestVisibility.java (original)
+++ hivemind/hivemind2/trunk/framework/src/test/org/apache/hivemind/impl/TestVisibility.java Tue Feb  6 13:11:49 2007
@@ -16,8 +16,6 @@
 
 import hivemind.test.FrameworkTestCase;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.definition.Visibility;
 import org.apache.hivemind.definition.impl.ConfigurationPointDefinitionImpl;
@@ -34,8 +32,6 @@
  */
 public class TestVisibility extends FrameworkTestCase
 {
-    private static final Log LOG = LogFactory.getLog(TestVisibility.class);
-
     public void testPublicConfigurationVisibleToOtherModule()
     {
         Module m = (Module) newMock(Module.class);