<p>Deserializes the response content to a type which is assignable to {@link CharSequence}.</p>

@see AbstractDeserializer#run(InvocationContext, HttpResponse)
190331
@Override
	public CharSequence deserialize(InvocationContext context, HttpResponse response) {

		try {
			
			HttpEntity entity = response.getEntity();
			return entity == null? "" :EntityUtils.toString(entity);
		} 
		catch(Exception e) {
			
			throw new DeserializerException(new StringBuilder("Plain deserialization failed for request <")
			.append(context.getRequest().getName())
			.append("> on endpoint <")
			.append(context.getEndpoint().getName())
			.append(">").toString(), e);
		}
	}
1189891
@Override
    @FFDCIgnore(Throwable.class)
    public void run() {
        Future<R> result = null;
        Throwable thrownException = null;

        try {
            ArrayList<ThreadContext> contextAppliedToThread = null;
            if (this.threadContext != null) {
                //apply the JEE contexts to the thread before calling the inner task
                contextAppliedToThread = this.threadContext.taskStarting();
            }
            try {
                result = innerTask.call();
            } finally {
                if (contextAppliedToThread != null) {
                    //remove the JEE contexts again since the thread will be re-used
                    this.threadContext.taskStopping(contextAppliedToThread);
                }
            }
        } catch (Throwable e) {
            if (e instanceof com.ibm.ws.microprofile.faulttolerance.spi.ExecutionException) {
                thrownException = e.getCause();
            } else {
                thrownException = e;
            }
        } finally {
            // We've finished running and caught any exceptions that occurred, now store the result in the resultFuture
            // If abort() has already been called then the result future will already be completed and the result (or exception) here is discarded.
            if (thrownException == null) {
                resultFuture.complete(result);
            } else {
                resultFuture.completeExceptionally(thrownException);
            }
        }
    }
337050
@Override
    public void run() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "run", Thread.currentThread().getName() + " " + this.in.getReadListener());
        }
        
        try {     
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Issuing the async read for the data");
            }
            
            if (_isc==null) {
                
                _callback.complete(null);
            
            } else {
                //Call into the HttpInboundService context for the body data, passing in the callback and forcing
                //the read to go asynchronous
                //If there is data immediately available Channel will call the callback.complete before returning to this thread
                _isc.getRequestBodyBuffer(_callback, true);
            }
        } catch (Exception e){
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "An exception occurred during the async read : " + e);
            }
            e.printStackTrace();
            //There was a problem with the read so we should invoke their onError, since technically it's been set now
            if(this.in.getReadListener()!= null)
                this.in.getReadListener().onError(e);
        } finally {
            asyncContext.setReadListenerRunning(false);
        }
        
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "run", this.in.getReadListener());
        }
    }
196758
public void run()
    {
        Object objMessage = null;
        String[] files = this.getFileList();
        if (files == null)
            return;
        
        for (String strFile : files)
        {
            m_reader = this.getReader(strFile);
        
            try {
                while (true)
                {
                    objMessage = m_reader.readObject();
                    if (objMessage == null)
                        break;  // EOF = Done
                    
                    BaseBuffer buffer = new VectorBuffer((Vector)objMessage, BaseBuffer.PHYSICAL_FIELDS | BaseBuffer.MODIFIED_ONLY);
                    buffer.setHeaderCount(3);
                    String strTrxType = buffer.getHeader().toString();
                    String strTableName = buffer.getHeader().toString();
                    String strKey = buffer.getHeader().toString();
                    
                    try {
                        Record record = this.getRecord(strTableName);
                        if (record == null)
                        {
                        	ClassInfo recClassInfo = (ClassInfo)this.getMainRecord();
                            recClassInfo.addNew();
                            recClassInfo.setKeyArea(ClassInfo.CLASS_NAME_KEY);
                            recClassInfo.getField(ClassInfo.CLASS_NAME).setString(strTableName);
                            if (recClassInfo.seek(DBConstants.EQUALS))
                            {
                                strTableName = recClassInfo.getPackageName(null) + '.' + strTableName;
                                record = Record.makeRecordFromClassName(strTableName, this);
                                this.disableAllListeners(record);
                                record.setAutoSequence(false);
                            }
                            else
                            {
                                if (!NOTRX.equalsIgnoreCase(strTrxType))
                                    System.out.println("Error - table not found: " + strTableName);
                                continue;
                            }
                        }
                        record.addNew();
                        record.getCounterField().setString(strKey);
                        if (ProxyConstants.ADD.equalsIgnoreCase(strTrxType))
                        {
                            buffer.bufferToFields(record, DBConstants.DISPLAY, DBConstants.READ_MOVE);
                            record.add();
                        }
                        else if (ProxyConstants.SET.equalsIgnoreCase(strTrxType))
                        {
                            if (record.seek(DBConstants.EQUALS))
                            {
                                record.edit();
                                buffer.bufferToFields(record, DBConstants.DISPLAY, DBConstants.READ_MOVE);
                                record.set();
                            }
                            else
                                System.out.println("Error - record not found: " + strTableName + ", key: " + strKey);
                        }
                        else if (ProxyConstants.REMOVE.equalsIgnoreCase(strTrxType))
                        {
                            if (record.seek(DBConstants.EQUALS))
                            {
                                record.edit();
                                record.remove();
                            }
                            else
                                System.out.println("Error - record not found: " + strTableName + ", key: " + strKey);
                        }
                    } catch (DBException e) {
                        e.printStackTrace();
                        System.out.println("Error - record: " + strTableName + ", key: " + strKey + " trx type: " + strTrxType);
                    }
                    
                    System.out.println("trxType: " + strTrxType + " record: " + strTableName + " key: " + strKey);
                }
                m_reader.close();
                m_reader = null;
            
            } catch (EOFException e) {
                // Ok - Done
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }
        }
    }
