Title: [waffle-scm] [558] trunk/waffle-distribution: Completed registrar javadoc.
Revision
558
Author
mauro
Date
2008-01-18 10:03:40 -0600 (Fri, 18 Jan 2008)

Log Message

Completed registrar javadoc.  Updated registrar docs to reflect latest changes.
Removed PT localisation from docs until pages are converted from APT.

Modified Paths

Diff

Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/Registrar.java (557 => 558)

--- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/Registrar.java	2008-01-18 15:16:56 UTC (rev 557)
+++ trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/Registrar.java	2008-01-18 16:03:40 UTC (rev 558)
@@ -11,10 +11,11 @@
 package org.codehaus.waffle.registrar;
 
 /**
- * <p>Defines the available methods for registering Controllers and Components.
+ * <p>
+ * Defines the available methods for registering components (including controllers).
  * By default Constructor based dependency injection is utilized.
  * </p>
- *
+ * 
  * @author Michael Ward
  * @author Mauro Talevi
  */
@@ -24,9 +25,10 @@
         CONSTRUCTOR, // default
         SETTER
     }
-    
+
     /**
-     * Use the given injection type for component instantiation
+     * Use the given injection type for component instantiation. 
+     * Defaults to [EMAIL PROTECTED] Injection.CONSTRUCTOR}.
      * 
      * @param injection the Injection to use
      * @return The Registrar
@@ -42,44 +44,63 @@
     boolean isRegistered(Object typeOrInstance);
 
     /**
-     * @param type represent both the key and type the object will be registered under
+     * Registers a component in the current context.
+     * 
+     * @param type represents both the key and type the object will be registered under
      * @param parameters any parameters needed to satisfy the component being registered
      * @return The current Registrar which allows for chaining registration calls.
      */
     Registrar register(Class<?> type, Object... parameters);
 
     /**
-     * @param key represent the key the object will be registered under
-     * @param type represent the component type
+     * Registers a component in the current context under the given key.
+     * 
+     * @param key represents the key the object will be registered under
+     * @param type represents the component type
      * @param parameters any parameters needed to satisfy the component being registered
      * @return The current Registrar which allows for chaining registration calls.
      */
     Registrar register(Object key, Class<?> type, Object... parameters);
 
     /**
-     * Register an instance directly with the current context.
-     *
+     * Registers a component instance directly in the current context.
+     * 
      * @param instance to be registered
      * @return The current Registrar which allows for chaining registration calls.
      */
     Registrar registerInstance(Object instance);
 
     /**
-     * Register an instance directly with the current context under the given key.
-     *
+     * Registers a component instance directly in the current context under the given key.
+     * 
      * @param key the key the instance is to be registered under
      * @param instance to be registered
      * @return The current Registrar which allows for chaining registration calls.
      */
     Registrar registerInstance(Object key, Object instance);
 
+    /**
+     * Registers a component in non-caching mode, ie with new instance created for each class with a defined dependency
+     * 
+     * @param type represents both the key and type the object will be registered under
+     * @param parameters any parameters needed to satisfy the component being registered
+     * @return The current Registrar which allows for chaining registration calls.
+     */
     Registrar registerNonCaching(Class<?> type, Object... parameters);
 
+    /**
+     * Registers a component under the given key in non-caching mode, ie with new instance created for each class with a defined dependency
+     * 
+     * @param key represents the key the object will be registered under
+     * @param type represents the component type
+     * @param parameters any parameters needed to satisfy the component being registered
+     * @return The current Registrar which allows for chaining registration calls.
+     */
     Registrar registerNonCaching(Object key, Class<?> type, Object... parameters);
 
     /**
      * Components registered in this method will be availables for the life of the Application.
-     *
+     * 
      * @see org.codehaus.waffle.context.ContextLevel#APPLICATION
      * @see javax.servlet.ServletContextListener
      */
@@ -87,7 +108,7 @@
 
     /**
      * Components registered in this method will be availables for the life of a Users session.
-     *
+     * 
      * @see org.codehaus.waffle.context.ContextLevel#SESSION
      * @see javax.servlet.http.HttpSessionListener
      */
@@ -95,9 +116,9 @@
 
     /**
      * Components registered in this method will be availables for the life of a request.
-     *
+     * 
      * @see org.codehaus.waffle.context.ContextLevel#REQUEST
      */
     void request();
-    
+
 }

Modified: trunk/waffle-distribution/pom.xml (557 => 558)

