Author: jsdelfino
Date: Wed Jan  2 13:00:32 2008
New Revision: 608226

URL: http://svn.apache.org/viewvc?rev=608226&view=rev
Log:
Cleanup. Added comments, fixed incorrect comments.

Modified:
    
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/CRUDImplementation.java
    
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/impl/CRUDImplementationFactoryImpl.java
    
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationInvoker.java
    
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationProvider.java
    
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationProviderFactory.java
    
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/test/java/crud/CRUDTestCase.java

Modified: 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/CRUDImplementation.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/CRUDImplementation.java?rev=608226&r1=608225&r2=608226&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/CRUDImplementation.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/CRUDImplementation.java
 Wed Jan  2 13:00:32 2008
@@ -22,12 +22,14 @@
 
 /**
  * The model representing a sample CRUD implementation in an SCA assembly 
model.
+ * 
  * The sample CRUD implementation is not a full blown implementation, it only
- * supports a subset of what a component implementation can support: - a single
- * fixed service (as opposed to a list of services typed by different
- * interfaces) - a directory attribute used to specify where a CRUD component 
is
- * going to persist resources - no references or properties - no policy intents
- * or policy sets
+ * supports a subset of what a component implementation can support:
+ * - a single fixed service (as opposed to a list of services typed by 
different interfaces
+ * - a directory attribute used to specify where a CRUD component is going to 
persist
+ * resources
+ * - no references or properties
+ * - no policy intents or policy sets
  */
 public interface CRUDImplementation extends Implementation {
 

Modified: 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/impl/CRUDImplementationFactoryImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/impl/CRUDImplementationFactoryImpl.java?rev=608226&r1=608225&r2=608226&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/impl/CRUDImplementationFactoryImpl.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/impl/CRUDImplementationFactoryImpl.java
 Wed Jan  2 13:00:32 2008
@@ -28,7 +28,7 @@
 
 
 /**
- * A default factory for the CRUD implementation model.
+ * A factory for the CRUD implementation model.
  */
 public class CRUDImplementationFactoryImpl implements 
CRUDImplementationFactory {
     

Modified: 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationInvoker.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationInvoker.java?rev=608226&r1=608225&r2=608226&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationInvoker.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationInvoker.java
 Wed Jan  2 13:00:32 2008
@@ -27,12 +27,20 @@
 
 
 /**
- * Implements a target invoker for CRUD component implementations.
+ * Implements an invoker for CRUD component implementations.
  * 
- * The target invoker is responsible for dispatching invocations to the 
particular
- * component implementation logic. In this example we are simply delegating the
- * CRUD operation invocations to the corresponding methods on our fake
- * resource manager.
+ * The invoker is responsible for handling invocations of a business operation.
+ * Input business data is passed to the invoke method in a Message object.
+ * The invoke method is responsible for handling the invocation and returning 
a Message with
+ * the output business data. 
+ * 
+ * In this example we are simply delegating the CRUD operation invocations to 
the
+ * corresponding methods on our fake resource manager class.
+ * 
+ * More sophisticated invokers can delegate the invocation to an 
implementation artifact directly
+ * (for example a Java class using reflection as in the implementation-pojo 
sample) or call a runtime
+ * engine like a BPEL engine or an XQuery engine for example (this is what the 
Tuscany
+ * implementation-bpel and implementation-xquery extensions do).
  */
 class CRUDImplementationInvoker implements Invoker {
     private Operation operation;

Modified: 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationProvider.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationProvider.java?rev=608226&r1=608225&r2=608226&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationProvider.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationProvider.java
 Wed Jan  2 13:00:32 2008
@@ -29,13 +29,18 @@
 
 
 /**
- * The model representing a sample CRUD implementation in an SCA assembly 
model.
- * The sample CRUD implementation is not a full blown implementation, it only
- * supports a subset of what a component implementation can support: - a single
- * fixed service (as opposed to a list of services typed by different
- * interfaces) - a directory attribute used to specify where a CRUD component 
is
- * going to persist resources - no references or properties - no policy intents
- * or policy sets
+ * An implementation provider for sample CRUD implementations.
+ * 
+ * The implementation provider is responsible for handling the lifecycle of a 
component
+ * implementation and creating operation invokers for the service operations 
provided
+ * by the implementation.
+ * 
+ * The start() and stop() methods are called when a component is started
+ * and stopped.
+ *
+ * The createInvoker method is called for each operation provided by the 
component
+ * implementation. The implementation provider can create an invoker and 
initialize it
+ * at that time to minimize the amount of work to be performed on each 
invocation.  
  */
 class CRUDImplementationProvider implements ImplementationProvider {
     

Modified: 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationProviderFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationProviderFactory.java?rev=608226&r1=608225&r2=608226&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationProviderFactory.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/main/java/crud/provider/CRUDImplementationProviderFactory.java
 Wed Jan  2 13:00:32 2008
@@ -28,13 +28,10 @@
 
 
 /**
- * The model representing a sample CRUD implementation in an SCA assembly 
model.
- * The sample CRUD implementation is not a full blown implementation, it only
- * supports a subset of what a component implementation can support: - a single
- * fixed service (as opposed to a list of services typed by different
- * interfaces) - a directory attribute used to specify where a CRUD component 
is
- * going to persist resources - no references or properties - no policy intents
- * or policy sets
+ * A factory for CRUD implementation providers.
+ * 
+ *  The factory is called to create an implementation provider for each 
component using
+ *  the CRUD implementation.
  */
 public class CRUDImplementationProviderFactory implements 
ImplementationProviderFactory<CRUDImplementation> {
 

Modified: 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/test/java/crud/CRUDTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-crud-extension/src/test/java/crud/CRUDTestCase.java?rev=608226&r1=608225&r2=608226&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/test/java/crud/CRUDTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-crud-extension/src/test/java/crud/CRUDTestCase.java
 Wed Jan  2 13:00:32 2008
@@ -26,42 +26,35 @@
 import crud.CRUD;
 
 /**
- * Tests the CRUD service
+ * Tests the CRUD implementation extension.
  */
 public class CRUDTestCase extends TestCase {
 
     private SCADomain scaDomain;
     private CRUD crudService;
     
-    /**
-     * @throws java.lang.Exception
-     */
     @Override
     protected void setUp() throws Exception {
         scaDomain = SCADomain.newInstance("crud.composite");
         crudService = scaDomain.getService(CRUD.class, "CRUDServiceComponent");
     }
 
-    /**
-     * @throws java.lang.Exception
-     */
     @Override
     protected void tearDown() throws Exception {
         scaDomain.close();
     }
-
     
     public void testCRUD() throws Exception {
         String id = crudService.create("ABC");
         Object result = crudService.retrieve(id);
         assertEquals("ABC", result);
+        
         crudService.update(id, "EFG");
         result = crudService.retrieve(id);
         assertEquals("EFG", result);
+        
         crudService.delete(id);
         result = crudService.retrieve(id);
         assertNull(result);
     }
-
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to