jmsnell 2002/12/04 16:31:08
Modified: java/src/org/apache/axis/ime/internal
MessageExchangeReceiveContext.java
MessageExchangeSendContext.java
MessageExchangeImpl.java
Log:
Just refining the base implementation a bit more to reduce duplication
of code, creation of unnecessary objects, etc. Minor updates
Revision Changes Path
1.3 +5 -3
xml-axis/java/src/org/apache/axis/ime/internal/MessageExchangeReceiveContext.java
Index: MessageExchangeReceiveContext.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/ime/internal/MessageExchangeReceiveContext.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MessageExchangeReceiveContext.java 13 Nov 2002 05:24:20 -0000 1.2
+++ MessageExchangeReceiveContext.java 5 Dec 2002 00:31:08 -0000 1.3
@@ -56,12 +56,14 @@
import org.apache.axis.ime.MessageExchangeCorrelator;
import org.apache.axis.ime.MessageExchangeEventListener;
+import java.io.Serializable;
/**
* @author James M Snell ([EMAIL PROTECTED])
* @author Ray Chun ([EMAIL PROTECTED])
*/
-public class MessageExchangeReceiveContext {
+public class MessageExchangeReceiveContext
+ implements Serializable {
public static MessageExchangeReceiveContext newInstance(
MessageExchangeCorrelator correlator,
@@ -74,9 +76,9 @@
}
protected MessageExchangeEventListener listener;
- protected MessageExchangeCorrelator correlator;
+ protected MessageExchangeCorrelator correlator;
- protected MessageExchangeReceiveContext() {}
+ protected MessageExchangeReceiveContext() {}
public MessageExchangeCorrelator getMessageExchangeCorrelator() {
return this.correlator;
1.3 +4 -16
xml-axis/java/src/org/apache/axis/ime/internal/MessageExchangeSendContext.java
Index: MessageExchangeSendContext.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/ime/internal/MessageExchangeSendContext.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MessageExchangeSendContext.java 13 Nov 2002 05:24:19 -0000 1.2
+++ MessageExchangeSendContext.java 5 Dec 2002 00:31:08 -0000 1.3
@@ -58,8 +58,6 @@
import org.apache.axis.ime.MessageExchangeCorrelator;
import org.apache.axis.ime.MessageExchangeEventListener;
-import java.io.Serializable;
-
/**
* Note: the only challenge with making this class serializable
* is that org.apache.axis.MessageContext is currently NOT
@@ -72,36 +70,26 @@
* @author Ray Chun ([EMAIL PROTECTED])
*/
public final class MessageExchangeSendContext
- implements Serializable {
+ extends MessageExchangeReceiveContext {
public static MessageExchangeSendContext newInstance(
MessageExchangeCorrelator correlator,
MessageContext context,
- MessageExchangeEventListener eventListener) {
+ MessageExchangeEventListener listener) {
MessageExchangeSendContext mectx =
new MessageExchangeSendContext();
mectx.correlator = correlator;
mectx.context = context;
- mectx.eventListener = eventListener;
+ mectx.listener = listener;
return mectx;
}
- protected MessageExchangeCorrelator correlator;
- protected MessageExchangeEventListener eventListener;
protected MessageContext context;
- protected MessageExchangeSendContext() {
- }
-
- public MessageExchangeCorrelator getMessageExchangeCorrelator() {
- return this.correlator;
- }
+ protected MessageExchangeSendContext() {}
public MessageContext getMessageContext() {
return this.context;
}
- public MessageExchangeEventListener getMessageExchangeEventListener() {
- return this.eventListener;
- }
}
1.13 +6 -8
xml-axis/java/src/org/apache/axis/ime/internal/MessageExchangeImpl.java
Index: MessageExchangeImpl.java
===================================================================
RCS file:
/home/cvs/xml-axis/java/src/org/apache/axis/ime/internal/MessageExchangeImpl.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- MessageExchangeImpl.java 4 Dec 2002 21:32:45 -0000 1.12
+++ MessageExchangeImpl.java 5 Dec 2002 00:31:08 -0000 1.13
@@ -121,17 +121,15 @@
MessageExchangeConstants.MESSAGE_CORRELATOR_PROPERTY,
correlator);
}
- if (listener != null) {
- provider.processReceive(
- MessageExchangeReceiveContext.newInstance(
- correlator,
- listener));
- }
- provider.processSend(
+ MessageExchangeSendContext sendContext =
MessageExchangeSendContext.newInstance(
correlator,
context,
- listener));
+ listener);
+ if (listener != null) {
+ provider.processReceive(sendContext);
+ }
+ provider.processSend(sendContext);
if (log.isDebugEnabled()) {
log.debug("Exit: MessageExchangeImpl::send");
}