FileDocCategorySizeDatePackage
ConsumerInOnly.javaAPI DocGlassfish v2 API4749Fri May 04 22:30:26 BST 2007com.sun.enterprise.jbi.serviceengine.comm

ConsumerInOnly

public class ConsumerInOnly extends MessageExchangeTransportImpl
This class handles sending message to & receiving message from NMR when 1) Role of the component is Consumer. 2) Message exchange pattern is In-Only.
author
bhavanishankar@dev.java.net

Fields Summary
protected javax.jbi.messaging.InOnly
me
Constructors Summary
public ConsumerInOnly(javax.jbi.messaging.InOnly me)

        super(me);
        this.me = me;
    
Methods Summary
public UnWrappedMessagereceive(com.sun.enterprise.jbi.serviceengine.util.soap.EndpointMetaData emd)

        preReceive();
        return null;
    
public javax.jbi.messaging.NormalizedMessagereceiveNormalized()

        return null;
    
public voidsend(javax.jbi.messaging.NormalizedMessage request)

        this.msg = request;
        me.setInMessage(request);
        send();
    
public voidsend(com.sun.xml.ws.api.message.Message message, com.sun.enterprise.jbi.serviceengine.util.soap.EndpointMetaData emd)

        String operationName = me.getOperation().getLocalPart();
        WrappedMessage wrappedMessage = new WrappedMessage();
        wrappedMessage.setAbstractMessage(message);
        
        if(message.isFault()) {
            wrappedMessage.wrapFault(operationName, emd);
        } else {
            wrappedMessage.setWSDLBindingStyle(emd.getBindingStyle(operationName));
            wrappedMessage.setWSDLMessageType(emd.getInputMessage(operationName).getQName());
            wrappedMessage.setWSDLMessageName(emd.getOperationInputName(operationName));
            wrappedMessage.setWSDLOrderedParts(emd.getInputMessage(operationName).getOrderedParts(null));
            wrappedMessage.setWSDLPartBindings(emd.getInputPartBindings(operationName));
            wrappedMessage.wrap();
        }
        NormalizedMessage normalizedMessage = me.createMessage();
        normalizedMessage.setContent(wrappedMessage.readPayloadAsSource());
        /**
         * Process the attachments.
         */
        for(Attachment attachment : (Iterable<Attachment>)message.getAttachments()) {
            logger.log(Level.FINE, "Adding attachment to Normalized Message, attachmentID = "
                    + attachment.getContentId());
            normalizedMessage.addAttachment(attachment.getContentId(), attachment.asDataHandler());
        }
        send(normalizedMessage);