You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ge...@apache.org on 2007/06/23 11:01:57 UTC
svn commit: r550026 - in /incubator/servicemix/trunk/sandbox/servicemix-sca:
./ src/main/java/org/apache/servicemix/sca/
src/main/java/org/apache/servicemix/sca/assembly/impl/
src/main/java/org/apache/servicemix/sca/builder/
src/main/java/org/apache/se...
Author: gertv
Date: Sat Jun 23 02:01:56 2007
New Revision: 550026
URL: http://svn.apache.org/viewvc?view=rev&rev=550026
Log:
Fix for SM-976 and SM-973: PMD/CheckStyle violations in servicemix-sca
Modified:
incubator/servicemix/trunk/sandbox/servicemix-sca/pom.xml
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaComponent.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaDeployer.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaEndpoint.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaLifeCycle.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaServiceUnit.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiBindingImpl.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/ExternalJbiServiceBuilder.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/ExternalJbiServiceWireBuilder.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/JbiServiceEntryPointBuilder.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceClient.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceTargetInvoker.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/loader/JbiBindingLoader.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/BootstrapHelper.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/TuscanyRuntime.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/AssemblyLoaderTest.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/ScaComponentTest.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReportRequest.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReportResponse.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountService.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountServiceImpl.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountSummary.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteRequest.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteResponse.java
incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteService.java
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/pom.xml?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/pom.xml (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/pom.xml Sat Jun 23 02:01:56 2007
@@ -20,6 +20,19 @@
-->
<modelVersion>4.0.0</modelVersion>
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <name>Apache ServiceMix Repository</name>
+ <url>http://servicemix.org/m2-repo/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
<parent>
<groupId>org.apache.servicemix</groupId>
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaComponent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaComponent.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaComponent.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaComponent.java Sat Jun 23 02:01:56 2007
@@ -34,7 +34,7 @@
* @see org.servicemix.common.BaseComponent#createServiceUnitManager()
*/
public BaseServiceUnitManager createServiceUnitManager() {
- Deployer[] deployers = new Deployer[] { new ScaDeployer(this) };
+ Deployer[] deployers = new Deployer[] {new ScaDeployer(this)};
return new BaseServiceUnitManager(this, deployers);
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaDeployer.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaDeployer.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaDeployer.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaDeployer.java Sat Jun 23 02:01:56 2007
@@ -26,33 +26,33 @@
public class ScaDeployer extends AbstractDeployer {
- public static final String SCA_MODULE_FILE = "sca.module";
-
- public ScaDeployer(BaseComponent component) {
- super(component);
- }
+ public static final String SCA_MODULE_FILE = "sca.module";
- public boolean canDeploy(String serviceUnitName, String serviceUnitRootPath) {
- File module = new File(serviceUnitRootPath, SCA_MODULE_FILE);
- return module.exists() && module.isFile();
- }
+ public ScaDeployer(BaseComponent component) {
+ super(component);
+ }
- public ServiceUnit deploy(String serviceUnitName, String serviceUnitRootPath)
- throws DeploymentException {
- File module = new File(serviceUnitRootPath, SCA_MODULE_FILE);
- if (!module.exists() || !module.isFile()) {
+ public boolean canDeploy(String serviceUnitName, String serviceUnitRootPath) {
+ File module = new File(serviceUnitRootPath, SCA_MODULE_FILE);
+ return module.exists() && module.isFile();
+ }
+
+ public ServiceUnit deploy(String serviceUnitName, String serviceUnitRootPath)
+ throws DeploymentException {
+ File module = new File(serviceUnitRootPath, SCA_MODULE_FILE);
+ if (!module.exists() || !module.isFile()) {
throw failure("deploy", "No sca.module found", null);
- }
- try {
- ScaServiceUnit su = new ScaServiceUnit();
- su.setComponent(component);
- su.setName(serviceUnitName);
- su.setRootPath(serviceUnitRootPath);
- su.init();
- return su;
- } catch (Exception e) {
- throw failure("deploy", "Error loading sca module", e);
- }
- }
+ }
+ try {
+ ScaServiceUnit su = new ScaServiceUnit();
+ su.setComponent(component);
+ su.setName(serviceUnitName);
+ su.setRootPath(serviceUnitRootPath);
+ su.init();
+ return su;
+ } catch (Exception e) {
+ throw failure("deploy", "Error loading sca module", e);
+ }
+ }
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaEndpoint.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaEndpoint.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaEndpoint.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaEndpoint.java Sat Jun 23 02:01:56 2007
@@ -29,8 +29,8 @@
import javax.jbi.messaging.DeliveryChannel;
import javax.jbi.messaging.ExchangeStatus;
import javax.jbi.messaging.MessageExchange;
-import javax.jbi.messaging.NormalizedMessage;
import javax.jbi.messaging.MessageExchange.Role;
+import javax.jbi.messaging.NormalizedMessage;
import javax.jbi.servicedesc.ServiceEndpoint;
import javax.xml.bind.JAXBContext;
@@ -43,11 +43,11 @@
import org.apache.tuscany.model.assembly.EntryPoint;
/**
- *
+ *
* @author gnodet
* @version $Revision: 366467 $
* @org.apache.xbean.XBean element="endpoint" description="A sca endpoint"
- *
+ *
*/
public class ScaEndpoint extends Endpoint implements ExchangeProcessor {
@@ -90,7 +90,7 @@
classes.add(mth.getReturnType());
classes.add(params[0]);
}
- jaxbContext = JAXBContext.newInstance(classes.toArray(new Class[0]));
+ jaxbContext = JAXBContext.newInstance(classes.toArray(new Class[classes.size()]));
}
public void deactivate() throws Exception {
@@ -121,7 +121,7 @@
EntryPointContext entryPointContext = (EntryPointContext) ((ScaServiceUnit) serviceUnit)
.getTuscanyRuntime().getModuleContext().getContext(entryPoint.getName());
InvocationHandler handler = (InvocationHandler) entryPointContext.getImplementationInstance();
- output = handler.invoke(null, method, new Object[] { input });
+ output = handler.invoke(null, method, new Object[] {input});
} catch (UndeclaredThrowableException e) {
throw e;
} catch (RuntimeException e) {
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaLifeCycle.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaLifeCycle.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaLifeCycle.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaLifeCycle.java Sat Jun 23 02:01:56 2007
@@ -21,8 +21,8 @@
public class ScaLifeCycle extends BaseLifeCycle {
- public ScaLifeCycle(BaseComponent component) {
- super(component);
- }
+ public ScaLifeCycle(BaseComponent component) {
+ super(component);
+ }
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaServiceUnit.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaServiceUnit.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaServiceUnit.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/ScaServiceUnit.java Sat Jun 23 02:01:56 2007
@@ -35,36 +35,36 @@
public class ScaServiceUnit extends ServiceUnit {
- protected static final ThreadLocal<ScaServiceUnit> SERVICE_UNIT = new ThreadLocal<ScaServiceUnit>();
-
- public static ScaServiceUnit getCurrentScaServiceUnit() {
- return SERVICE_UNIT.get();
- }
-
- protected TuscanyRuntime tuscanyRuntime;
- protected ClassLoader classLoader;
-
- public void init() throws Exception {
+ protected static final ThreadLocal<ScaServiceUnit> SERVICE_UNIT = new ThreadLocal<ScaServiceUnit>();
+
+ protected ClassLoader classLoader;
+ protected TuscanyRuntime tuscanyRuntime;
+
+ public static ScaServiceUnit getCurrentScaServiceUnit() {
+ return SERVICE_UNIT.get();
+ }
+
+ public void init() throws Exception {
SERVICE_UNIT.set(this);
- createScaRuntime();
- createEndpoints();
+ createScaRuntime();
+ createEndpoints();
SERVICE_UNIT.set(null);
- }
-
- protected void createScaRuntime() throws Exception {
- File root = new File(getRootPath());
- File[] files = root.listFiles(new JarFileFilter());
- URL[] urls = new URL[files.length + 1];
- for (int i = 0; i < files.length; i++) {
- urls[i] = files[i].toURL();
- }
- urls[urls.length - 1] = root.toURL();
- classLoader = new URLClassLoader(urls, getClass().getClassLoader());
-
+ }
+
+ protected void createScaRuntime() throws Exception {
+ File root = new File(getRootPath());
+ File[] files = root.listFiles(new JarFileFilter());
+ URL[] urls = new URL[files.length + 1];
+ for (int i = 0; i < files.length; i++) {
+ urls[i] = files[i].toURL();
+ }
+ urls[urls.length - 1] = root.toURL();
+ classLoader = new URLClassLoader(urls, getClass().getClassLoader());
+
tuscanyRuntime = new TuscanyRuntime(getName(), getRootPath(), classLoader, new CommonsLoggingMonitorFactory());
- }
-
- protected void createEndpoints() throws Exception {
+ }
+
+ protected void createEndpoints() throws Exception {
Module module = tuscanyRuntime.getModuleComponent().getModuleImplementation();
for (Iterator i = module.getEntryPoints().iterator(); i.hasNext();) {
EntryPoint entryPoint = (EntryPoint) i.next();
@@ -84,28 +84,28 @@
addEndpoint(endpoint);
}
}
- }
-
- private static class JarFileFilter implements FilenameFilter {
+ }
+
+ private static class JarFileFilter implements FilenameFilter {
public boolean accept(File dir, String name) {
return name.endsWith(".jar");
}
- }
+ }
+
+ public TuscanyRuntime getTuscanyRuntime() {
+ return tuscanyRuntime;
+ }
+
+ @Override
+ public void start() throws Exception {
+ tuscanyRuntime.start();
+ super.start();
+ }
- public TuscanyRuntime getTuscanyRuntime() {
- return tuscanyRuntime;
- }
-
- @Override
- public void start() throws Exception {
- tuscanyRuntime.start();
- super.start();
- }
-
- @Override
- public void stop() throws Exception {
- super.stop();
- tuscanyRuntime.stop();
- }
+ @Override
+ public void stop() throws Exception {
+ super.stop();
+ tuscanyRuntime.stop();
+ }
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiBindingImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiBindingImpl.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiBindingImpl.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/assembly/impl/JbiBindingImpl.java Sat Jun 23 02:01:56 2007
@@ -116,30 +116,31 @@
* @see org.apache.tuscany.model.assembly.impl.BindingImpl#initialize(org.apache.tuscany.model.assembly.AssemblyModelContext)
*/
public void initialize(AssemblyModelContext modelContext) {
- if (isInitialized())
+ if (isInitialized()) {
return;
+ }
super.initialize(modelContext);
// Get the service name and endpoint name
String[] parts = split(portURI);
serviceName = new QName(parts[0], parts[1]);
endpointName = parts[2];
-
+
// Load the WSDL definitions for the given namespace
List<Definition> definitions = modelContext.getAssemblyLoader().loadDefinitions(parts[0]);
if (definitions != null) {
- for (Definition definition : definitions) {
- Service service = definition.getService(serviceName);
- if (service != null) {
- Port port = service.getPort(endpointName);
- if (port != null) {
- this.service = service;
- this.port = port;
- this.portType = port.getBinding().getPortType();
- this.interfaceName = portType.getQName();
- this.definition = definition;
- return;
- }
+ for (Definition tmpDefinition : definitions) {
+ Service tmpService = tmpDefinition.getService(serviceName);
+ if ((tmpService != null) && (port != null)) {
+ //Port tmpPort = service.getPort(endpointName);
+ // if {
+ this.service = service;
+ this.port = port;
+ this.portType = port.getBinding().getPortType();
+ this.interfaceName = portType.getQName();
+ this.definition = definition;
+ return;
+ // }
}
}
}
@@ -158,7 +159,7 @@
String epName = uri.substring(idx1 + 1);
String svcName = uri.substring(idx2 + 1, idx1);
String nsUri = uri.substring(0, idx2);
- return new String[] { nsUri, svcName, epName };
+ return new String[] {nsUri, svcName, epName};
}
-
+
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/ExternalJbiServiceBuilder.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/ExternalJbiServiceBuilder.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/ExternalJbiServiceBuilder.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/ExternalJbiServiceBuilder.java Sat Jun 23 02:01:56 2007
@@ -43,7 +43,7 @@
import org.apache.tuscany.model.assembly.ExternalService;
import org.apache.tuscany.model.assembly.Service;
import org.apache.tuscany.model.assembly.ServiceContract;
-import org.apache.tuscany.model.scdl.WebServiceBinding;
+//import org.apache.tuscany.model.scdl.WebServiceBinding;
import org.osoa.sca.annotations.Init;
import org.osoa.sca.annotations.Scope;
@@ -87,7 +87,7 @@
/**
* Sets the factory used to construct invocation messages
- *
+ *
* @param msgFactory
*/
@Autowire
@@ -99,7 +99,7 @@
* Sets a builder responsible for creating source-side and target-side invocation chains for a reference. The
* reference builder may be hierarchical, containing other child reference builders that operate on specific
* metadata used to construct and invocation chain.
- *
+ *
* @see org.apache.tuscany.core.builder.impl.HierarchicalBuilder
*/
public void setPolicyBuilder(ContextFactoryBuilder builder) {
@@ -116,7 +116,8 @@
}
ExternalJbiServiceClient externalJbiServiceClient = new ExternalJbiServiceClient(externalService);
- ExternalJbiServiceContextFactory config = new ExternalJbiServiceContextFactory(externalService.getName(), new SingletonObjectFactory<ExternalJbiServiceClient>(externalJbiServiceClient));
+ ExternalJbiServiceContextFactory config = new ExternalJbiServiceContextFactory(externalService.getName(),
+ new SingletonObjectFactory<ExternalJbiServiceClient>(externalJbiServiceClient));
ConfiguredService configuredService = externalService.getConfiguredService();
Service service = configuredService.getService();
@@ -129,7 +130,8 @@
iConfigMap.put(method, iConfig);
}
QualifiedName qName = new QualifiedName(externalService.getName() + "/" + service.getName());
- ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory);
+ ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap,
+ serviceContract.getInterface().getClassLoader(), messageFactory);
proxyFactory.setBusinessInterface(serviceContract.getInterface());
proxyFactory.setProxyConfiguration(pConfiguration);
config.addTargetProxyFactory(service.getName(), proxyFactory);
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/ExternalJbiServiceWireBuilder.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/ExternalJbiServiceWireBuilder.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/ExternalJbiServiceWireBuilder.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/ExternalJbiServiceWireBuilder.java Sat Jun 23 02:01:56 2007
@@ -45,23 +45,26 @@
runtimeContext = context;
}
- @Init(eager=true)
+ @Init(eager = true)
public void init() {
runtimeContext.addBuilder(this);
}
- public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope, ScopeContext targetScopeContext) throws BuilderConfigException {
+ public void connect(ProxyFactory sourceFactory, ProxyFactory targetFactory, Class targetType, boolean downScope,
+ ScopeContext targetScopeContext) throws BuilderConfigException {
if (!(ExternalJbiServiceContextFactory.class.isAssignableFrom(targetType))) {
return;
}
- for (InvocationConfiguration sourceInvocationConfig : sourceFactory.getProxyConfiguration().getInvocationConfigurations().values()) {
- ExternalJbiServiceTargetInvoker invoker = new ExternalJbiServiceTargetInvoker(sourceFactory.getProxyConfiguration().getTargetName(), sourceInvocationConfig.getMethod(), targetScopeContext);
+ for (InvocationConfiguration sourceInvocationConfig
+ : sourceFactory.getProxyConfiguration().getInvocationConfigurations().values()) {
+ ExternalJbiServiceTargetInvoker invoker = new ExternalJbiServiceTargetInvoker(
+ sourceFactory.getProxyConfiguration().getTargetName(), sourceInvocationConfig.getMethod(), targetScopeContext);
sourceInvocationConfig.setTargetInvoker(invoker);
}
}
public void completeTargetChain(ProxyFactory targetFactory, Class targetType, ScopeContext targetScopeContext)
- throws BuilderConfigException {
+ throws BuilderConfigException {
//TODO implement
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/JbiServiceEntryPointBuilder.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/JbiServiceEntryPointBuilder.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/JbiServiceEntryPointBuilder.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/builder/JbiServiceEntryPointBuilder.java Sat Jun 23 02:01:56 2007
@@ -86,7 +86,7 @@
/**
* Sets the factory used to construct invocation messages
- *
+ *
* @param msgFactory
*/
@Autowire
@@ -98,7 +98,7 @@
* Sets a builder responsible for creating source-side and target-side invocation chains for a reference. The
* reference builder may be hierarchical, containing other child reference builders that operate on specific
* metadata used to construct and invocation chain.
- *
+ *
* @see org.apache.tuscany.core.builder.impl.HierarchicalBuilder
*/
public void setPolicyBuilder(ContextFactoryBuilder builder) {
@@ -114,7 +114,8 @@
return;
}
- EntryPointContextFactory config = new JbiServiceEntryPointContextFactory(entryPoint.getName(), entryPoint.getConfiguredService().getService().getName(), messageFactory);
+ EntryPointContextFactory config = new JbiServiceEntryPointContextFactory(entryPoint.getName(),
+ entryPoint.getConfiguredService().getService().getName(), messageFactory);
ConfiguredService configuredService = entryPoint.getConfiguredService();
Service service = configuredService.getService();
@@ -126,8 +127,11 @@
InvocationConfiguration iConfig = new InvocationConfiguration(method);
iConfigMap.put(method, iConfig);
}
- QualifiedName qName = new QualifiedName(entryPoint.getConfiguredReference().getTargetConfiguredServices().get(0).getAggregatePart().getName() + "/" + service.getName());
- ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(), messageFactory);
+ QualifiedName qName =
+ new QualifiedName(entryPoint.getConfiguredReference().getTargetConfiguredServices().get(0).getAggregatePart().getName()
+ + "/" + service.getName());
+ ProxyConfiguration pConfiguration = new ProxyConfiguration(qName, iConfigMap, serviceContract.getInterface().getClassLoader(),
+ messageFactory);
proxyFactory.setBusinessInterface(serviceContract.getInterface());
proxyFactory.setProxyConfiguration(pConfiguration);
config.addSourceProxyFactory(service.getName(), proxyFactory);
@@ -142,12 +146,12 @@
}
entryPoint.getConfiguredReference().setContextFactory(config);
}
-
+
//FIXME same as the InvokerInterceptor except that it doesn't throw an exception in setNext
// For some reason another InvokerInterceptor is added after this one, need Jim to look into it
// and figure out why.
public class EntryPointInvokerInterceptor implements Interceptor {
-
+
public EntryPointInvokerInterceptor() {
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceClient.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceClient.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceClient.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceClient.java Sat Jun 23 02:01:56 2007
@@ -78,7 +78,7 @@
NormalizedMessage in = inout.createMessage();
inout.setInMessage(in);
in.setContent(new StringSource(baos.toString()));
- boolean sent = channel.sendSync(inout);
+ //boolean sent = channel.sendSync(inout);
// TODO: check for error ?
NormalizedMessage out = inout.getOutMessage();
Object response = context.createUnmarshaller().unmarshal(out.getContent());
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceTargetInvoker.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceTargetInvoker.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceTargetInvoker.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/handler/ExternalJbiServiceTargetInvoker.java Sat Jun 23 02:01:56 2007
@@ -43,9 +43,9 @@
* @param container
*/
public ExternalJbiServiceTargetInvoker(QualifiedName serviceName, Method method, ScopeContext container) {
- assert (serviceName != null) : "No service name specified";
- assert (method != null) : "No method specified";
- assert (container != null) : "No scope container specified";
+ assert serviceName != null : "No service name specified";
+ assert method != null : "No method specified";
+ assert container != null : "No scope container specified";
this.serviceName = serviceName;
this.esName = serviceName.getPartName();
this.method = method;
@@ -103,6 +103,6 @@
} catch (CloneNotSupportedException e) {
return null; // will not happen
}
- }
-
+ }
+
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/loader/JbiBindingLoader.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/loader/JbiBindingLoader.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/loader/JbiBindingLoader.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/loader/JbiBindingLoader.java Sat Jun 23 02:01:56 2007
@@ -33,11 +33,11 @@
import org.osoa.sca.annotations.Scope;
@Scope("MODULE")
-public class JbiBindingLoader implements StAXElementLoader<JbiBinding>{
+public class JbiBindingLoader implements StAXElementLoader<JbiBinding> {
public static final QName BINDING_JBI = new QName("http://www.osoa.org/xmlns/sca/0.9", "binding.jbi");
- private static final JbiAssemblyFactory jbiFactory = new JbiAssemblyFactoryImpl();
+ private static final JbiAssemblyFactory JBIFACTORY = new JbiAssemblyFactoryImpl();
private StAXLoaderRegistry registry;
@@ -65,7 +65,7 @@
}
public JbiBinding load(XMLStreamReader reader, ResourceLoader resourceLoader) throws XMLStreamException, ConfigurationLoadException {
- JbiBinding binding = jbiFactory.createJbiBinding();
+ JbiBinding binding = JBIFACTORY.createJbiBinding();
binding.setURI(reader.getAttributeValue(null, "uri"));
binding.setPortURI(reader.getAttributeValue(null, "port"));
return binding;
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/BootstrapHelper.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/BootstrapHelper.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/BootstrapHelper.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/BootstrapHelper.java Sat Jun 23 02:01:56 2007
@@ -46,8 +46,13 @@
import org.apache.tuscany.model.scdl.loader.SCDLModelLoader;
import org.apache.tuscany.model.scdl.loader.impl.SCDLAssemblyModelLoaderImpl;
-public class BootstrapHelper {
-
+public final class BootstrapHelper {
+
+ private static final String SYSTEM_LOADER_COMPONENT = "tuscany.loader";
+ private static final boolean USESTAX = true;
+
+ private BootstrapHelper() { }
+
/**
* Returns a default AssemblyModelContext.
*
@@ -77,15 +82,12 @@
*/
public static List<ContextFactoryBuilder> getBuilders() {
List<ContextFactoryBuilder> configBuilders = new ArrayList<ContextFactoryBuilder>();
- configBuilders.add((new SystemContextFactoryBuilder()));
+ configBuilders.add(new SystemContextFactoryBuilder());
configBuilders.add(new SystemEntryPointBuilder());
configBuilders.add(new SystemExternalServiceBuilder());
return configBuilders;
}
- private static final boolean useStax = true;
- private static final String SYSTEM_LOADER_COMPONENT = "tuscany.loader";
-
/**
* Returns the default module configuration loader.
*
@@ -93,17 +95,20 @@
* @param modelContext the model context the loader will use
* @return the default module configuration loader
*/
- public static ModuleComponentConfigurationLoader getConfigurationLoader(SystemAggregateContext systemContext, AssemblyModelContext modelContext) throws ConfigurationException {
- if (useStax) {
+ public static ModuleComponentConfigurationLoader getConfigurationLoader(SystemAggregateContext systemContext,
+ AssemblyModelContext modelContext) throws ConfigurationException {
+ if (USESTAX) {
// Bootstrap the StAX loader module
bootstrapStaxLoader(systemContext, modelContext);
- return new StAXModuleComponentConfigurationLoaderImpl(modelContext, XMLInputFactory.newInstance(), systemContext.resolveInstance(StAXLoaderRegistry.class));
+ return new StAXModuleComponentConfigurationLoaderImpl(modelContext, XMLInputFactory.newInstance(),
+ systemContext.resolveInstance(StAXLoaderRegistry.class));
} else {
return new ModuleComponentConfigurationLoaderImpl(modelContext);
}
}
- private static AggregateContext bootstrapStaxLoader(SystemAggregateContext systemContext, AssemblyModelContext modelContext) throws ConfigurationException {
+ private static AggregateContext bootstrapStaxLoader(SystemAggregateContext systemContext, AssemblyModelContext modelContext)
+ throws ConfigurationException {
AggregateContext loaderContext = (AggregateContext) systemContext.getContext(SYSTEM_LOADER_COMPONENT);
if (loaderContext == null) {
ModuleComponent loaderComponent = StAXUtil.bootstrapLoader(SYSTEM_LOADER_COMPONENT, modelContext);
@@ -120,4 +125,4 @@
// Get the aggregate context representing the component
return (AggregateContext) parent.getContext(component.getName());
}
-}
\ No newline at end of file
+}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/TuscanyRuntime.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/TuscanyRuntime.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/TuscanyRuntime.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/main/java/org/apache/servicemix/sca/tuscany/TuscanyRuntime.java Sat Jun 23 02:01:56 2007
@@ -38,15 +38,16 @@
import org.osoa.sca.ServiceRuntimeException;
public class TuscanyRuntime extends SCA {
+
+ private static final String SYSTEM_MODULE_COMPONENT = "org.apache.tuscany.core.system";
+
private final TuscanyRuntime.Monitor monitor;
private final Object sessionKey = new Object();
private final RuntimeContext runtime;
private final AggregateContext moduleContext;
-
- private final ModuleComponent moduleComponent;
- private static final String SYSTEM_MODULE_COMPONENT = "org.apache.tuscany.core.system";
+ private final ModuleComponent moduleComponent;
/**
* Construct a runtime using a null MonitorFactory.
@@ -57,8 +58,8 @@
* @see TuscanyRuntime#TuscanyRuntime(String, String, org.apache.tuscany.common.monitor.MonitorFactory)
*/
public TuscanyRuntime(String name, String uri) throws ConfigurationException {
- this(name, uri,
- Thread.currentThread().getContextClassLoader(),
+ this(name, uri,
+ Thread.currentThread().getContextClassLoader(),
new NullMonitorFactory());
}
@@ -102,11 +103,11 @@
public ModuleComponent getModuleComponent() {
return moduleComponent;
}
-
+
public AggregateContext getModuleContext() {
return moduleContext;
}
-
+
/**
* Start the runtime and associate the module context with the calling thread.
*/
@@ -169,4 +170,4 @@
void stopped(AggregateContext ctx);
}
-}
\ No newline at end of file
+}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/AssemblyLoaderTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/AssemblyLoaderTest.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/AssemblyLoaderTest.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/AssemblyLoaderTest.java Sat Jun 23 02:01:56 2007
@@ -45,14 +45,14 @@
public void testLoader() throws Exception {
String name = "bigbank";
String uri = getClass().getResource("bigbank/sca.module").toString();
-
+
URL url = getClass().getResource("bigbank/sca.module");
URL parentUrl = new File(url.toURI()).getParentFile().toURL();
- ClassLoader cl = new URLClassLoader(new URL[] { parentUrl }, getClass().getClassLoader());
-
+ ClassLoader cl = new URLClassLoader(new URL[] {parentUrl}, getClass().getClassLoader());
+
TuscanyRuntime rt = new TuscanyRuntime(name, uri, cl, new NullMonitorFactory());
assertNotNull(rt);
-
+
Module module = rt.getModuleComponent().getModuleImplementation();
Assert.assertTrue(module.getName().equals("org.apache.servicemix.sca.bigbank"));
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/ScaComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/ScaComponentTest.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/ScaComponentTest.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/ScaComponentTest.java Sat Jun 23 02:01:56 2007
@@ -26,6 +26,8 @@
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
+import org.w3c.dom.Node;
+
import junit.framework.TestCase;
import org.apache.commons.logging.Log;
@@ -39,14 +41,14 @@
import org.apache.servicemix.jbi.jaxp.StringSource;
import org.apache.servicemix.jbi.resolver.ServiceNameEndpointResolver;
import org.apache.servicemix.sca.bigbank.stockquote.StockQuoteResponse;
-import org.w3c.dom.Node;
+
public class ScaComponentTest extends TestCase {
private static Log log = LogFactory.getLog(ScaComponentTest.class);
-
+
protected JBIContainer container;
-
+
protected void setUp() throws Exception {
container = new JBIContainer();
container.setUseMBeanServer(false);
@@ -56,13 +58,13 @@
container.setEmbedded(true);
container.init();
}
-
+
protected void tearDown() throws Exception {
if (container != null) {
container.shutDown();
}
}
-
+
public void testDeploy() throws Exception {
ScaComponent component = new ScaComponent();
container.activateComponent(component, "JSR181Component");
@@ -78,31 +80,31 @@
ActivationSpec as = new ActivationSpec();
as.setComponent(mock);
container.activateComponent(as);
-
+
// Start container
container.start();
-
+
// Deploy SU
component.getServiceUnitManager().deploy("su", getServiceUnitPath("org/apache/servicemix/sca/bigbank"));
component.getServiceUnitManager().init("su", getServiceUnitPath("org/apache/servicemix/sca/bigbank"));
component.getServiceUnitManager().start("su");
-
+
ServiceMixClient client = new DefaultServiceMixClient(container);
Source req = new StringSource("<AccountReportRequest><CustomerID>id</CustomerID></AccountReportRequest>");
Object rep = client.request(new ServiceNameEndpointResolver(
- new QName("http://sca.servicemix.apache.org/Bigbank/Account", "AccountService")),
- null, null, req);
+ new QName("http://sca.servicemix.apache.org/Bigbank/Account", "AccountService")),
+ null, null, req);
if (rep instanceof Node) {
rep = new DOMSource((Node) rep);
}
log.info(new SourceTransformer().toString((Source) rep));
}
-
+
protected String getServiceUnitPath(String name) {
URL url = getClass().getClassLoader().getResource(name + "/sca.module");
File path = new File(url.getFile());
path = path.getParentFile();
return path.getAbsolutePath();
}
-
+
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReportRequest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReportRequest.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReportRequest.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReportRequest.java Sat Jun 23 02:01:56 2007
@@ -27,15 +27,15 @@
@XmlRootElement(name = "AccountReportRequest")
public class AccountReportRequest {
- @XmlElement(name = "CustomerID")
- private String customerID;
+ @XmlElement(name = "CustomerID")
+ private String customerID;
- public String getCustomerID() {
- return customerID;
- }
+ public String getCustomerID() {
+ return customerID;
+ }
- public void setCustomerID(String customerID) {
- this.customerID = customerID;
- }
+ public void setCustomerID(String customerID) {
+ this.customerID = customerID;
+ }
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReportResponse.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReportResponse.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReportResponse.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountReportResponse.java Sat Jun 23 02:01:56 2007
@@ -29,15 +29,15 @@
@XmlRootElement(name = "AccountReportResponse")
public class AccountReportResponse {
- @XmlElement(name = "AccountSummaries")
- private List<AccountSummary> accountSummaries;
+ @XmlElement(name = "AccountSummaries")
+ private List<AccountSummary> accountSummaries;
- public List<AccountSummary> getAccountSummaries() {
- return accountSummaries;
- }
+ public List<AccountSummary> getAccountSummaries() {
+ return accountSummaries;
+ }
- public void setAccountSummaries(List<AccountSummary> accountSummaries) {
- this.accountSummaries = accountSummaries;
- }
+ public void setAccountSummaries(List<AccountSummary> accountSummaries) {
+ this.accountSummaries = accountSummaries;
+ }
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountService.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountService.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountService.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountService.java Sat Jun 23 02:01:56 2007
@@ -21,5 +21,5 @@
@Remotable
public interface AccountService {
- public AccountReportResponse getAccountReport(AccountReportRequest request);
+ AccountReportResponse getAccountReport(AccountReportRequest request);
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountServiceImpl.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountServiceImpl.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountServiceImpl.java Sat Jun 23 02:01:56 2007
@@ -25,67 +25,67 @@
import org.apache.servicemix.sca.bigbank.stockquote.StockQuoteRequest;
import org.apache.servicemix.sca.bigbank.stockquote.StockQuoteResponse;
import org.apache.servicemix.sca.bigbank.stockquote.StockQuoteService;
-import org.osoa.sca.annotations.Property;
+//import org.osoa.sca.annotations.Property;
import org.osoa.sca.annotations.Reference;
import org.osoa.sca.annotations.Service;
-@Service(interfaces=AccountService.class)
+@Service(interfaces = AccountService.class)
public class AccountServiceImpl implements AccountService {
- @Property
- public String currency = "USD";
+ //@Property
+ //private String currency = "USD";
@Reference
- public AccountDataService accountDataService;
+ private AccountDataService accountDataService;
@Reference
- public StockQuoteService stockQuoteService;
+ private StockQuoteService stockQuoteService;
public AccountServiceImpl() {
}
public AccountReportResponse getAccountReport(AccountReportRequest request) {
- AccountReportResponse report = new AccountReportResponse();
- String customerID = request.getCustomerID();
- report.setAccountSummaries(new ArrayList<AccountSummary>());
- report.getAccountSummaries().add(getCheckAccountSummary(customerID));
- report.getAccountSummaries().add(getSavingsAccountSummary(customerID));
- report.getAccountSummaries().add(getStockAccountSummary(customerID));
+ AccountReportResponse report = new AccountReportResponse();
+ String customerID = request.getCustomerID();
+ report.setAccountSummaries(new ArrayList<AccountSummary>());
+ report.getAccountSummaries().add(getCheckAccountSummary(customerID));
+ report.getAccountSummaries().add(getSavingsAccountSummary(customerID));
+ report.getAccountSummaries().add(getStockAccountSummary(customerID));
return report;
}
-
+
private AccountSummary getCheckAccountSummary(String customerID) {
- CheckingAccount checking = accountDataService.getCheckingAccount(customerID);
- AccountSummary summary = new AccountSummary();
- summary.setAccountNumber(checking.getAccountNumber());
- summary.setAccountType("Checking");
- summary.setBalance(checking.getBalance());
- return summary;
+ CheckingAccount checking = accountDataService.getCheckingAccount(customerID);
+ AccountSummary summary = new AccountSummary();
+ summary.setAccountNumber(checking.getAccountNumber());
+ summary.setAccountType("Checking");
+ summary.setBalance(checking.getBalance());
+ return summary;
}
private AccountSummary getSavingsAccountSummary(String customerID) {
- SavingsAccount savings = accountDataService.getSavingsAccount(customerID);
- AccountSummary summary = new AccountSummary();
- summary.setAccountNumber(savings.getAccountNumber());
- summary.setAccountType("Savings");
- summary.setBalance(savings.getBalance());
- return summary;
+ SavingsAccount savings = accountDataService.getSavingsAccount(customerID);
+ AccountSummary summary = new AccountSummary();
+ summary.setAccountNumber(savings.getAccountNumber());
+ summary.setAccountType("Savings");
+ summary.setBalance(savings.getBalance());
+ return summary;
}
private AccountSummary getStockAccountSummary(String customerID) {
- StockAccount stock = accountDataService.getStockAccount(customerID);
- AccountSummary summary = new AccountSummary();
- summary.setAccountNumber(stock.getAccountNumber());
- summary.setAccountType("Stock");
- float quote = getQuote(stock.getSymbol());
- summary.setBalance(quote * stock.getQuantity());
- return summary;
+ StockAccount stock = accountDataService.getStockAccount(customerID);
+ AccountSummary summary = new AccountSummary();
+ summary.setAccountNumber(stock.getAccountNumber());
+ summary.setAccountType("Stock");
+ float quote = getQuote(stock.getSymbol());
+ summary.setBalance(quote * stock.getQuantity());
+ return summary;
}
-
+
private float getQuote(String symbol) {
- StockQuoteRequest req = new StockQuoteRequest();
- req.setSymbol(symbol);
- StockQuoteResponse rep = stockQuoteService.getQuote(req);
- return rep.getResult();
+ StockQuoteRequest req = new StockQuoteRequest();
+ req.setSymbol(symbol);
+ StockQuoteResponse rep = stockQuoteService.getQuote(req);
+ return rep.getResult();
}
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountSummary.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountSummary.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountSummary.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/account/AccountSummary.java Sat Jun 23 02:01:56 2007
@@ -27,40 +27,40 @@
@XmlRootElement(name = "AccountSummary")
public class AccountSummary {
- @XmlElement(name = "AccountNumber")
- private String accountNumber;
+ @XmlElement(name = "AccountNumber")
+ private String accountNumber;
- @XmlElement(name = "AccountType")
- private String accountType;
+ @XmlElement(name = "AccountType")
+ private String accountType;
- @XmlElement(name = "Balance")
- private float balance;
+ @XmlElement(name = "Balance")
+ private float balance;
- public AccountSummary() {
- }
+ public AccountSummary() {
+ }
- public String getAccountNumber() {
- return accountNumber;
- }
+ public String getAccountNumber() {
+ return accountNumber;
+ }
- public void setAccountNumber(String accountNumber) {
- this.accountNumber = accountNumber;
- }
+ public void setAccountNumber(String accountNumber) {
+ this.accountNumber = accountNumber;
+ }
- public String getAccountType() {
- return accountType;
- }
+ public String getAccountType() {
+ return accountType;
+ }
- public void setAccountType(String accountType) {
- this.accountType = accountType;
- }
+ public void setAccountType(String accountType) {
+ this.accountType = accountType;
+ }
- public float getBalance() {
- return balance;
- }
+ public float getBalance() {
+ return balance;
+ }
- public void setBalance(float balance) {
- this.balance = balance;
- }
+ public void setBalance(float balance) {
+ this.balance = balance;
+ }
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteRequest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteRequest.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteRequest.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteRequest.java Sat Jun 23 02:01:56 2007
@@ -27,15 +27,15 @@
@XmlRootElement(name = "StockQuoteRequest")
public class StockQuoteRequest {
- @XmlElement(name = "Symbol")
- private String symbol;
+ @XmlElement(name = "Symbol")
+ private String symbol;
- public String getSymbol() {
- return symbol;
- }
+ public String getSymbol() {
+ return symbol;
+ }
- public void setSymbol(String symbol) {
- this.symbol = symbol;
- }
+ public void setSymbol(String symbol) {
+ this.symbol = symbol;
+ }
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteResponse.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteResponse.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteResponse.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteResponse.java Sat Jun 23 02:01:56 2007
@@ -27,15 +27,15 @@
@XmlRootElement(name = "StockQuoteResponse")
public class StockQuoteResponse {
- @XmlElement(name = "Result")
- private float result;
+ @XmlElement(name = "Result")
+ private float result;
- public float getResult() {
- return result;
- }
+ public float getResult() {
+ return result;
+ }
- public void setResult(float result) {
- this.result = result;
- }
+ public void setResult(float result) {
+ this.result = result;
+ }
}
Modified: incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteService.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteService.java?view=diff&rev=550026&r1=550025&r2=550026
==============================================================================
--- incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteService.java (original)
+++ incubator/servicemix/trunk/sandbox/servicemix-sca/src/test/java/org/apache/servicemix/sca/bigbank/stockquote/StockQuoteService.java Sat Jun 23 02:01:56 2007
@@ -21,7 +21,6 @@
@Remotable
public interface StockQuoteService {
- public StockQuoteResponse getQuote(StockQuoteRequest stockQuote);
+ StockQuoteResponse getQuote(StockQuoteRequest stockQuote);
}
-
\ No newline at end of file