Examples of ResponseHandler


Examples of com.hazelcast.spi.ResponseHandler

        lockStore.removeSignalKey(getWaitKey());
        lockStore.removeAwait(key, conditionId, getCallerUuid(), threadId);

        boolean locked = lockStore.lock(key, getCallerUuid(), threadId);
        if (locked) {
            ResponseHandler responseHandler = getResponseHandler();
            // expired & acquired lock, send FALSE
            responseHandler.sendResponse(false);
        } else {
            // expired but could not acquire lock, no response atm
            lockStore.registerExpiredAwaitOp(this);
        }
    }
View Full Code Here

Examples of com.proofpoint.http.client.ResponseHandler

        RuntimeException balancerException = new RuntimeException("test balancer exception");
        when(serviceBalancer.createAttempt()).thenThrow(balancerException);

        balancingHttpClient = createBalancingHttpClient();

        ResponseHandler responseHandler = mock(ResponseHandler.class);
        RuntimeException handlerException = new RuntimeException("test responseHandler exception");
        when(responseHandler.handleException(any(Request.class), any(Exception.class))).thenThrow(handlerException);

        assertHandlerExceptionThrown(responseHandler, handlerException);

        ArgumentCaptor<Exception> captor = ArgumentCaptor.forClass(Exception.class);
        verify(responseHandler).handleException(same(request), captor.capture());
View Full Code Here

Examples of com.splunk.shuttl.archiver.copy.CallCopyBucketEndpoint.ResponseHandler

  }

  @Test(expectedExceptions = { NonSuccessfulBucketCopy.class })
  public void _givenCopyRequestNot200Status_throws() throws IOException {
    copyBucketEndpoint = new CallCopyBucketEndpoint(httpClient, shuttlMBean,
        new ResponseHandler());

    LocalBucket bucket = TUtilsBucket.createBucket();
    when(
        httpClient.execute(any(HttpUriRequest.class)).getStatusLine()
            .getStatusCode()).thenReturn(500);
View Full Code Here

Examples of net.solosky.maplefetion.client.ResponseHandler

      //通知当前发送队列中的请求都超时
      synchronized (requestQueue) {
        Iterator<SipcRequest> it = this.requestQueue.iterator();
          while(it.hasNext()) {
            SipcRequest request = it.next();
            ResponseHandler handler = request.getResponseHandler();
            if(handler!=null) {
              if(ex==null){
                handler.timeout(request);
              }else if(ex instanceof TransferException){
                handler.ioerror(request);
              }else if(ex instanceof SystemException){
                handler.syserror(request, ex.getCause());
              }else{
                handler.timeout(request);
              }
            }
          }
      }
    }
View Full Code Here

Examples of net.solosky.maplefetion.client.ResponseHandler

      logger.warn("Request not found in response - response=" + response);
      return;
    }

    // 检查请求设置的处理器
    ResponseHandler handler = response.getRequest().getResponseHandler();
   
    if (handler == null) {
      logger.warn("ResponseHandler not found in request - response=" + response);
      return;
    }

    // 检查通过,处理这个回复
    try {
          handler.handle(response);
        } catch (FetionException e) {
          throw e;
        }catch(Throwable t) {
          throw new SystemException(t, response.getRequest(), response);
        }
View Full Code Here

Examples of org.apache.activemq.transport.mqtt.ResponseHandler

        // optimistic add to local maps first to be able to handle commands in onActiveMQCommand
        subscriptionsByConsumerId.put(consumerInfo.getConsumerId(), mqttSubscription);
        mqttSubscriptionByTopic.put(topicName, mqttSubscription);

        final byte[] qos = {-1};
        protocol.sendToActiveMQ(consumerInfo, new ResponseHandler() {
            @Override
            public void onResponse(MQTTProtocolConverter converter, Response response) throws IOException {
                // validate subscription request
                if (response.isException()) {
                    final Throwable throwable = ((ExceptionResponse) response).getException();
View Full Code Here

Examples of org.apache.agila.services.task.ResponseHandler

        }

        List tasks = taskService.getTasksForUser( new UserID( 1 ), Task.TASK_INCOMPLETE );
        Task task = (Task)tasks.get( 0 );

        ResponseHandler handler = taskService.getResponseHandlerForTask( task.getTaskID(), null );
        assertNotNull( handler );

        HttpServletRequestImpl request = new HttpServletRequestImpl();
        HttpServletResponseImpl response = new HttpServletResponseImpl();
View Full Code Here

Examples of org.apache.agila.services.task.ResponseHandler

        }

        List tasks = taskService.getTasksForUser( new UserID( 1 ), Task.TASK_INCOMPLETE );
        Task task = (Task)tasks.get( 0 );

        ResponseHandler handler = taskService.getResponseHandlerForTask( task.getTaskID(), null );
        assertNotNull( handler );

        HttpServletRequestImpl request = new HttpServletRequestImpl();
        HttpServletResponseImpl response = new HttpServletResponseImpl();
View Full Code Here

Examples of org.apache.agila.services.task.ResponseHandler

        }

        List tasks = taskService.getTasksForUser( new UserID( 1 ), Task.TASK_INCOMPLETE );
        Task task = (Task)tasks.get( 0 );

        ResponseHandler handler = taskService.getResponseHandlerForTask( task.getTaskID(), null );
        assertNotNull( handler );

        HttpServletRequestImpl request = new HttpServletRequestImpl();
        HttpServletResponseImpl response = new HttpServletResponseImpl();
View Full Code Here

Examples of org.apache.agila.services.task.ResponseHandler

    public void submit_task_info(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

        TaskID tid = new TaskID(Integer.parseInt(request.getParameter("taskid")));

        ResponseHandler handler = taskService.getResponseHandlerForTask(tid,
                HTTPResponseHandler.class);

        if (handler != null) {

            if (handler instanceof HTTPResponseHandler) {
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.