Author: jmarino
Date: Sat Dec  9 11:34:09 2006
New Revision: 485051

URL: http://svn.apache.org/viewvc?view=rev&rev=485051
Log:
checkstyle and PMD fixes; improve error reporting in loader registry

Added:
    
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidConfigurationException.java
   (with props)
Modified:
    
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueInterceptor.java
    
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java
    
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessor.java
    
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/LoaderRegistryImpl.java
    
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKCallbackInvocationHandler.java
    
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java
    
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/integration/CallbackInvocationTestCase.java
    
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessorTestCase.java
    
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java
    
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/PojoComponentType.java

Modified: 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueInterceptor.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueInterceptor.java?view=diff&rev=485051&r1=485050&r2=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueInterceptor.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueInterceptor.java
 Sat Dec  9 11:34:09 2006
@@ -26,15 +26,14 @@
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamClass;
 import java.io.Serializable;
-import java.math.BigDecimal;
-import java.math.BigInteger;
 import java.util.IdentityHashMap;
 import java.util.Map;
 
-import org.apache.tuscany.core.util.JavaIntrospectionHelper;
 import org.apache.tuscany.spi.wire.Interceptor;
 import org.apache.tuscany.spi.wire.Message;
 
+import org.apache.tuscany.core.util.JavaIntrospectionHelper;
+
 /**
  * An interceptor to enforce pass-by-value semantics for remotable interfaces
  */
