1. server
package com.east.flex.serverpush;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.east.flex.serverpush.entity.Product;
/**
*
* @author East(张栋芳)
*
* 2010-6-13
*/
public class CreateProduct extends Thread {
private List productList = new ArrayList();
public CreateProduct() {
// this.start();
}
@Override
public void run() {
// while (true) {
//
// Product p = new Product();
// Random random = new Random();
// p.setMonth("Jan");
// p.setProfit(random.nextInt(1000));
// p.setExpenses(random.nextInt(500));
// p.setAmount(random.nextInt(300));
//
// productList.add(p);
// if (productList.size() == 15) {
// try {
// break;
// } catch (Exception se) {
// System.out.println(se.getMessage());
// }
// }
// System.out.println("Size is :" + productList.size());
// }
}
public List getProductList() {
for (int i = 0; i < 3; i++) {
Product p = new Product();
Random random = new Random();
p.setMonth("Jan" + i);
p.setProfit(random.nextInt(1000));
p.setExpenses(random.nextInt(500));
p.setAmount(random.nextInt(300));
productList.add(p);
}
return productList;
}
public Product getProduct() {
Product p = new Product();
Random random = new Random();
p.setMonth("Jan");
p.setProfit(random.nextInt(1000));
p.setExpenses(random.nextInt(500));
p.setAmount(random.nextInt(300));
return p;
}
public void setProductList(List productList) {
this.productList = productList;
}
}
2.client
height="100%" width="100%" layout="absolute">
paddingLeft="5" paddingRight="5"
showDataTips="true" x="0" y="0">
3. 配置文件:
class="flex.messaging.services.RemotingService">
class="flex.messaging.services.remoting.adapters.JavaAdapter"
default="true" />
com.east.flex.serverpush.CreateProduct