org.openeai.implementations.servlets.jmsrelay
Class JmsRelayServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--org.openeai.implementations.servlets.jmsrelay.JmsRelayServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class JmsRelayServlet
extends javax.servlet.http.HttpServlet

The JmsRelay servlet is a MessageRelay used to allow applications that are not Java aware or XML aware to participate in integrations via messaging using a foreign message format and a foreign transport. In this case, the format is "name/value delimited" format and the protocol is HTTP or HTTPS. This is in contrast to the message format and transport specified by the OpenEAI protocol (XML and JMS). The relay servlet takes the foreign format that it was sent via the foreign transport and converts the data into an Enteprise Message (xml). Then it takes the enterprise message and performs the action specified in the data it was sent and processes the result via JMS. Finally, it converts the enterprise message result back into the foreign format and returns it to the calling application via the foreign transport (HTTP or HTTPS in this case).

Note, this reference implementation does not currently use an OpenEAI EnterpriseLayoutManager to convert the data from Raw data to XML and back. Instead, that logic is coded directly into this class. In the future, it will use an EnterpriseLayoutManager impementation to perform these conversions.

These are the configuration parameters associated to this servlet.

Property Name Required Description
ProducerConfigs yes This is the Sync-Error-Sync publisher that the Router will use when/if there are any errors while processing a message it consumes. It should be configured accordingly. All SyncCommand implementations require a PubSubProducer that must be named 'SyncErrorPublisher' that they use to publish Sync-Error-Sync message if errors occur when they're processing the message. This is useful for SyncCommand implementations in particular because they're generally ran unattended.

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
See Also:
Serialized Form

Constructor Summary
JmsRelayServlet()
           
 
Method Summary
 java.lang.String getServletInfo()
          Get Servlet information
 void init(javax.servlet.ServletConfig config)
          Load properities file associated to the servlet and build the AppConfig object from the contents of the OpenEAI Deployment document referred to by the properties file.
 void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse httpResponse)
          Authenticate the user making the request.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmsRelayServlet

public JmsRelayServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Load properities file associated to the servlet and build the AppConfig object from the contents of the OpenEAI Deployment document referred to by the properties file.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
javax.servlet.ServletException

service

public void service(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse httpResponse)
             throws javax.servlet.ServletException,
                    java.io.IOException
Authenticate the user making the request. Retrieve the data from the HttpServletRequest passed in and convert it into XML. Then, take that data and build an appropriate message object from it. Then, perform the action specified in the data passed in on the message object built from the XML via JMS. Finally, consume the response from the authoritative source and convert it back into the raw format expected by the requesting application and return it.

Overrides:
service in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException

getServletInfo

public java.lang.String getServletInfo()
Get Servlet information

Specified by:
getServletInfo in interface javax.servlet.Servlet
Overrides:
getServletInfo in class javax.servlet.GenericServlet
Returns:
java.lang.String


Copyright © 2002, OpenEAI Software Foundation