コード例 #1
0
        public AllTypeBean getAllTypeBean(bool aboolean, byte abyte,
                                          short ashort, char achar, int aint, long along, float afloat,
                                          double adouble, DateTime adate, String astring)
        {
            StandardTransferObject to = transferObjectFactory.createTransferObject();

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

            to.putBoolean("aboolean", aboolean);
            to.putByte("abyte", abyte);
            to.putShort("ashort", ashort);
            to.putChar("achar", achar);
            to.putInt("aint", aint);
            to.putLong("along", along);
            to.putFloat("afloat", afloat);
            to.putDouble("adouble", adouble);
            to.putDate("adate", adate);
            to.putString("astring", astring);

            AllTypeBeanWrapper allTypeBeanWrapper = (AllTypeBeanWrapper)ServerExecutor.execute(to);

            if (allTypeBeanWrapper != null)
            {
                return(allTypeBeanWrapper.getAllTypeBean());
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
        public TestAccount getAccountCompress(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.setCompress(true);

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

            if (accountWrapper != null)
            {
                TestAccount returnAccount = accountWrapper.getAccount();
                return(returnAccount);
            }
            else
            {
                return(null);
            }
        }
コード例 #3
0
        public void sendMessage(String message)
        {
            StandardTransferObject to = transferObjectFactory.createTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.ChatRoomServerProxy");
            to.setCalleeMethod("receiveMessage");
            to.putString("message", message);
            to.registerReturnType(TransferObject.DATATYPE_VOID);
            ServerExecutor.execute(to);
        }
コード例 #4
0
        public void login(String username)
        {
            StandardTransferObject to = transferObjectFactory.createTransferObject();

            to.setCalleeClass("com.qileyuan.tatala.example.proxy.ChatRoomServerProxy");
            to.setCalleeMethod("login");
            to.putString("username", username);
            to.registerReturnType(TransferObject.DATATYPE_VOID);
            ServerExecutor.execute(to);
        }
コード例 #5
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);
        }