Class AbstractWrappedMessage

    • Constructor Detail

      • AbstractWrappedMessage

        protected AbstractWrappedMessage​(Message msg)
    • Method Detail

      • getAttachments

        public Collection<Attachment> getAttachments()
        Description copied from interface: Message
        Retrieve any binary attachments associated with the message.
        Specified by:
        getAttachments in interface Message
        Returns:
        a collection containing the attachments
      • getMessage

        public Message getMessage()
      • setMessage

        public void setMessage​(Message message)
      • getDestination

        public Destination getDestination()
        Specified by:
        getDestination in interface Message
        Returns:
        the associated Destination if message is inbound, null otherwise
      • getInterceptorChain

        public InterceptorChain getInterceptorChain()
        Description copied from interface: Message
        Returns a live copy of the messages interceptor chain. This is useful when an interceptor wants to modify the interceptor chain on the fly.
        Specified by:
        getInterceptorChain in interface Message
        Returns:
        the interceptor chain used to process the message
      • getContent

        public <T> T getContent​(Class<T> format)
        Description copied from interface: Message
        Retrieve the encapsulated content as a particular type. The content is available as a result type if the message is outbound. The content is available as a source type if message is inbound. If the content is not available as the specified type null is returned.
        Specified by:
        getContent in interface Message
        Parameters:
        format - the expected content format
        Returns:
        the encapsulated content
      • removeContent

        public <T> void removeContent​(Class<T> format)
        Description copied from interface: Message
        Removes a content from a message. If some contents are completely consumed, removing them is a good idea
        Specified by:
        removeContent in interface Message
        Parameters:
        format - the format to remove
      • getContentFormats

        public Set<Class<?>> getContentFormats()
        Specified by:
        getContentFormats in interface Message
        Returns:
        the set of currently encapsulated content formats
      • setContent

        public <T> void setContent​(Class<T> format,
                                   Object content)
        Description copied from interface: Message
        Provide the encapsulated content as a particular type (a result type if message is outbound, a source type if message is inbound)
        Specified by:
        setContent in interface Message
        Parameters:
        format - the provided content format
        content - the content to be encapsulated
      • get

        public <T> T get​(Class<T> key)
        Description copied from interface: StringMap
        Convenience method for storing/retrieving typed objects from the map. equivalent to: (T)get(key.getName());
        Specified by:
        get in interface StringMap
        Parameters:
        key - the key
        Returns:
        the value
      • put

        public <T> void put​(Class<T> key,
                            T value)
        Description copied from interface: StringMap
        Convenience method for storing/retrieving typed objects from the map. equivalent to: put(key.getName(), value);
        Specified by:
        put in interface StringMap
        Parameters:
        key - the key
        value - the value
      • remove

        public <T> T remove​(Class<T> key)
        Description copied from interface: StringMap
        Convenience method for removing typed objects from the map. equivalent to: (T)remove(key.getName());
        Specified by:
        remove in interface StringMap
        Parameters:
        key - the key
      • getContextualProperty

        public Object getContextualProperty​(String key)
        Description copied from interface: Message
        Queries the Message object's metadata for a specific property.
        Specified by:
        getContextualProperty in interface Message
        Parameters:
        key - the Message interface's property strings that correlates to the desired property
        Returns:
        the property's value
      • resetContextCache

        public void resetContextCache()
        Description copied from interface: Message
        Resets the cache of contextual properties that messages may contain. Subsequent calls to getContextualProperty will likely recalculate the cache.
        Specified by:
        resetContextCache in interface Message