MessageType - the message type of the message context on which to operatepublic abstract class AbstractMessageEncoder<MessageType> extends AbstractInitializableComponent implements MessageEncoder<MessageType>, UnmodifiableComponent
| Modifier and Type | Field and Description |
|---|---|
private MessageContext<MessageType> |
messageContext
The message context.
|
| 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, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitializeddestroy, isDestroyedprivate MessageContext<MessageType> messageContext
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 AbstractInitializableComponentprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionprotected abstract void doEncode()
throws MessageEncodingException
MessageEncodingException - thrown if there is a problem encoding the messageCopyright © 1999–2019 Shibboleth Consortium. All rights reserved.