Package com.rop

Examples of com.rop.RopRequestContext


*/
public class SampleAfterDoServiceEventListener implements RopEventListener<AfterDoServiceEvent> {


    public void onRopEvent(AfterDoServiceEvent ropEvent) {
        RopRequestContext ropRequestContext = ropEvent.getRopRequestContext();
        if(ropRequestContext != null){
            Map<String,String> allParams = ropRequestContext.getAllParams();
            String message = MessageMarshallerUtils.asUrlString(allParams);
            System.out.println("message("+ropEvent.getServiceEndTime()+")"+message);
        }
    }
View Full Code Here


*/
public class SamplePreDoServiceEventListener implements RopEventListener<PreDoServiceEvent> {


    public void onRopEvent(PreDoServiceEvent ropEvent) {
        RopRequestContext ropRequestContext = ropEvent.getRopRequestContext();
        if(ropRequestContext != null){
            Map<String,String> allParams = ropRequestContext.getAllParams();
            String message = MessageMarshallerUtils.asUrlString(allParams);
            System.out.println("message("+ropEvent.getServiceBeginTime()+")"+message);
        }
    }
View Full Code Here

    protected Logger logger = LoggerFactory.getLogger(getClass());

    @Test
    public void testMarshallerRopRequest() throws Exception {
        RopRequest ropRequest = mock(RopRequest.class);
        RopRequestContext msc = mock(RopRequestContext.class);
        when(ropRequest.getRopRequestContext()).thenReturn(msc);
        HashMap<String, String> map = new HashMap<String, String>();
        map.put("key1", "key1Value");
        map.put("key2", "key2Value");
        map.put("key3", "key3Value");
        when(msc.getAllParams()).thenReturn(map);
        String message = MessageMarshallerUtils.getMessage(ropRequest, MessageFormat.json);
        assertNotNull(message);
        logger.info("json:{}",message);
        assertTrue(message.indexOf("}") > -1);
        assertTrue(message.indexOf("{") > -1);
View Full Code Here

     * @param ropRequest
     * @return
     */
    public Object invokeServiceMethod(RopRequest ropRequest) {
        try {
            RopRequestContext ropRequestContext = ropRequest.getRopRequestContext();
            //分析上下文中的错误
            ServiceMethodHandler serviceMethodHandler = ropRequestContext.getServiceMethodHandler();
            if (logger.isDebugEnabled()) {
                logger.debug("执行" + serviceMethodHandler.getHandler().getClass() +
                        "." + serviceMethodHandler.getHandlerMethod().getName());
            }
            if (serviceMethodHandler.isHandlerMethodWithParameter()) {
View Full Code Here

TOP

Related Classes of com.rop.RopRequestContext

Copyright © 2018 www.massapicom. 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.