Package juzu

Examples of juzu.Response$Body


          // We should check that it matches....
          // btw we should try to enforce matching during compilation phase
          // @Action -> Response.Action
          // @View -> Response.Mime
          // as we can do it
          Response resp = (Response)ret;
          if (mimeType != null) {
            resp = resp.with(PropertyType.MIME_TYPE, mimeType.value()[0]);
          }
          return resp;
        } else if (ret != null && mimeType != null) {
          for (EntityMarshaller writer : Tools.loadService(EntityMarshaller.class, request.controllerPlugin.getApplication().getClassLoader())) {
            for (String s : mimeType.value()) {
View Full Code Here


      ClassLoader classLoader = application.getClassLoader();
      Thread.currentThread().setContextClassLoader(classLoader);
      bridge.begin(request);

      //
      Response result = request.invoke();

      //
      if (result instanceof Response.Error && descriptor.getErrorController() != null) {
        Class<? extends juzu.Handler<Response.Error, Response>> a = descriptor.getErrorController();
        Method m;
View Full Code Here

  }

  @Override
  public Response handle(Stage.Handler argument) {
    Request request = argument.getRequest();
    Response result = argument.invoke();
    if (result instanceof Response.Error) {
      result = Response.ok("pass");
    }
    return result;
  }
View Full Code Here

  }

  @Override
  public Response handle(Stage.Handler argument) {
    Request request = argument.getRequest();
    Response result = argument.invoke();
    if (result instanceof Response.Error) {
      result = Response.ok("pass");
    }
    return result;
  }
View Full Code Here

  @Override
  public Response handle(Stage.Handler argument) {
    Request request = argument.getRequest();
    Registry.compareAndSet("request.filter.lifecycle", "created", "before");
    Response result = argument.invoke();
    Registry.compareAndSet("request.filter.lifecycle", "before", "after");
    return result;
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    protected Envelope buildSOAPMessage(SAMLMessageContext samlMsgCtx, SAMLObject samlMessage) {
        Envelope envelope = null;
        if (samlMsgCtx.getOutboundMessage() != null && samlMsgCtx.getOutboundMessage() instanceof Envelope) {
            envelope = (Envelope) samlMsgCtx.getOutboundMessage();
            Body body = envelope.getBody();
            if (body == null) {
                XMLObjectBuilderFactory builderFactory = Configuration.getBuilderFactory();
                SOAPObjectBuilder<Body> bodyBuilder = (SOAPObjectBuilder<Body>) builderFactory
                        .getBuilder(Body.DEFAULT_ELEMENT_NAME);
                body = bodyBuilder.buildObject();
                envelope.setBody(body);
            } else if (!body.getUnknownXMLObjects().isEmpty()) {
                log.warn("Supplied SOAP Envelope Body was not empty. Existing contents will be removed.");
                body.getUnknownXMLObjects().clear();
            }
            body.getUnknownXMLObjects().add(samlMessage);
        } else {
            envelope = buildSOAPMessage(samlMessage);
            samlMsgCtx.setOutboundMessage(envelope);
        }
        return envelope;
View Full Code Here

        Envelope envelope = envBuilder.buildObject();

        log.debug("Adding SAML message to the SOAP message's body");
        SOAPObjectBuilder<Body> bodyBuilder = (SOAPObjectBuilder<Body>) builderFactory
                .getBuilder(Body.DEFAULT_ELEMENT_NAME);
        Body body = bodyBuilder.buildObject();
        body.getUnknownXMLObjects().add(samlMessage);
        envelope.setBody(body);

        return envelope;
    }
View Full Code Here

    protected Envelope buildSOAPEnvelope(MessageContext messageContext) {
        log.debug("Building SOAP envelope");

        Envelope envelope = envBuilder.buildObject();

        Body body = bodyBuilder.buildObject();
        envelope.setBody(body);

        return envelope;
    }
View Full Code Here

*/
public class BodyMarshaller extends AbstractXMLObjectMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        Body body = (Body) xmlObject;

        Attr attribute;
        for (Entry<QName, String> entry : body.getUnknownAttributes().entrySet()) {
            attribute = XMLHelper.constructAttribute(domElement.getOwnerDocument(), entry.getKey());
            attribute.setValue(entry.getValue());
            domElement.setAttributeNodeNS(attribute);
            if (Configuration.isIDAttribute(entry.getKey())
                    || body.getUnknownAttributes().isIDAttribute(entry.getKey())) {
                attribute.getOwnerElement().setIdAttributeNode(attribute, true);
            }
        }
    }
View Full Code Here

        signMessage(samlMsgCtx);

        log.debug("Building SOAP envelope");

        Envelope envelope = envBuilder.buildObject();
        Body body = bodyBuilder.buildObject();
        envelope.setBody(body);
        body.getUnknownXMLObjects().add(samlMessage);

        messageContext.setOutboundMessage(envelope);
    }
View Full Code Here

TOP

Related Classes of juzu.Response$Body

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.