Package javax.ws.rs.container

Examples of javax.ws.rs.container.AsyncResponse


   @POST
   @Path("resume")
   public String resume(@QueryParam("stage") String stage, String response)
   {
      AsyncResponse async = takeAsyncResponse(stage);
      boolean b = resume(async, response);
      addResponse(async, stage);
      return b ? TRUE : FALSE;
   }
View Full Code Here


   @GET
   @Path("resumechecked")
   public String resumeWithCheckedException(@QueryParam("stage") String stage)
   {
      AsyncResponse async = takeAsyncResponse(stage);
      System.out.println("Before resourceWithCheckedException.resume()");
      boolean b = async.resume(new IOException(RESUMED));
      addResponse(async, stage);
      System.out.println("returning resourceWithCheckedException()");
      return b ? TRUE : FALSE;
   }
View Full Code Here

   @GET
   @Path("resumeruntime")
   public String resumeWithRuntimeException(@QueryParam("stage") String stage)
   {
      AsyncResponse async = takeAsyncResponse(stage);
      boolean b = async.resume(new RuntimeException(RESUMED));
      addResponse(async, stage);
      return b ? TRUE : FALSE;
   }
View Full Code Here

   @POST
   @Path("settimeout")
   public void setTimeOut(@QueryParam("stage") String stage, String milis)
   {
      AsyncResponse async = takeAsyncResponse(stage);
      async.setTimeout(Long.parseLong(milis), TimeUnit.MILLISECONDS);
      addResponse(async, stage);
   }
View Full Code Here

   @POST
   @Path("timeouthandler")
   public void setTimeoutHandler(@QueryParam("stage") String stage, int handlerValue)
   {
      MyTimeoutHandler handler = new MyTimeoutHandler(handlerValue);
      AsyncResponse async = takeAsyncResponse(stage);
      async.setTimeoutHandler(handler);
      async.setTimeout(200L, TimeUnit.MILLISECONDS);
      addResponse(async, stage);
   }
View Full Code Here

   }

   protected static AsyncResponse takeAsyncResponse(int stageId)
   {
      final ResponseBuilder error = createErrorResponseBuilder();
      AsyncResponse asyncResponse = null;
      try
      {
         asyncResponse = stage[stageId].take();
      }
      catch (InterruptedException e)
View Full Code Here

    }

    public Object invoke(Exchange exchange, Object request) {
        Response response = exchange.get(Response.class);
        if (response == null) {
            AsyncResponse asyncResp = exchange.get(AsyncResponse.class);
            if (asyncResp != null) {
                AsyncResponseImpl asyncImpl = (AsyncResponseImpl)asyncResp;
                asyncImpl.prepareContinuation();
                asyncImpl.handleTimeout();
                return handleAsyncResponse(exchange, asyncImpl.getResponseObject());
View Full Code Here

    public Object invoke(Exchange exchange, Object request) {
        MessageContentsList responseList = checkExchangeForResponse(exchange);
        if (responseList != null) {
            return responseList;
        }
        AsyncResponse asyncResp = exchange.get(AsyncResponse.class);
        if (asyncResp != null) {
            AsyncResponseImpl asyncImpl = (AsyncResponseImpl)asyncResp;
            asyncImpl.prepareContinuation();
            try {
                asyncImpl.handleTimeout();
View Full Code Here

    public Object invoke(Exchange exchange, Object request) {
        MessageContentsList responseList = checkExchangeForResponse(exchange);
        if (responseList != null) {
            return responseList;
        }
        AsyncResponse asyncResp = exchange.get(AsyncResponse.class);
        if (asyncResp != null) {
            AsyncResponseImpl asyncImpl = (AsyncResponseImpl)asyncResp;
            asyncImpl.prepareContinuation();
            try {
                asyncImpl.handleTimeout();
View Full Code Here

    public Object invoke(Exchange exchange, Object request) {
        MessageContentsList responseList = checkExchangeForResponse(exchange);
        if (responseList != null) {
            return responseList;
        }
        AsyncResponse asyncResp = exchange.get(AsyncResponse.class);
        if (asyncResp != null) {
            AsyncResponseImpl asyncImpl = (AsyncResponseImpl)asyncResp;
            asyncImpl.prepareContinuation();
            try {
                asyncImpl.handleTimeout();
View Full Code Here

TOP

Related Classes of javax.ws.rs.container.AsyncResponse

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.