You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2007/05/17 16:46:43 UTC

svn commit: r538948 - in /incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core: DefaultExtensionPointRegistry.java ExtensionPointRegistry.java ModelFactoryExtensionPoint.java ModuleActivator.java

Author: slaws
Date: Thu May 17 07:46:42 2007
New Revision: 538948

URL: http://svn.apache.org/viewvc?view=rev&rev=538948
Log:
Add a little more detail to comments

Modified:
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModelFactoryExtensionPoint.java
    incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java?view=diff&rev=538948&r1=538947&r2=538948
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/DefaultExtensionPointRegistry.java Thu May 17 07:46:42 2007
@@ -24,13 +24,21 @@
 
 
 /**
- * Default implementation of a registry to hold all the Tuscany core extension points
+ * Default implementation of a registry to hold all the Tuscany core extension 
+ * points. As the point of contact for all extension artifacts this registry 
+ * allows loaded extensions to find all other parts of the system and 
+ * register themselves appropriately. 
  * 
  * @version $Rev$ $Date$
  */
 public class DefaultExtensionPointRegistry implements ExtensionPointRegistry {
     private Map<Class<?>, Object> extensionPoints = new HashMap<Class<?>, Object>();
 
+    /**
+     * Add an extension point to the registry. This default implementation
+     * stores extensions against the interfaces that they implement.
+     * @param extensionPoint The instance of the extension point
+     */    
     public void addExtensionPoint(Object extensionPoint) {
         Class[] interfaces = extensionPoint.getClass().getInterfaces();
         for (int i = 0; i < interfaces.length; i++) {
@@ -38,10 +46,20 @@
         }
     }
 
+    /**
+     * Get the extension point by the interface that it implements
+     * @param <T>
+     * @param extensionPointType
+     * @return
+     */
     public <T> T getExtensionPoint(Class<T> extensionPointType) {
         return extensionPointType.cast(extensionPoints.get(extensionPointType));
     }
 
+    /**
+     * Remove an extension point based on the interface that it implements
+     * @param extensionPoint
+     */
     public void removeExtensionPoint(Object extensionPoint) {
         Class[] interfaces = extensionPoint.getClass().getInterfaces();
         for (int i = 0; i < interfaces.length; i++) {

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java?view=diff&rev=538948&r1=538947&r2=538948
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ExtensionPointRegistry.java Thu May 17 07:46:42 2007
@@ -21,7 +21,9 @@
 
 
 /**
- * The registry for the Tuscany core extension points.
+ * The registry for the Tuscany core extension points. As the point of contact 
+ * for all extension artifacts this registry allows loaded extensions to find 
+ * all other parts of the system and register themselves appropriately.
  * 
  * @version $Rev$ $Date$
  */

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModelFactoryExtensionPoint.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModelFactoryExtensionPoint.java?view=diff&rev=538948&r1=538947&r2=538948
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModelFactoryExtensionPoint.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModelFactoryExtensionPoint.java Thu May 17 07:46:42 2007
@@ -20,7 +20,11 @@
 package org.apache.tuscany.sca.core;
 
 /**
- * An extension point for model factories.
+ * An extension point for model factories. Model factories are provided to 
+ * abstract the classes that represent artifacts in the assembly model away
+ * from their creation mechanism. When the runtime needs to extend the model
+ * as it reads in contributed artifacts it looks up the factory for the 
+ * artifact required in this registry
  *
  * @version $Rev$ $Date$
  */

Modified: incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java?view=diff&rev=538948&r1=538947&r2=538948
==============================================================================
--- incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java (original)
+++ incubator/tuscany/java/sca/modules/core-spi/src/main/java/org/apache/tuscany/sca/core/ModuleActivator.java Thu May 17 07:46:42 2007
@@ -21,12 +21,20 @@
 
 
 /**
- * ModuleActivator represents a module that plugs into the Tuscany system. Each module should
- * provide an implementation of this interface and registry the implementation class by defining 
- * a file named as "META-INF/services/org.apache.tuscany.spi.bootstrp.ModuleActivator". The
- * content of the file is the class name of the implementation. The implementation class must
- * have a no-arg constructor. The same instance will be used to invoke all the methods during
- * different phases of the module activation.
+ * ModuleActivator represents a module that plugs into the Tuscany system. Each 
+ * module should provide an implementation of this interface and register the 
+ * ModuleActivator implementation class by defining a file named 
+ * 
+ * "META-INF/services/org.apache.tuscany.spi.bootstrp.ModuleActivator"
+ * 
+ * The content of the file is the class name of the ModuleActivator implementation. 
+ * The implementation class must have a no-arg constructor. The same instance 
+ * will be used to invoke all the methods during different phases of the module 
+ * activation. Note that the start and stop methods defined by this interface
+ * take a reference to the Tuscany SCA runtime ExtensionPointRegistry. This 
+ * gives the ModuleActivator the oppotunity to add extension points to the
+ * registry as it is requested to start up and remove them when it is requested
+ * to shut down.
  * 
  * @version $Rev$ $Date$
  */



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org