Ejemplo n.º 1
0
        public TestAccount getAccount(TestAccount account) {
            StandardTransferObject to = transferObjectFactory.createTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.TestServerProxy");
            to.setCalleeMethod("getAccount");
            to.registerReturnType(TransferObject.DATATYPE_WRAPPER);

            TestAccountWrapper accountWrapper = new TestAccountWrapper(account);
            to.putWrapper("account", accountWrapper);

            accountWrapper = (TestAccountWrapper)ServerExecutor.execute(to);

            if (accountWrapper != null) {
                TestAccount returnAccount = accountWrapper.getAccount();
                return returnAccount;
            } else {
                return null;
            }

        }
Ejemplo n.º 2
0
        public TestAccount getAccountAsynchronous(TestAccount account) {
            StandardTransferObject to = transferObjectFactory.createTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.TestServerProxy");
            to.setCalleeMethod("getAccount");
            to.registerReturnType(TransferObject.DATATYPE_WRAPPER);

            TestAccountWrapper accountWrapper = new TestAccountWrapper(account);
            to.putWrapper("account", accountWrapper);
            to.setAsynchronous(true);

            Future future = (Future)ServerExecutor.execute(to);

            accountWrapper = (TestAccountWrapper)future.Get();
            TestAccount returnAccount = accountWrapper.getAccount();

            return returnAccount;
        }