Book Image

Service Oriented Java Business Integration

Book Image

Service Oriented Java Business Integration

Overview of this book

Table of Contents (23 chapters)
Service Oriented Java Business Integration
Credits
About the Author
Acknowledgement
About the Reviewers
Preface

ServiceMix Component Helper Classes


ServiceMix provides a lot of plumbing code in the form of reusable component helper classes. Most of these classes are abstract base classes from which the developer can derive their own classes to put custom logic. The main classes of interest and their relationship are shown in the following figure:

MessageExchangeListener

MessageExchangeListener is a ServiceMix package interface, very similar to the JMS MessageListener. This interface is shown in the following code:

package org.apache.servicemix;
import javax.jbi.messaging.MessageExchange;
import javax.jbi.messaging.MessagingException;
public interface MessageExchangeListener
{
/** * MessageExchange passed directly to the listener * instead of being queued * * @param exchange * @throws MessagingException */
public void onMessageExchange(MessageExchange exchange) throws MessagingException;
}

When our custom components implement this interface, we will be able to receive new message exchanges easily...