Code, JavaEE, SOA, WebServices

Messaging Lifecycle Design

Goals:

  1. Abstract away common details for processing data exchanged using Messaging Oriented Middleware.
  2. Start with the common items and drill-down into the details.
  3. Support exchanging various types of text data, e.g., JSON, XML, YML, CSV
  4. Declare a lifecycle interface with the common items defined to be implemented by an abstract class which will them be subclassed by detail classes.

MessagingLifecycle <interface>

import javax.jms.Message;
import java.io.InputStream;
import java.util.Map;

public interface MessagingLifecycle {

/**
 * loadProductMetaData
 *
 * Loads ALL meta data connected to the given object instance
 * @return
 */
 public Map<String, Object> loadProductMetaData();

/**
 * convertMessageToInputStream
 *
 * Converts the given message to an InputStream
 * @param message
 * @return
 */
 public InputStream convertMessageToInputStream(Message message);

/**
 * performXSLTransformations
 *
 * Allows a product's given XML to be massaged using XPath
 * @param inputStream
 * @return
 */
 public InputStream performXSLTransformations(InputStream inputStream);

/**
 * convertInputStreamToXMLForRequestType
 *
 * Convert the inputStream into a JAXB object instance
 * @param inputStream
 * @param typeToConvertTo
 * @return
 */
 public Object convertInputStreamToXMLForRequestType(InputStream inputStream, Class typeToConvertTo);

}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s