Author: jsdelfino
Date: Wed Jan  2 13:38:19 2008
New Revision: 608238

URL: http://svn.apache.org/viewvc?rev=608238&view=rev
Log:
Added more relevant comments.

Modified:
    
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationImpl.java
    
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationProcessor.java
    
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationInvoker.java
    
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationProvider.java
    
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationProviderFactory.java
    
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/test/java/helloworld/HelloWorldTestCase.java

Modified: 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationImpl.java?rev=608238&r1=608237&r2=608238&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationImpl.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationImpl.java
 Wed Jan  2 13:38:19 2008
@@ -21,7 +21,6 @@
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;

Modified: 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationProcessor.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationProcessor.java?rev=608238&r1=608237&r2=608238&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationProcessor.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/impl/POJOImplementationProcessor.java
 Wed Jan  2 13:38:19 2008
@@ -117,7 +117,7 @@
         // First resolve its class
         ClassReference classReference = new 
ClassReference(implementation.getPOJOName());
         classReference = resolver.resolveModel(ClassReference.class, 
classReference);
-        Class pojoClass = classReference.getJavaClass();
+        Class<?> pojoClass = classReference.getJavaClass();
         if (pojoClass == null) {
             throw new ContributionResolveException("Class could not be 
resolved: " + implementation.getPOJOName());
         }

Modified: 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationInvoker.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationInvoker.java?rev=608238&r1=608237&r2=608238&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationInvoker.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationInvoker.java
 Wed Jan  2 13:38:19 2008
@@ -27,6 +27,23 @@
 import org.apache.tuscany.sca.invocation.Message;
 import org.osoa.sca.ServiceRuntimeException;
 
+/**
+ * Implements an invoker for POJO component implementations.
+ * 
+ * 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 operation invocations to the
+ * corresponding methods on the POJO implementation class using Java 
reflection.
+ * 
+ * Depending on the type of implementation being handled, more sophisticated 
invokers can
+ * use other techniques to delegate the invocation to the implementation 
artifact directly, call a
+ * runtime engine like a BPEL engine or an XQuery engine (this is what the 
Tuscany 
+ * implementation-bpel and implementation-xquery extensions do) or just 
completely handle the
+ * invocation in the invoker itself if the implementation has a fixed behavior 
for example.
+ */
 class POJOImplementationInvoker implements Invoker {
 
     private Object pojoInstance;

Modified: 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationProvider.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationProvider.java?rev=608238&r1=608237&r2=608238&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationProvider.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationProvider.java
 Wed Jan  2 13:38:19 2008
@@ -30,13 +30,23 @@
 import pojo.POJOImplementation;
 
 /**
- * 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. In this example we are using that opportunity to call init and 
destroy methods
+ * on the POJO instance if these methods exist.
+ *
+ * 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.
+ * 
+ * For example here we are looking up the Java method corresponding to the 
service operation
+ * at passing it to the invoker constructor. This way the invoker won't have 
to lookup the Java
+ * method on each invocation.  
  */
 class POJOImplementationProvider implements ImplementationProvider {
     

Modified: 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationProviderFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationProviderFactory.java?rev=608238&r1=608237&r2=608238&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationProviderFactory.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/main/java/pojo/provider/POJOImplementationProviderFactory.java
 Wed Jan  2 13:38:19 2008
@@ -26,7 +26,7 @@
 import pojo.POJOImplementation;
 
 /**
- * The model representing a sample POJO implementation in an SCA assembly 
model.
+ * A factory for POJO implementation providers.
  */
 public class POJOImplementationProviderFactory implements 
ImplementationProviderFactory<POJOImplementation> {
     

Modified: 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/test/java/helloworld/HelloWorldTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/test/java/helloworld/HelloWorldTestCase.java?rev=608238&r1=608237&r2=608238&view=diff
==============================================================================
--- 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/test/java/helloworld/HelloWorldTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/samples/implementation-pojo-extension/src/test/java/helloworld/HelloWorldTestCase.java
 Wed Jan  2 13:38:19 2008
@@ -23,6 +23,7 @@
 import org.apache.tuscany.sca.host.embedded.SCADomain;
 
 /**
+ * Tests the POJO implementation extension.
  */
 public class HelloWorldTestCase extends TestCase {
     



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

Reply via email to