View Javadoc

1   /*
2    * $Id: JettyContinuationsReplyToHandler.java 22550 2011-07-24 22:03:52Z mike.schilling $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSoft, Inc.  All rights reserved.  http://www.mulesoft.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  package org.mule.transport.servlet.jetty;
11  
12  import org.mule.api.MuleContext;
13  import org.mule.api.MuleEvent;
14  import org.mule.api.MuleException;
15  import org.mule.api.MuleMessage;
16  import org.mule.transport.DefaultReplyToHandler;
17  
18  import org.mortbay.util.ajax.Continuation;
19  
20  /**
21   * This handler is responsible for resuming the continuation for the current request
22   */
23  public class JettyContinuationsReplyToHandler extends DefaultReplyToHandler
24  {
25      /**
26       * Serial version
27       */
28      private static final long serialVersionUID = 1L;
29  
30      public JettyContinuationsReplyToHandler(MuleContext muleContext)
31      {
32          super(muleContext);
33      }
34  
35      @Override
36      public void processReplyTo(MuleEvent event, MuleMessage returnMessage, Object replyTo) throws MuleException
37      {
38          Continuation continuation = (Continuation)replyTo;
39          continuation.setObject(returnMessage);
40          continuation.resume();
41      }
42  }