487620
@Override
    public void run() {

        try {
            // do the content check
            m_contentCheck.startContentCheck(m_cms, getReport());
        } catch (Exception e) {
            getReport().println(e);
            if (LOG.isErrorEnabled()) {
                LOG.error(e.getLocalizedMessage());
            }
        }
    }
981026
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("application/json;charset=UTF-8"); 
        response.setCharacterEncoding("UTF-8"); 
        request.setCharacterEncoding("UTF-8");
        
        String questionStr = request.getParameter("q");
        String n = request.getParameter("n");
        int topN = -1;
        if(n != null && StringUtils.isNumeric(n)){
            topN = Integer.parseInt(n);
        }
        Question question = null;
        List<CandidateAnswer> candidateAnswers = null;
        if (questionStr != null && questionStr.trim().length() > 3) {
            question = SharedQuestionAnsweringSystem.getInstance().answerQuestion(questionStr);
            if (question != null) {
                candidateAnswers = question.getAllCandidateAnswer();
            }
        }
        LOG.info("问题："+questionStr); 
        try (PrintWriter out = response.getWriter()) {
            String json = JsonGenerator.generate(candidateAnswers, topN);
            out.println(json);
            LOG.info("答案："+json);
        }
    }
166971
@Override
	public void run()
	{
		try
		{
			String serverHost = InetUtils.resolveAutoInterfaceAddress(settings.getStringProperty(FFMQJMXConsoleSettings.SERVER_HOST, "localhost"));
			int serverPort = settings.getIntProperty(FFMQJMXConsoleSettings.SERVER_PORT, 10003);

			String serviceUrl = "service:jmx:rmi://"+serverHost+"/jndi/rmi://"+serverHost+":"+serverPort+"/jmxconnector-FFMQ-server";
			out.println("JMX Service URL : "+serviceUrl);
			this.jmxServiceURL = new JMXServiceURL(serviceUrl);

			printServerVersion();
			
			boolean interactive = settings.getBooleanProperty(FFMQJMXConsoleSettings.INTERACTIVE, false);
			if (interactive)
				interactiveMode();
			else
			{
				String command = settings.getStringProperty(FFMQJMXConsoleSettings.COMMAND, "help");
				processCommand(command);
			}
		}
		catch (Exception e)
		{
			closeJMXResources();
			handleException(e);
		}
	}
1335495
public static void makeJsonResponse(HttpResponse response, String encoded) {
        StringEntity ent = new StringEntity(encoded, ContentType.APPLICATION_JSON);
        response.setEntity(ent);
    }
971507
@POST
  @Path(ServiceConstants.RUN)
  @Consumes(MediaType.APPLICATION_JSON)
  public Response run(final JobConfig jobConfig) {
    return RestUtils.call(new RestUtils.RestCallable<Long>() {
      @Override
      public Long call() throws Exception {
        return mJobMaster.run(jobConfig);
      }
    }, ServerConfiguration.global());
  }