@@ -47,7 +46,7 @@
 
     public Message invoke(Message msg) {
         Object obj = msg.getBody();
-        msg.setBody(copy((Object[])obj));
+        msg.setBody(copy((Object[]) obj));
         Message result = next.invoke(msg);
         if (!result.isFault()) {
             result.setBody(copy(result.getBody()));
@@ -91,7 +90,7 @@
             return null;
         }
         final Class cls = arg.getClass();
-        if ( JavaIntrospectionHelper.isImmutable(cls))  {
+        if (JavaIntrospectionHelper.isImmutable(cls)) {
             // Immutable classes
             return arg;
         }
@@ -109,8 +108,7 @@
                     @Override
                     protected Class<?> resolveClass(ObjectStreamClass desc) 
throws IOException, ClassNotFoundException {
                         try {
-                            Class<?> resolvedCls = 
Class.forName(desc.getName(), false, cls.getClassLoader());
-                            return resolvedCls;
+                            return Class.forName(desc.getName(), false, 
cls.getClassLoader());
                         } catch (ClassNotFoundException e) {
                             return super.resolveClass(desc);
                         }

Modified: 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java?view=diff&rev=485051&r1=485050&r2=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessor.java
 Sat Dec  9 11:34:09 2006
@@ -31,69 +31,72 @@
 import org.apache.tuscany.spi.wire.WirePostProcessorExtension;
 
 /**
- * This processor is responsible for enforcing the pass-by-value semantics 
required of Remotable interfaces.  
- * This is done by adding a pass-by-value interceptor to the inbound 
invocation chain of a target if
- * the target interface is Remotable.
+ * This processor is responsible for enforcing the pass-by-value semantics 
required of Remotable interfaces. This is
+ * done by adding a pass-by-value interceptor to the inbound invocation chain 
of a target if the target interface is
+ * Remotable.
  */
 public class PassByValueWirePostProcessor extends WirePostProcessorExtension {
-    
+
 
     public PassByValueWirePostProcessor() {
         super();
-        
+
     }
 
     public void process(OutboundWire source, InboundWire target) {
-        Interceptor tailInterceptor = null;
-        PassByValueInterceptor passByValueInterceptor = null;
-        Operation<?> targetOperation = null;
-        Operation<?> sourceOperation = null;
+        Interceptor tailInterceptor;
+        PassByValueInterceptor passByValueInterceptor;
+        Operation<?> targetOperation;
+        Operation<?> sourceOperation;
         boolean allowsPassByReference = false;
-        if ( target.getContainer() instanceof AtomicComponentExtension ) {
-            allowsPassByReference = 
-                
((AtomicComponentExtension)target.getContainer()).isAllowsPassByReference();
+        if (target.getContainer() instanceof AtomicComponentExtension) {
+            allowsPassByReference =
+                ((AtomicComponentExtension) 
target.getContainer()).isAllowsPassByReference();
         }
-        if ( target.getServiceContract().isRemotable() &&
-                !allowsPassByReference ) {
+        if (target.getServiceContract().isRemotable()
+            && !allowsPassByReference) {
             Map<Operation<?>, InboundInvocationChain> chains = 
target.getInvocationChains();
             for (Map.Entry<Operation<?>, InboundInvocationChain> entry : 
chains.entrySet()) {
                 passByValueInterceptor = new PassByValueInterceptor();
                 targetOperation = entry.getKey();
-                sourceOperation = 
+                sourceOperation =
                     getSourceOperation(source.getInvocationChains().keySet(), 
targetOperation.getName());
-               
+
                 entry.getValue().addInterceptor(0, passByValueInterceptor);
                 tailInterceptor = 
source.getInvocationChains().get(sourceOperation).getTailInterceptor();
-                if ( tailInterceptor != null ) {
+                if (tailInterceptor != null) {
                     tailInterceptor.setNext(passByValueInterceptor);
                 }
             }
         }
-        
+
         // Check if there's a callback
         Map callbackOperations = 
source.getServiceContract().getCallbackOperations();
         allowsPassByReference = false;
-        if ( source.getContainer() instanceof AtomicComponentExtension ) {
-            allowsPassByReference = 
-                
((AtomicComponentExtension)source.getContainer()).isAllowsPassByReference();
+        if (source.getContainer() instanceof AtomicComponentExtension) {
+            allowsPassByReference =
+                ((AtomicComponentExtension) 
source.getContainer()).isAllowsPassByReference();
         }
-        
-        if ( source.getServiceContract().isRemotable() && 
!allowsPassByReference ) {
-            if (callbackOperations != null && !callbackOperations.isEmpty()) {
-                Object targetAddress = source.getContainer().getName();
-                Map<Operation<?>, InboundInvocationChain> callbackChains = 
source.getTargetCallbackInvocationChains();
-                for (Map.Entry<Operation<?>, InboundInvocationChain> entry : 
callbackChains.entrySet()) {
-                    passByValueInterceptor = new PassByValueInterceptor();
-                    targetOperation = entry.getKey();
-                    sourceOperation = 
-                        
getSourceOperation(target.getSourceCallbackInvocationChains(targetAddress).keySet(),
 targetOperation.getName());
-                    
-                    entry.getValue().addInterceptor(0, passByValueInterceptor);
-                    tailInterceptor = 
-                        
target.getSourceCallbackInvocationChains(targetAddress).get(sourceOperation).getTailInterceptor();
-                    if ( tailInterceptor != null ) {
-                        tailInterceptor.setNext(passByValueInterceptor);
-                    }
+
+        if (source.getServiceContract().isRemotable()
+            && !allowsPassByReference
+            && callbackOperations != null
+            && !callbackOperations.isEmpty()) {
+            Object targetAddress = source.getContainer().getName();
+            Map<Operation<?>, InboundInvocationChain> callbackChains = 
source.getTargetCallbackInvocationChains();
+            for (Map.Entry<Operation<?>, InboundInvocationChain> entry : 
callbackChains.entrySet()) {
+                passByValueInterceptor = new PassByValueInterceptor();
+                targetOperation = entry.getKey();
+                sourceOperation =
+                    
getSourceOperation(target.getSourceCallbackInvocationChains(targetAddress).keySet(),
+                        targetOperation.getName());
+
+                entry.getValue().addInterceptor(0, passByValueInterceptor);
+                tailInterceptor =
+                    
target.getSourceCallbackInvocationChains(targetAddress).get(sourceOperation)
+                        .getTailInterceptor();
+                if (tailInterceptor != null) {
+                    tailInterceptor.setNext(passByValueInterceptor);
                 }
             }
         }
@@ -102,7 +105,7 @@
     public void process(InboundWire source, OutboundWire target) {
         //to be done if required.. 
     }
-    
+
     private Operation getSourceOperation(Set<Operation<?>> operations, String 
operationName) {
         for (Operation<?> op : operations) {
             if (op.getName().equals(operationName)) {

Modified: 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessor.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessor.java?view=diff&rev=485051&r1=485050&r2=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessor.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessor.java
 Sat Dec  9 11:34:09 2006
@@ -18,6 +18,8 @@
  */
 package org.apache.tuscany.core.implementation.processor;
 
+import org.osoa.sca.annotations.AllowsPassByReference;
+
 import org.apache.tuscany.spi.component.CompositeComponent;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import 
org.apache.tuscany.spi.implementation.java.ImplementationProcessorExtension;
@@ -26,10 +28,9 @@
 import org.apache.tuscany.spi.implementation.java.JavaMappedService;
 import org.apache.tuscany.spi.implementation.java.PojoComponentType;
 import org.apache.tuscany.spi.implementation.java.ProcessingException;
-import org.apache.tuscany.spi.model.Scope;
 
 /**
- * Processes the [EMAIL PROTECTED] Scope} annotation and updates the component 
type with the corresponding implmentation scope
+ * Processes [EMAIL PROTECTED] AllowsPassByReference} on an implementation
  *
  * @version $Rev: 479093 $ $Date: 2006-11-25 12:34:41 +0530 (Sat, 25 Nov 2006) 
$
  */
@@ -39,13 +40,12 @@
                                PojoComponentType<JavaMappedService, 
JavaMappedReference, JavaMappedProperty<?>> type,
                                DeploymentContext context)
         throws ProcessingException {
-        org.osoa.sca.annotations.AllowsPassByReference annotation = 
-            
clazz.getAnnotation(org.osoa.sca.annotations.AllowsPassByReference.class);
+        AllowsPassByReference annotation = 
clazz.getAnnotation(AllowsPassByReference.class);
         if (annotation != null) {
             type.setAllowsPassByReference(true);
         } else {
             type.setAllowsPassByReference(false);
         }
-            
+
     }
 }

Modified: 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/LoaderRegistryImpl.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/LoaderRegistryImpl.java?view=diff&rev=485051&r1=485050&r2=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/LoaderRegistryImpl.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/loader/LoaderRegistryImpl.java
 Sat Dec  9 11:34:09 2006
@@ -33,6 +33,7 @@
 import org.apache.tuscany.spi.component.CompositeComponent;
 import org.apache.tuscany.spi.deployer.DeploymentContext;
 import org.apache.tuscany.spi.loader.ComponentTypeLoader;
+import org.apache.tuscany.spi.loader.InvalidConfigurationException;
 import org.apache.tuscany.spi.loader.LoaderException;
 import org.apache.tuscany.spi.loader.LoaderRegistry;
 import org.apache.tuscany.spi.loader.StAXElementLoader;
@@ -136,7 +137,8 @@
             sfe.setResourceURI(url.toString());
             throw sfe;
         } catch (XMLStreamException e) {
-            LoaderException sfe = new LoaderException(e);
+            InvalidConfigurationException sfe = new 
InvalidConfigurationException("Invalid or missing resource", e);
+            sfe.setIdentifier(url.toString());
             sfe.setResourceURI(url.toString());
             throw sfe;
         }

Modified: 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKCallbackInvocationHandler.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKCallbackInvocationHandler.java?view=diff&rev=485051&r1=485050&r2=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKCallbackInvocationHandler.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/wire/jdk/JDKCallbackInvocationHandler.java
 Sat Dec  9 11:34:09 2006
@@ -28,10 +28,12 @@
 import java.util.LinkedList;
 import java.util.Map;
 
+import org.osoa.sca.NoRegisteredCallbackException;
+
+import org.apache.tuscany.spi.component.AtomicComponent;
 import org.apache.tuscany.spi.component.ReactivationException;
 import org.apache.tuscany.spi.component.SCAExternalizable;
 import org.apache.tuscany.spi.component.WorkContext;
-import org.apache.tuscany.spi.component.AtomicComponent;
 import static org.apache.tuscany.spi.idl.java.JavaIDLUtils.findOperation;
 import org.apache.tuscany.spi.model.Operation;
 import org.apache.tuscany.spi.wire.AbstractOutboundInvocationHandler;
@@ -39,7 +41,6 @@
 import org.apache.tuscany.spi.wire.OutboundInvocationChain;
 import org.apache.tuscany.spi.wire.TargetInvoker;
 import org.apache.tuscany.spi.wire.WireInvocationHandler;
-import org.osoa.sca.NoRegisteredCallbackException;
 
 
 /**
@@ -82,7 +83,7 @@
         }
         Object correlationId = context.getCurrentCorrelationId();
         context.setCurrentCorrelationId(null);
-        LinkedList<Object> callbackRoutingChain = 
(LinkedList<Object>)context.getCurrentCallbackRoutingChain().clone();
+        LinkedList<Object> callbackRoutingChain = (LinkedList<Object>) 
context.getCurrentCallbackRoutingChain().clone();
         if (callbackRoutingChain == null) {
             throw new AssertionError("Missing stack of from addresses");
         }
@@ -96,10 +97,10 @@
         Operation operation = findOperation(method, 
sourceCallbackInvocationChains.keySet());
         OutboundInvocationChain chain = 
sourceCallbackInvocationChains.get(operation);
         TargetInvoker invoker = chain.getTargetInvoker();
-        
+
         try {
             return invoke(chain, invoker, args, correlationId, 
callbackRoutingChain);
-        } catch(InvocationTargetException e) {
+        } catch (InvocationTargetException e) {
             Throwable t = e.getCause();
             if (t instanceof NoRegisteredCallbackException) {
                 throw t;

Modified: 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java?view=diff&rev=485051&r1=485050&r2=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/databinding/impl/PassByValueWirePostProcessorTestCase.java
 Sat Dec  9 11:34:09 2006
@@ -19,25 +19,12 @@
 
 package org.apache.tuscany.core.databinding.impl;
 
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-
 import java.lang.reflect.Type;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 
-import junit.framework.TestCase;
-
-import org.apache.tuscany.core.component.scope.ModuleScopeContainer;
-import org.apache.tuscany.core.implementation.PojoConfiguration;
-import org.apache.tuscany.core.implementation.java.JavaAtomicComponent;
-import org.apache.tuscany.core.injection.PojoObjectFactory;
-import org.apache.tuscany.core.wire.InboundInvocationChainImpl;
-import org.apache.tuscany.core.wire.OutboundInvocationChainImpl;
-import org.apache.tuscany.core.wire.SynchronousBridgingInterceptor;
 import org.apache.tuscany.spi.ObjectCreationException;
-import org.apache.tuscany.spi.component.ScopeContainer;
 import org.apache.tuscany.spi.component.TargetException;
 import org.apache.tuscany.spi.extension.AtomicComponentExtension;
 import org.apache.tuscany.spi.idl.java.JavaServiceContract;
@@ -49,11 +36,18 @@
 import org.apache.tuscany.spi.wire.OutboundInvocationChain;
 import org.apache.tuscany.spi.wire.OutboundWire;
 import org.apache.tuscany.spi.wire.TargetInvoker;
+
+import junit.framework.TestCase;
+import org.apache.tuscany.core.wire.InboundInvocationChainImpl;
+import org.apache.tuscany.core.wire.OutboundInvocationChainImpl;
+import org.apache.tuscany.core.wire.SynchronousBridgingInterceptor;
 import org.easymock.EasyMock;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
 
 /**
- * Testcase for testing if the PassByValueWireProcessor adds the 
PassByValueInterceptor to the invocation chains and also ensure that the 
outbound and
- * inbound chain of interceptors are linked after this insertion
+ * Testcase for testing if the PassByValueWireProcessor adds the 
PassByValueInterceptor to the invocation chains and
+ * also ensure that the outbound and inbound chain of interceptors are linked 
after this insertion
  */
 public class PassByValueWirePostProcessorTestCase extends TestCase {
     private PassByValueWirePostProcessor processor;
@@ -73,16 +67,16 @@
         ServiceContract<Type> serviceContract = new JavaServiceContract(null);
         serviceContract.setRemotable(true);
         Map<Operation<?>, InboundInvocationChain> inChainsMap =
-                new Hashtable<Operation<?>, InboundInvocationChain>();
+            new Hashtable<Operation<?>, InboundInvocationChain>();
 
-        Operation<?> operation1 = new Operation("testMethod", null, null, 
null);
-        InboundInvocationChainImpl inChain = new 
InboundInvocationChainImpl(operation1);  
+        Operation<?> operation1 = new Operation<Type>("testMethod", null, 
null, null);
+        InboundInvocationChainImpl inChain = new 
InboundInvocationChainImpl(operation1);
         inChainsMap.put(operation1, inChain);
-        
+
         AtomicComponentExtension componentExtn = new FooComponent();
 
         Map<Operation<?>, OutboundInvocationChain> outChainsMap =
-                new Hashtable<Operation<?>, OutboundInvocationChain>();
+            new Hashtable<Operation<?>, OutboundInvocationChain>();
         OutboundInvocationChainImpl outChain = new 
OutboundInvocationChainImpl(operation1);
         outChainsMap.put(operation1, outChain);
 
@@ -92,7 +86,7 @@
         expect(inboundWire.getInvocationChains()).andReturn(inChainsMap);
         
expect(outboundWire.getServiceContract()).andReturn(serviceContract).times(2);
         
expect(outboundWire.getInvocationChains()).andReturn(outChainsMap).times(2);
-        
+
         Interceptor inInterceptor = createMock(Interceptor.class);
         Interceptor outInterceptor = createMock(Interceptor.class);
         inChain.addInterceptor(0, inInterceptor);
@@ -104,12 +98,12 @@
 
         assertEquals(true, inChain.getHeadInterceptor() instanceof 
PassByValueInterceptor);
         assertEquals(true,
-                outChain.getTailInterceptor().getNext() instanceof 
PassByValueInterceptor);
+            outChain.getTailInterceptor().getNext() instanceof 
PassByValueInterceptor);
         assertEquals(true, outChain.getTailInterceptor().getNext().equals(
-                inChain.getHeadInterceptor()));
+            inChain.getHeadInterceptor()));
 
     }
-    
+
     public void testProcessExclusionOfInterceptorWhenAllowsPassByReference() {
         InboundWire inboundWire = createMock(InboundWire.class);
         OutboundWire outboundWire = createMock(OutboundWire.class);
@@ -117,18 +111,18 @@
         ServiceContract<Type> serviceContract = new JavaServiceContract(null);
         serviceContract.setRemotable(true);
         Map<Operation<?>, InboundInvocationChain> inChainsMap =
-                new Hashtable<Operation<?>, InboundInvocationChain>();
+            new Hashtable<Operation<?>, InboundInvocationChain>();
 
-        Operation<?> operation1 = new Operation("testMethod", null, null, 
null);
-        InboundInvocationChainImpl inChain = new 
InboundInvocationChainImpl(operation1); 
+        Operation<?> operation1 = new Operation<Type>("testMethod", null, 
null, null);
+        InboundInvocationChainImpl inChain = new 
InboundInvocationChainImpl(operation1);
         inChainsMap.put(operation1, inChain);
-        
+
         AtomicComponentExtension componentExtn = new FooComponent();
         componentExtn.setAllowsPassByReference(true);
-        
+
 
         Map<Operation<?>, OutboundInvocationChain> outChainsMap =
-                new Hashtable<Operation<?>, OutboundInvocationChain>();
+            new Hashtable<Operation<?>, OutboundInvocationChain>();
         OutboundInvocationChainImpl outChain = new 
OutboundInvocationChainImpl(operation1);
         outChainsMap.put(operation1, outChain);
 
@@ -138,7 +132,7 @@
         expect(inboundWire.getInvocationChains()).andReturn(inChainsMap);
         
expect(outboundWire.getServiceContract()).andReturn(serviceContract).times(2);
         
expect(outboundWire.getInvocationChains()).andReturn(outChainsMap).times(2);
-        
+
         Interceptor inInterceptor = createMock(Interceptor.class);
         Interceptor outInterceptor = createMock(Interceptor.class);
         inChain.addInterceptor(0, inInterceptor);
@@ -150,17 +144,17 @@
 
         assertEquals(false, inChain.getHeadInterceptor() instanceof 
PassByValueInterceptor);
         assertEquals(false,
-                outChain.getTailInterceptor().getNext() instanceof 
PassByValueInterceptor);
+            outChain.getTailInterceptor().getNext() instanceof 
PassByValueInterceptor);
         assertEquals(true, outChain.getTailInterceptor().getNext().equals(
-                inChain.getHeadInterceptor()));
+            inChain.getHeadInterceptor()));
     }
-    
+
     private class FooComponent extends AtomicComponentExtension {
 
         public FooComponent() {
-            super(null,null,null, null, null, null, null, 0);
+            super(null, null, null, null, null, null, null, 0);
         }
-        
+
         public Object createInstance() throws ObjectCreationException {
             // TODO Auto-generated method stub
             return null;
@@ -185,6 +179,6 @@
             // TODO Auto-generated method stub
             return null;
         }
-        
+
     }
 }

Modified: 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/integration/CallbackInvocationTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/integration/CallbackInvocationTestCase.java?view=diff&rev=485051&r1=485050&r2=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/integration/CallbackInvocationTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/java/integration/CallbackInvocationTestCase.java
 Sat Dec  9 11:34:09 2006
@@ -94,7 +94,7 @@
         wireService.createWires(clientComponent, sourceDefinition);
         container.register(clientComponent);
 
-        Connector connector = new ConnectorImpl(new JDKWireService(), null, 
scheduler , workContext);
+        Connector connector = new ConnectorImpl(new JDKWireService(), null, 
scheduler, workContext);
 
         connector.connect(clientComponent);
         FooClient client = (FooClient) clientComponent.getServiceInstance();
@@ -125,7 +125,7 @@
         wireService.createWires(clientComponent, sourceDefinition);
         container.register(clientComponent);
 
-        Connector connector = new ConnectorImpl(new JDKWireService(), null, 
scheduler , workContext);
+        Connector connector = new ConnectorImpl(new JDKWireService(), null, 
scheduler, workContext);
 
         connector.connect(clientComponent);
         FooPlainClient client = (FooPlainClient) 
clientComponent.getServiceInstance();
@@ -193,7 +193,7 @@
     }
 
     private ComponentDefinition<JavaImplementation> createSource(String name)
-    throws NoSuchMethodException, URISyntaxException, 
InvalidServiceContractException {
+        throws NoSuchMethodException, URISyntaxException, 
InvalidServiceContractException {
         ConstructorDefinition<FooClient> ctorDef =
             new 
ConstructorDefinition<FooClient>(FooClient.class.getConstructor());
         PojoComponentType<JavaMappedService, JavaMappedReference, 
JavaMappedProperty<?>> type =
@@ -219,7 +219,7 @@
     }
 
     private ComponentDefinition<JavaImplementation> createPlainSource(String 
name)
-    throws NoSuchMethodException, URISyntaxException, 
InvalidServiceContractException {
+        throws NoSuchMethodException, URISyntaxException, 
InvalidServiceContractException {
         ConstructorDefinition<FooPlainClient> ctorDef =
             new 
ConstructorDefinition<FooPlainClient>(FooPlainClient.class.getConstructor());
         PojoComponentType<JavaMappedService, JavaMappedReference, 
JavaMappedProperty<?>> type =
@@ -247,7 +247,9 @@
     @Callback(FooCallback.class)
     public static interface Foo {
         void call();
+
         void callMultiCallback();
+
         void callFromPlain();
     }
 
@@ -265,7 +267,7 @@
         public void call() {
             callback.callback();
         }
-        
+
         public void callMultiCallback() {
             callback.multiCallback();
             callback.multiCallback();
@@ -302,7 +304,7 @@
             }
             invoked = true;
         }
-        
+
         public void multiCallback() {
             count++;
         }
@@ -318,6 +320,7 @@
 
     public interface FooCallback {
         void callback();
+
         void multiCallback();
     }
 
@@ -335,13 +338,13 @@
         public void invoke() {
             foo.callFromPlain();
         }
-        
+
         public void callback() {
-            
+
         }
-        
+
         public void multiCallback() {
-            
+
         }
     }
 

Modified: 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessorTestCase.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessorTestCase.java?view=diff&rev=485051&r1=485050&r2=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessorTestCase.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/core/src/test/java/org/apache/tuscany/core/implementation/processor/AllowsPassByReferenceProcessorTestCase.java
 Sat Dec  9 11:34:09 2006
@@ -18,19 +18,14 @@
  */
 package org.apache.tuscany.core.implementation.processor;
 
-import static org.apache.tuscany.spi.model.OverrideOptions.MUST;
-import junit.framework.TestCase;
+import org.osoa.sca.annotations.AllowsPassByReference;
 
-import org.apache.tuscany.core.idl.java.JavaInterfaceProcessorRegistryImpl;
-import org.apache.tuscany.spi.implementation.java.DuplicatePropertyException;
-import org.apache.tuscany.spi.implementation.java.IllegalPropertyException;
 import org.apache.tuscany.spi.implementation.java.JavaMappedProperty;
 import org.apache.tuscany.spi.implementation.java.JavaMappedReference;
 import org.apache.tuscany.spi.implementation.java.JavaMappedService;
 import org.apache.tuscany.spi.implementation.java.PojoComponentType;
-import org.apache.tuscany.spi.model.OverrideOptions;
-import org.osoa.sca.annotations.AllowsPassByReference;
-import org.osoa.sca.annotations.Property;
+
+import junit.framework.TestCase;
 
 /**
  * @version $Rev: 452761 $ $Date: 2006-10-04 12:03:20 +0530 (Wed, 04 Oct 2006) 
$
@@ -43,7 +38,7 @@
     public void testClassAnnotation() throws Exception {
         processor.visitClass(null, Foo.class, type, null);
         assertEquals(true, type.isAllowsPassByReference());
-        
+
         processor.visitClass(null, Bar.class, type, null);
         assertEquals(false, type.isAllowsPassByReference());
     }
@@ -51,7 +46,6 @@
     protected void setUp() throws Exception {
         super.setUp();
         type = new PojoComponentType<JavaMappedService, JavaMappedReference, 
JavaMappedProperty<?>>();
-        JavaInterfaceProcessorRegistryImpl registry = new 
JavaInterfaceProcessorRegistryImpl();
         processor = new AllowsPassByReferenceProcessor();
     }
 

Modified: 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java?view=diff&rev=485051&r1=485050&r2=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/extension/AtomicComponentExtension.java
 Sat Dec  9 11:34:09 2006
@@ -55,15 +55,7 @@
     private final int initLevel;
     private final long maxIdleTime;
     private final long maxAge;
-    private boolean allowsPassByReference = false;
-
-    public boolean isAllowsPassByReference() {
-        return allowsPassByReference;
-    }
-
-    public void setAllowsPassByReference(boolean allowsPassByReference) {
-        this.allowsPassByReference = allowsPassByReference;
-    }
+    private boolean allowsPassByReference;
 
     protected AtomicComponentExtension(String name,
                                        CompositeComponent parent,
@@ -117,6 +109,14 @@
 
     public long getMaxAge() {
         return maxAge;
+    }
+
+    public boolean isAllowsPassByReference() {
+        return allowsPassByReference;
+    }
+
+    public void setAllowsPassByReference(boolean allowsPassByReference) {
+        this.allowsPassByReference = allowsPassByReference;
     }
 
     public void start() throws CoreRuntimeException {

Modified: 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/PojoComponentType.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/PojoComponentType.java?view=diff&rev=485051&r1=485050&r2=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/PojoComponentType.java
 (original)
+++ 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/implementation/java/PojoComponentType.java
 Sat Dec  9 11:34:09 2006
@@ -36,8 +36,8 @@
 public class PojoComponentType<S extends ServiceDefinition, R extends 
ReferenceDefinition,  P extends Property<?>>
     extends ComponentType<S, R, P> {
 
-    private boolean allowsPassByReference = false;
     private Scope implementationScope = Scope.UNDEFINED;
+    private boolean allowsPassByReference;
     private ConstructorDefinition<?> constructorDefinition;
     private Method initMethod;
     private Method destroyMethod;

Added: 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidConfigurationException.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidConfigurationException.java?view=auto&rev=485051
==============================================================================
--- 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidConfigurationException.java
 (added)
+++ 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidConfigurationException.java
 Sat Dec  9 11:34:09 2006
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tuscany.spi.loader;
+
+/**
+ * Denotes an invalid configuration artifact
+ *
+ * @version $Rev$ $Date$
+ */
+public class InvalidConfigurationException extends LoaderException {
+    public InvalidConfigurationException() {
+    }
+
+    public InvalidConfigurationException(String message) {
+        super(message);
+    }
+
+    public InvalidConfigurationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public InvalidConfigurationException(Throwable cause) {
+        super(cause);
+    }
+}

Propchange: 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidConfigurationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/loader/InvalidConfigurationException.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



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

Reply via email to