axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James M Snell" <jasn...@us.ibm.com>
Subject Notes on the Axis Internal Message Exchange implementation
Date Wed, 30 Oct 2002 00:39:50 GMT
Ok, the initial interfaces and base implementation of the new Axis 
Internal Message Exchange interfaces have been checked in and are ready 
for review.  Over time (following the phased plan I posted previously), 
Transport, Provider, and AxisEngine impl's will all change from being 
Handlers to being MessageExchangeProviders (impl's of the abstract class 
org.apache.axis.ime.internal.MessageExchangeProvider).

The MessageExchangeProvider based class handles all of the basic thread 
and lifecycle management, and invocation of request/response (called 
send/receive) handlers.  The MessageExchangeProvider is capable of 
Send-Only, Send-and-Receive and Receive-Only message exchanges.  Impl's of 
the base class need only to provide 4 pieces of information to the 
MessageExchangeProvider to function:

     1. The Send (Request) handler
     2. The Receive (Response) handler
     3. The MessageExchangeSendListener ==> the class that tells the 
threads monitoring outbound (send) message flow how to process messages. 
For example, in a JMS Transport, the MessageExchangeSendListener impl 
would be responsible for putting messages onto the JMS Queue's or Topics.
    4. The ReceivedMessageDispatchPolicy ==> the class that tells the 
threads monitoring inbound (receive) message flow how to dispatch messages 
to waiting consumers.  For example, if using the 
FirstComeFirstServeDispatchPolicy provided in the code, if two application 
threads call the MessageExchange.receive operation, both passing in the 
same MessageExchangeCorrelator, the thread whose request is received first 
will get the received message.  The thread whose request is received 
second will be queued until another matching message is received. 
ReceiveMessageDispatchPolicy is designed to be a pluggable and extensible 
mechanism to allow implementations of MessageExchangeProvider to customize 
how messages are dispatched.

See org.apache.axis.ime.internal.util.handler.HandlerMessageExchange to 
see an example of a MessageExchangeProvider implementation.  This one 
wraps the async MessageExchange interfaces around the synchronous handler 
interface.  All MessageExchangeProvider implementations will follow this 
same basic pattern.

One very important thing to note.  MessageExchange interface 
implementations ARE NOT REQUIRED to use the base implementation provided 
by the MessageExchangeProvider class.  Nor are they required to use ANY of 
the utility classes located in and under the org.apache.axis.ime.internal 
package.  In cases where a MessageExchange implementation requires unique 
thread management, handler flow control, etc, implementations can build 
new MessageExchange implementations from the ground up.  The 
org.apache.axis.ime.internal package is provided to make things easier for 
implementors who do not have special requirements.

I have little doubt that the org.apache.axis.ime.internal base impl is 
going to need a bit of tweaking as we begin to migrate the various 
subsystems within Axis over to the new interfaces.  These tweaks are only 
going to become apparent as we start the migration.  As according to the 
development plan I posted previously, we'll start migrating the client 
side transports first.  The goal is to get the transports completely over 
to the new model without breaking any of the existing tests or affecting 
any other part of Axis.

As usual, feel free to start complaining/sending praise about this effort 
:-)

- James Snell
     IBM Emerging Technologies
     jasnell@us.ibm.com
     (559) 587-1233 (office)
     (700) 544-9035 (t/l)
     Programming Web Services With SOAP
         O'Reilly & Associates, ISBN 0596000952

     Have I not commanded you? Be strong and courageous. 
     Do not be terrified, do not be discouraged, for the Lord your 
     God will be with you whereever you go.    - Joshua 1:9

Mime
View raw message