672960
private void run() {
        onStart();

        while (!isStopping && crawlFrontier.hasNextCandidate()) {
            CrawlCandidate currentCandidate = crawlFrontier.getNextCandidate();
            String candidateUrl = currentCandidate.getRequestUrl().toString();
            HttpClientContext context = HttpClientContext.create();
            CloseableHttpResponse httpHeadResponse = null;
            boolean isUnsuccessfulRequest = false;

            try {
                // Send an HTTP HEAD request to determine its availability and content type
                httpHeadResponse = getHttpHeadResponse(candidateUrl, context);
            } catch (IOException exception) {
                callbackManager.call(CrawlEvent.REQUEST_ERROR,
                        new RequestErrorEvent(currentCandidate, exception));
                isUnsuccessfulRequest = true;
            }

            if (!isUnsuccessfulRequest) {
                String responseUrl = getFinalResponseUrl(context, candidateUrl);
                if (responseUrl.equals(candidateUrl)) {
                    String responseMimeType = getResponseMimeType(httpHeadResponse);
                    if (responseMimeType.equals(ContentType.TEXT_HTML.getMimeType())) {
                        boolean isTimedOut = false;
                        TimeoutException timeoutException = null;

                        try {
                            // Open URL in browser
                            webDriver.get(candidateUrl);
                        } catch (TimeoutException exception) {
                            isTimedOut = true;
                            timeoutException = exception;
                        }

                        // Ensure the HTTP client and Selenium have the same state
                        syncHttpClientCookies();

                        if (isTimedOut) {
                            callbackManager.call(CrawlEvent.PAGE_LOAD_TIMEOUT,
                                    new PageLoadTimeoutEvent(currentCandidate, timeoutException));
                        } else {
                            String loadedPageUrl = webDriver.getCurrentUrl();
                            if (!loadedPageUrl.equals(candidateUrl)) {
                                // Create a new crawl request for the redirected URL (JS redirect)
                                handleRequestRedirect(currentCandidate, loadedPageUrl);
                            } else {
                                callbackManager.call(CrawlEvent.PAGE_LOAD,
                                        new PageLoadEvent(currentCandidate, webDriver));
                            }
                        }
                    } else {
                        // URLs that point to non-HTML content should not be opened in the browser
                        callbackManager.call(CrawlEvent.NON_HTML_CONTENT,
                                new NonHtmlContentEvent(currentCandidate, responseMimeType));
                    }
                } else {
                    // Create a new crawl request for the redirected URL
                    handleRequestRedirect(currentCandidate, responseUrl);
                }
            }

            HttpClientUtils.closeQuietly(httpHeadResponse);
            performDelay();
        }

        onStop();
    }
667997
@SuppressWarnings("unchecked")
    @Override
    public <T> T deserialize(byte[] content, Class<T> clazz) throws SerializerException {
        validateString(clazz);
        return (T) new String(content, Charsets.UTF_8);
    }
721647
public <RESP extends J4pResponse<REQ>, REQ extends J4pRequest> RESP execute(REQ pRequest)
            throws J4pException {
        // type spec is required to keep OpenJDK 1.6 happy (other JVM dont have a problem
        // with infering the type is missing here)
        return this.<RESP, REQ>execute(pRequest,null,null);
    }
1358314
@Override
    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

        String api = request.getParameter("api");

        if (api == null || api.length() == 0) {
            response.setContentType("text/html; charset=UTF-8");
            getIndex(response.getWriter());
        } else {
            response.setContentType("text/xml; charset=UTF-8");
            getWSDL(api.toUpperCase(), request.getRequestURL()
                            .toString(), response.getWriter());
        }

        response.flushBuffer();
    }
298598
public HttpClientResponseBuilder doReturn(int statusCode, String response) {
        return doReturn(statusCode, response, Charset.forName("UTF-8"));
    }
1200258
public void print(CharSequence charSequence) {
        try {
            consoleReader.println(charSequence);
            consoleReader.flush();
        } catch (IOException e) {
            throw new IllegalStateException("Can't write to console", e);
        }
    }
994925
public static void write(HttpServletResponse response, String text, String contentType) {
		response.setContentType(contentType);
		Writer writer = null;
		try {
			writer = response.getWriter();
			writer.write(text);
			writer.flush();
		} catch (IOException e) {
			throw new UtilException(e);
		} finally {
			IoUtil.close(writer);
		}
	}
1051919
@Override
	public final void run () {
		Status result = execute();
		if (result == null) throw new IllegalStateException("Invalid status 'null' returned by the execute method");
		switch (result) {
		case SUCCEEDED:
			success();
			return;
		case FAILED:
			fail();
			return;
		case RUNNING:
			running();
			return;
		default:
			throw new IllegalStateException("Invalid status '" + result.name() + "' returned by the execute method");
		}
	}