java定时器 run方法怎么返回值 我要返回result 代码里一直报错 晚生跪求解决

public VirementResultInfo queryTransaction( final String bank, final TransactionInfo transactionInfo) {
//

final VirementResultInfo result = null;

            TimerTask task = new TimerTask() {
                @Override
                public void run() {
                //  String bankCode = bank;
                //  TransactionInfo b = transactionInfo;
                    String clientSystemNo="D3JOI2JKSA929AIU";
                    String encryptKey = "123456";
                    Boolean isEncrypted = false;
                    BankServiceAgentPortTypeProxy client = new BankServiceAgentPortTypeProxy("http://10.1.255.45:80/NASApp/iTreasury-paymentcenter/services/BankServiceAgent");
                    try {
                        result = client.queryTransaction(clientSystemNo, encryptKey, isEncrypted,  bank, transactionInfo);
                    } catch (RemoteException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }
                    System.out.println(" 第 " + ++count + " 次执行 ");
                }
            };

            Timer timer = new Timer();
            timer.schedule(task, Calendar.getInstance().getTime(), 2 * 1000);
            return result;


    }
查看全部
u010772547
u010772547
2014/12/09 14:32
  • 定时器
  • run方法
  • 点赞
  • 收藏
  • 回答
    私信

2个回复