Package org.jboss.seam.remoting

Examples of org.jboss.seam.remoting.RequestContext


      log.debug("Processing model request: " + requestData);

      SAXReader xmlReader = new SAXReader();
      Document doc = xmlReader.read(new StringReader(requestData));
      final Element env = doc.getRootElement();
      final RequestContext ctx = new RequestContext(env.element("header"));
     
      try
      {
         activateConversationContext(request, ctx.getConversationId());
  
         Element modelElement = env.element("body").element("model");
         String operation = modelElement.attributeValue("operation");
          
         if ("expand".equals(operation))
         {
            processExpandRequest(modelElement, ctx, response.getOutputStream())
         }
         else
         {
            Model model = null;
            if ("fetch".equals(operation))
            {
               model = processFetchRequest(modelElement);
            }
            else if ("apply".equals(operation))
            {
               model = processApplyRequest(modelElement);
            }
     
            if (model.getAction() != null && model.getAction().getException() != null)
            {
               response.getOutputStream().write(ENVELOPE_TAG_OPEN);
               response.getOutputStream().write(BODY_TAG_OPEN);        
               MarshalUtils.marshalException(model.getAction().getException(),
                     model.getAction().getContext(), response.getOutputStream());
               response.getOutputStream().write(BODY_TAG_CLOSE);
               response.getOutputStream().write(ENVELOPE_TAG_CLOSE);
               response.getOutputStream().flush();
               return;
            }
           
            model.evaluate();
           
            ctx.setConversationId(conversation.isTransient() ? null : conversation.getId());
            marshalResponse(model, ctx, response.getOutputStream());
         }
      }
      finally
      {
View Full Code Here

TOP

Related Classes of org.jboss.seam.remoting.RequestContext

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.