コード例 #1
0
 /**
  * 调用ROP服务方法
  *
  * @param ropRequestContext
  * @return
  */
 public RopResponse invokeServiceMethod(RopRequestContext ropRequestContext) {
   try {
     ServiceMethodHandler serviceMethodHandler = ropRequestContext.getServiceMethodHandler();
     if (logger.isDebugEnabled()) {
       logger.debug(
           "执行"
               + serviceMethodHandler.getHandler().getClass()
               + "."
               + serviceMethodHandler.getHandlerMethod().getName());
     }
     return (RopResponse)
         serviceMethodHandler
             .getHandlerMethod()
             .invoke(
                 serviceMethodHandler.getHandler(),
                 ropRequestContext.getServiceMethodParameters());
   } catch (Throwable e) {
     if (e instanceof InvocationTargetException) {
       InvocationTargetException inve = (InvocationTargetException) e;
       throw new RuntimeException(inve.getTargetException());
     } else {
       throw new RuntimeException(e);
     }
   }
 }
コード例 #2
0
 public ServiceRejectedEvent(
     HttpServletRequest httpServletRequest,
     RejectedServiceResponse rejectedServiceResponse,
     RopRequestContext ropRequestContext) {
   super(rejectedServiceResponse, ropRequestContext.getRopContext());
   this.httpServletRequest = httpServletRequest;
   this.rejectedServiceResponse = rejectedServiceResponse;
   this.ropRequestContext = ropRequestContext;
 }
コード例 #3
0
 public ServiceTimeoutEvent(
     HttpServletRequest httpServletRequest,
     ServiceTimeoutErrorResponse response,
     RopRequestContext ropRequestContext) {
   super(response, ropRequestContext.getRopContext());
   this.httpServletRequest = httpServletRequest;
   this.serviceTimeoutErrorResponse = response;
   this.ropRequestContext = ropRequestContext;
 }