--- trunk/waffle-distribution/pom.xml	2008-01-18 15:16:56 UTC (rev 557)
+++ trunk/waffle-distribution/pom.xml	2008-01-18 16:03:40 UTC (rev 558)
@@ -37,7 +37,6 @@
           <skinPath>templates/skin.html</skinPath>
           <resourcePaths>resources</resourcePaths>
           <outputDirectoryPath>${project.build.directory}/site</outputDirectoryPath>
-          <localisations>pt</localisations>
         </configuration>
         <executions>
           <execution>

Modified: trunk/waffle-distribution/src/site/content/registrar.html (557 => 558)

--- trunk/waffle-distribution/src/site/content/registrar.html	2008-01-18 15:16:56 UTC (rev 557)
+++ trunk/waffle-distribution/src/site/content/registrar.html	2008-01-18 16:03:40 UTC (rev 558)
@@ -153,18 +153,17 @@
 cannot be accessed by a session from another user, same hold true for
 requests.</p>
 <img src="" alt="Context level hierarchy seperation">
-<dl>
-  <dt>NOTE:</dt>
-  <dd>To prevent exceptions registration of components should
-  follow these rules:
+
+<p>
+<b>NOTE:</b> To prevent exceptions registration of components should follow these rules:
   <ul>
     <li>key names must be unique</li>
     <li>do not register the same component multiple times</li>
     <li>ambiguous dependencies (two different implementation of an
     interface and a class dependent on a implementation)</li>
   </ul>
-  </dd>
-</dl>
+</p>
+
 <p>By default the <i>"register"</i> methods cache
 instances created within the framework. That is, only a single managed
 instance is created. Again that is a "single managed instance"
@@ -182,40 +181,37 @@
       <td align="left"><b>Description</b></td>
     </tr>
     <tr class="b">
-      <td align="left"><b>void register(Class componentClass)</b></td>
-      <td align="left">This method is useful for registering
-      components other than Actions.</td>
+      <td align="left"><b>Registrar useInjection(Injection injection)</b></td>
+      <td align="left">Allows to change the type of Injection used, which defaults to Injection.CONSTRUCTOR.  
+      Injection.SETTER is also supported</td>
     </tr>
+    <tr class="b">
+      <td align="left"><b>boolean isRegistered(Object typeOrInstance)</b></td>
+      <td align="left">Determines if a component is already registered for a given type or instance</td>
+    </tr>
+    <tr class="b">
+      <td align="left"><b>void register(Class componentClass, Object... parameters)</b></td>
+      <td align="left">Registers a component (useful for components other than Actions)</td>
+    </tr>
     <tr class="a">
-      <td align="left"><b>void register(Object key, Class
-      componentClass)</b></td>
-      <td align="left">Register the componentClass under the key
-      name (key is used to locate Action from request).</td>
+      <td align="left"><b>void register(Object key, Class componentClass, Object... parameters)</b></td>
+      <td align="left">Register a component under a specific key (keys are used to locate Controllers from request)</td>
     </tr>
     <tr class="b">
-      <td align="left"><b>void registerNonCaching(Class
-      componentClass)</b></td>
-      <td align="left">A new instance will be created for each
-      class with the defined dependency.</td>
+      <td align="left"><b>void registerNonCaching(Class componentClass, Object... parameters)</b></td>
+      <td align="left">Registers a component in non-caching mode, ie with new instance created for each class with the defined dependency</td>
     </tr>
     <tr class="a">
-      <td align="left"><b>void registerNonCaching(Object key,
-      Class componentClass)</b></td>
-      <td align="left">Similar to <i>void register(Object key,
-      Class componentClass)</i> except that a new instance will be created
-      for each dependent class.</td>
+      <td align="left"><b>void registerNonCaching(Object key, Class componentClass, Object... parameters)</b></td>
+      <td align="left">Registers a component in non-caching mode, ie with new instance created for each class with the defined dependency</td>
     </tr>
     <tr class="b">
-      <td align="left"><b>void registerInstance(Object
-      instance)</b></td>
-      <td align="left">This method is useful for registering an
-      instance directly.</td>
+      <td align="left"><b>void registerInstance(Object instance)</b></td>
+      <td align="left">Registers a component instance directly</td>
     </tr>
     <tr class="a">
-      <td align="left"><b>void registerInstance(Object key,
-      Object instance)</b></td>
-      <td align="left">Register the instance directly with the
-      underlying container under the key name provided.</td>
+      <td align="left"><b>void registerInstance(Object key,  Object instance)</b></td>
+      <td align="left">Registers a component instance directly under a specific key</td>
     </tr>
   </tbody>
 </table>


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Reply via email to