MessageType
- the message type of the message context on which to operatepublic abstract class AbstractMessageEncoder<MessageType> extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponent implements MessageEncoder<MessageType>, net.shibboleth.utilities.java.support.component.UnmodifiableComponent
Constructor and Description |
---|
AbstractMessageEncoder() |
Modifier and Type | Method and Description |
---|---|
protected void |
doDestroy() |
protected abstract void |
doEncode()
Performs the encoding logic.
|
protected void |
doInitialize() |
void |
encode()
Encode the
MessageContext supplied via MessageEncoder.setMessageContext(MessageContext) to the sink. |
protected MessageContext<MessageType> |
getMessageContext()
Get the message context.
|
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<MessageType> context)
Set the
MessageContext which is to be encoded. |
destroy, initialize, isDestroyed, isInitialized
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public void setMessageContext(MessageContext<MessageType> context)
MessageContext
which is to be encoded.setMessageContext
in interface MessageEncoder<MessageType>
context
- the message contextpublic void encode() throws MessageEncodingException
MessageContext
supplied via MessageEncoder.setMessageContext(MessageContext)
to the sink.encode
in interface MessageEncoder<MessageType>
MessageEncodingException
- if there is a problem encoding the message contextpublic void prepareContext() throws MessageEncodingException
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).
. Default implementation is a no-op.prepareContext
in interface MessageEncoder<MessageType>
MessageEncodingException
- if there is a problem preparing the message context for encodingprotected MessageContext<MessageType> getMessageContext()
protected void doDestroy()
doDestroy
in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
protected void doInitialize() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
doInitialize
in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
net.shibboleth.utilities.java.support.component.ComponentInitializationException
protected abstract void doEncode() throws MessageEncodingException
MessageEncodingException
- thrown if there is a problem encoding the messageCopyright © 2016. All rights reserved.