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

MessageExchangeTransportFactory

public class MessageExchangeTransportFactory extends Object
This class handles creating an appropriate Message Exchange Handler. Currently we support only InOnly and InOut message exchange patterns.
author
bhavanishankar@dev.java.net

Fields Summary
private static Logger
logger
Constructors Summary
Methods Summary
public static MessageExchangeTransportgetHandler(javax.jbi.messaging.MessageExchange me)

    
         
        
        MessageExchangeTransport handler;
        
        if(me instanceof InOut) {
            handler =
                    me.getRole().equals(MessageExchange.Role.PROVIDER)
                    ? new ProviderInOut((InOut)me)
                    : new ConsumerInOut((InOut)me);
        } else if (me instanceof InOnly) {
            handler =
                    me.getRole().equals(MessageExchange.Role.PROVIDER)
                    ? new ProviderInOnly((InOnly)me)
                    : new ConsumerInOnly((InOnly)me);
        } else { // Currently we don't support for other types of MEP.
            handler = null;
        }
        
	    if(logger.isLoggable(Level.FINE)) {	
        	logger.log(Level.FINE, "Handler = " + handler);
		}
        
        return handler;