Interface MessageEncoder

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void encode()
      Encode the MessageContext supplied via setMessageContext(MessageContext) to the sink.
      void prepareContext()
      This method should prepare the message context by creating and populating any binding-specific data structures required in the MessageContext, prior to actually encoding.
      void setMessageContext​(MessageContext messageContext)
      Set the MessageContext which is to be encoded.
      • Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent

        destroy, isDestroyed
      • Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent

        initialize, isInitialized
    • Method Detail

      • prepareContext

        void prepareContext()
                     throws MessageEncodingException
        This method should prepare the message context by creating and populating any binding-specific data structures required in the MessageContext, prior to actually encoding.

        This method should be called after the MessageContext has been set, and before any binding-specific Handler or HandlerChains are invoked.

        Example: For a SOAP encoder, this method would create and store the basic SOAP Envelope structure in the message context, so that Handlers that are invoked have a place to which to add headers.

        This method may be a no-op if not required by the binding, or if the message type of the context implies that the binding-specific structures have already been created elsewhere (e.g. message-oriented code where the calling code already knows its SOAP, and is operating on the raw SOAP envelope anyway).

        Throws:
        MessageEncodingException - if there is a problem preparing the message context for encoding
      • setMessageContext

        void setMessageContext​(MessageContext messageContext)
        Set the MessageContext which is to be encoded.
        Parameters:
        messageContext - the message context