INTSAMPLES-19 Change Return Type to List<> from Array

This commit is contained in:
Gary Russell
2011-02-02 08:18:21 -05:00
parent bfb4f0c4aa
commit 76094d2fab
5 changed files with 21 additions and 16 deletions

View File

@@ -17,6 +17,7 @@ package org.springframework.integration.samples.testing.externalgateway;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.List;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -36,8 +37,8 @@ public class Main {
BufferedReader console = new BufferedReader(new InputStreamReader(System.in));
String zip = console.readLine().trim();
WeatherAndTraffic weatherAndTraffic = context.getBean("wat", WeatherAndTraffic.class);
String[] result = weatherAndTraffic.getByZip(zip);
System.out.println(result[0] + "\r\n" + result[1] + "\r\n");
List<String> result = weatherAndTraffic.getByZip(zip);
System.out.println(result.get(0) + "\r\n" + result.get(1) + "\r\n");
context.close();
System.exit(0);
}

View File

@@ -15,6 +15,8 @@
*/
package org.springframework.integration.samples.testing.externalgateway;
import java.util.List;
/**
* @author Gary Russell
* @since 2.0.2
@@ -22,6 +24,6 @@ package org.springframework.integration.samples.testing.externalgateway;
*/
public interface WeatherAndTraffic {
public String[] getByZip(String zip);
public List<String> getByZip(String zip);
}

View File

@@ -38,7 +38,7 @@
<channel id="aggregatorChannel" />
<aggregator input-channel="aggregatorChannel"
expression="#this.![payload].toArray()"/>
expression="#this.![payload]"/>
<task:executor id="executor" pool-size="10"/>