Package com.alibaba.dubbo.rpc.service

Examples of com.alibaba.dubbo.rpc.service.GenericService.$invoke()


            GenericService genericService = reference.get();
            User user = new User();
            user.setName("zhangsan");
            List<User> users = new ArrayList<User>();
            users.add(user);
            Object result = genericService.$invoke("getUsers", new String[]{ReflectUtils.getName(List.class)}, new Object[]{JavaBeanSerializeUtil.serialize(users, JavaBeanAccessor.METHOD)});
            Assert.assertTrue(result instanceof JavaBeanDescriptor);
            JavaBeanDescriptor descriptor = (JavaBeanDescriptor) result;
            Assert.assertTrue(descriptor.isCollectionType());
            Assert.assertEquals(1, descriptor.propertySize());
            descriptor = (JavaBeanDescriptor) descriptor.getProperty(0);
View Full Code Here


        URL consumerurl = URL.valueOf("dubbo://127.0.0.1:"+port+"/test?timeout="+Integer.MAX_VALUE
        );
        Invoker<GenericService> reference = protocol.refer(GenericService.class, consumerurl);
       
        GenericService demoProxy = (GenericService)proxy.getProxy(reference);
        Object obj = demoProxy.$invoke("enumlength", new String[]{Type[].class.getName()}, new Object[]{new Type[]{Type.High,Type.High}});
        System.out.println("obj---------->"+obj);
        reference.destroy();
    }
   
//    @Test
View Full Code Here

        GenericService demoProxy = (GenericService)proxy.getProxy(reference);
        Map<String, Object> arg = new HashMap<String, Object>();
        arg.put("type", "High");
        arg.put("name", "hi");
       
        Object obj = demoProxy.$invoke("get", new String[]{"com.alibaba.dubbo.rpc.CustomArgument"}, new Object[]{arg});
        System.out.println("obj---------->"+obj);
        reference.destroy();
    }
   
//  @Ignore
View Full Code Here

        URL consumerurl = serviceurl;
       
        Invoker<GenericService> reference = protocol.refer(GenericService.class, consumerurl);
       
        GenericService demoProxy = (GenericService)proxy.getProxy(reference);
        Object obj = demoProxy.$invoke("enumlength", new String[]{Type[].class.getName()}, new Object[]{new Type[]{Type.High,Type.High}});
        System.out.println("obj---------->"+obj);
       
        invoker.destroy();
        reference.destroy();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.