jmsnell 2002/10/26 14:46:47
Modified: java build.xml
java/xmls targets.xml
Added: java/src/org/apache/axis/ime
MessageExchangeStatusListener.java
MessageExchangeReceiveListener.java
MessageExchange.java
MessageExchangeCorrelatorService.java
MessageExchangeContext.java
MessageExchangeConstants.java
ConfigurableMessageExchange.java
MessageExchangeLifecycle.java
MessageExchangeStatus.java
MessageExchangeContextListener.java
MessageChannel.java MessageExchangeFactory.java
ConfigurableMessageExchangeFactory.java
MessageExchangeCorrelator.java
MessageExchangeFaultListener.java
Log:
Initial Commit of the Axis Internal Message Exchange (AIME) interfaces.
By default, the build will skip the org.apache.axis.ime package.
To compile the org.apache.axis.ime package, set the compileime
environment variable to true then compile as normal.
Revision Changes Path
1.1
xml-axis/java/src/org/apache/axis/ime/MessageExchangeStatusListener.java
Index: MessageExchangeStatusListener.java
===================================================================
package org.apache.axis.ime;
import java.io.Serializable;
/**
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageExchangeStatusListener
extends Serializable {
public void onStatus(
MessageExchangeCorrelator correlator,
MessageExchangeStatus status);
}
1.1
xml-axis/java/src/org/apache/axis/ime/MessageExchangeReceiveListener.java
Index: MessageExchangeReceiveListener.java
===================================================================
package org.apache.axis.ime;
import java.io.Serializable;
import org.apache.axis.MessageContext;
/**
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageExchangeReceiveListener
extends Serializable {
public void onReceive(
MessageExchangeCorrelator correlator,
MessageContext context);
}
1.1 xml-axis/java/src/org/apache/axis/ime/MessageExchange.java
Index: MessageExchange.java
===================================================================
package org.apache.axis.ime;
import org.apache.axis.AxisFault;
import org.apache.axis.MessageContext;
/**
* Represents the boundary interface through which messages
* are exchanged. This interface supports both push and pull
* models for receiving inbound messages.
*
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageExchange {
/**
* Send an outbound message. (Impl's of this method
* need to create a new MessageExchangeCorrelator and
* put it into the MessageContext if one does not already
* exist.)
*/
public MessageExchangeCorrelator send(
MessageContext context)
throws AxisFault;
/**
* Will attempt to cancel the outbound MessageExchange
* process for a given message context. Returns true if
* an only if the MessageContext was canceled. A false
* response indicates that the MessageContext could not
* be removed from the outbound channel for whatever
* reason.
*/
public MessageContext cancel(
MessageExchangeCorrelator correlator)
throws AxisFault;
/**
* Waits indefinitely for a message to be received
*/
public MessageContext receive()
throws AxisFault;
/**
* Waits the specified amount of time for a message to
* be received
*/
public MessageContext receive(
long timeout)
throws AxisFault;
/**
* Will instruct the MessageExchange provider to
* wait for a message to be received.
*/
public void startListening();
/**
* Will instruct the MessageExchange provider to
* wait for a specific MessageExchangeCorrelator
*/
public void startListening(
MessageExchangeCorrelator correlator);
/**
* Will instruct the MessageExchange provider to
* stop listening
*/
public void stopListening();
/**
* Synchronized send and receive
*/
public MessageContext sendAndReceive(
MessageContext context)
throws AxisFault;
/**
* Synchronized send and receive with timeout
*/
public MessageContext sendAndReceive(
MessageContext context,
long timeout)
throws AxisFault;
/**
* Allows applications to listen for changes to
* the current disposition of the MessageExchange operation
* (push model)
*/
public void setMessageExchangeStatusListener(
MessageExchangeStatusListener listener)
throws AxisFault;
/**
* Allows applications to listen for inbound messages
* (push model)
*/
public void setMessageExchangeReceiveListener(
MessageExchangeReceiveListener listener)
throws AxisFault;
/**
* Allows applications to listen for faults/exceptions
* (push model)
*/
public void setMessageExchangeFaultListener(
MessageExchangeFaultListener listener)
throws AxisFault;
/**
* Allows MessageExchange consumers low level access
* to the Send message channel
*/
public MessageChannel getSendChannel();
/**
* Allows MessageExchange consumers low level access
* to the Receive message channel
*/
public MessageChannel getReceiveChannel();
}
1.1
xml-axis/java/src/org/apache/axis/ime/MessageExchangeCorrelatorService.java
Index: MessageExchangeCorrelatorService.java
===================================================================
package org.apache.axis.ime;
/**
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageExchangeCorrelatorService {
public void put(
MessageExchangeCorrelator correlator,
MessageExchangeContext context);
public MessageExchangeContext get(
MessageExchangeCorrelator correlator);
}
1.1
xml-axis/java/src/org/apache/axis/ime/MessageExchangeContext.java
Index: MessageExchangeContext.java
===================================================================
package org.apache.axis.ime;
import java.io.Serializable;
import org.apache.axis.MessageContext;
/**
* Note: the only challenge with making this class serializable
* is that org.apache.axis.MessageContext is currently NOT
* serializable. MessageContext needs to change in order to
* take advantage of persistent Channels and CorrelatorServices
*
* For thread safety, instances of this class are immutable
*
* @author James M Snell ([EMAIL PROTECTED])
*/
public final class MessageExchangeContext
implements Serializable {
public static MessageExchangeContext newInstance(
MessageExchangeCorrelator correlator,
MessageExchangeStatusListener statusListener,
MessageExchangeReceiveListener receiveListener,
MessageExchangeFaultListener faultListener,
MessageContext context) {
MessageExchangeContext mectx =
new MessageExchangeContext();
mectx.correlator = correlator;
mectx.statusListener = statusListener;
mectx.receiveListener = receiveListener;
mectx.faultListener = faultListener;
mectx.context = context;
return mectx;
}
protected MessageExchangeCorrelator correlator;
protected MessageExchangeStatusListener statusListener;
protected MessageExchangeReceiveListener receiveListener;
protected MessageExchangeFaultListener faultListener;
protected MessageContext context;
protected MessageExchangeContext() {}
public MessageExchangeCorrelator getMessageExchangeCorrelator() {
return this.correlator;
}
public MessageExchangeReceiveListener getMessageExchangeReceiveListener() {
return this.receiveListener;
}
public MessageExchangeStatusListener getMessageExchangeStatusListener() {
return this.statusListener;
}
public MessageExchangeFaultListener getMessageExchangeFaultListener() {
return this.faultListener;
}
public MessageContext getMessageContext() {
return this.context;
}
}
1.1
xml-axis/java/src/org/apache/axis/ime/MessageExchangeConstants.java
Index: MessageExchangeConstants.java
===================================================================
package org.apache.axis.ime;
/**
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageExchangeConstants {
//** MessageContext properties **//
/**
* Identifies the MessageExchangeCorrelator property
* within the MessageContext
*/
public static final String MESSAGE_CORRELATOR_PROPERTY =
MessageExchangeCorrelator.class.getName();
/**
* Boolean MessageContext property that indicates whether or
* not the MessageExchangeCorrelationService should be used.
* (e.g. when sending a one-way message, correlation is not
* required)
*/
public static final String ENABLE_CORRELATOR_SERVICE =
MESSAGE_CORRELATOR_PROPERTY + "::Enable";
/**
* Default value for the ENABLE_CORRELATOR_SERVICE
* MessageContext property
*/
public static final Boolean ENABLE_CORRELATOR_SERVICE_DEFAULT =
new Boolean(true);
}
1.1
xml-axis/java/src/org/apache/axis/ime/ConfigurableMessageExchange.java
Index: ConfigurableMessageExchange.java
===================================================================
package org.apache.axis.ime;
import java.util.Map;
/**
* Extends the basic MessageExchange interface to allow
* applications to configure the MessageExchange
*
* Feature == a collection of default properties that
* represent a complex behavior of some sort.
* Reliable Delivery, for example.
*
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface ConfigurableMessageExchange
extends MessageExchange {
public void enableFeature(String featureId);
public void disableFeature(String featureId);
public boolean isFeatureEnabled(String featureId);
public void setProperty(
String propertyId,
Object propertyValue);
public Object getProperty(
String propertyId);
public Object getProperty(
String propertyId,
Object defaultValue);
public Map getProperties();
public void clearProperties();
}
1.1
xml-axis/java/src/org/apache/axis/ime/MessageExchangeLifecycle.java
Index: MessageExchangeLifecycle.java
===================================================================
package org.apache.axis.ime;
/**
* Interface that may be provided by MessageExchange impl's
* to allow users to control the lifecycle of the "stuff"
* going on under the covers
*
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageExchangeLifecycle {
public void init();
public void shutdown();
public void shutdown(boolean force);
public void awaitShutdown()
throws InterruptedException;
public void awaitShutdown(long timeout)
throws InterruptedException;
}
1.1 xml-axis/java/src/org/apache/axis/ime/MessageExchangeStatus.java
Index: MessageExchangeStatus.java
===================================================================
package org.apache.axis.ime;
import java.io.Serializable;
/**
* Used to indicate a custom MessageExchange event
*
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageExchangeStatus
extends Serializable {}
1.1
xml-axis/java/src/org/apache/axis/ime/MessageExchangeContextListener.java
Index: MessageExchangeContextListener.java
===================================================================
package org.apache.axis.ime;
import java.io.Serializable;
import org.apache.axis.ime.*;
/**
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageExchangeContextListener
extends Serializable {
public void onMessageExchangeContext(
MessageExchangeContext context);
}
1.1 xml-axis/java/src/org/apache/axis/ime/MessageChannel.java
Index: MessageChannel.java
===================================================================
package org.apache.axis.ime;
/**
* A MessageChannel is a low level hybrid FIFO Queue and Keyed map
* that serves as the storage for inbound or outbound messages.
* Each MessageExchange implementation will create at least two
* MessageChannels, one for messages being sent, and another for
* messages that have been received.
*
* MessageChannels differ from traditional FIFO Queues in that
* elements put in are keyed and can be taken out of order.
*
* Different implementations may allow for variations on
* how the MessageChannel model is implemented. For instance,
* the code will ship with a NonPersistentMessageChannel that
* will store all contained objects in memory. The fact that
* everything is stored in memory means that the Channel is not
* fault tolerant. If fault tolerance is required, then a
* PersistentMessageChannel must be created that stores the
* MessageContext objects somehow.
*
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageChannel {
/**
* Select, but do not remove the next message on the
* channel. If one does not exist, return null
*/
public MessageExchangeContext peek();
/**
* Put a message onto the channel
*/
public void put(
Object key,
MessageExchangeContext context);
/**
* Cancel a message that has been put on the channel.
* Unlike select(Object key), this method will not block
* and wait for a message with the specified key to be
* put onto the MessageChannel.
*/
public MessageExchangeContext cancel(
Object key);
/**
* Select and remove all of the messages currently in
* the channel (useful for bulk operations). This
* method will not block. It is also not guaranteed
* that the Channel will be empty once this operation
* returns (it is possible that another thread may
* put new MessageContexts into the channel before this
* operation completes)
*/
public MessageExchangeContext[] selectAll();
/**
* Select and remove the next message in the channel
* If a message is not available, wait indefinitely for one
*/
public MessageExchangeContext select()
throws InterruptedException;
/**
* Select and remove the next message in the channel
* If a message is not available, wait the specified amount
* of time for one
*/
public MessageExchangeContext select(
long timeout)
throws InterruptedException;
/**
* Select and remove a specific message in the channel
* If the message is not available, wait indefinitely
* for one to be available
*/
public MessageExchangeContext select(
Object key)
throws InterruptedException;
/**
* Select and remove a specific message in the channel
* If the message is not available, wait the specified
* amount of time for one
*/
public MessageExchangeContext select(
Object key,
long timeout)
throws InterruptedException;
}
1.1
xml-axis/java/src/org/apache/axis/ime/MessageExchangeFactory.java
Index: MessageExchangeFactory.java
===================================================================
package org.apache.axis.ime;
/**
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageExchangeFactory {
public MessageExchange createMessageExchange();
}
1.1
xml-axis/java/src/org/apache/axis/ime/ConfigurableMessageExchangeFactory.java
Index: ConfigurableMessageExchangeFactory.java
===================================================================
package org.apache.axis.ime;
import java.util.Map;
/**
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface ConfigurableMessageExchangeFactory
extends MessageExchangeFactory {
public ConfigurableMessageExchange createMessageExchange(
Map properties,
String[] enabledFeatures);
}
1.1
xml-axis/java/src/org/apache/axis/ime/MessageExchangeCorrelator.java
Index: MessageExchangeCorrelator.java
===================================================================
package org.apache.axis.ime;
import java.io.Serializable;
/**
* Used for correlating outbound/inbound messages.
* This class may be extended to allow for more complex
* Correlation mechanisms
*
* @author James M Snell ([EMAIL PROTECTED])
*/
public class MessageExchangeCorrelator
implements Serializable {
private String identifier;
private MessageExchangeCorrelator() {}
public MessageExchangeCorrelator(
String identifier) {
this.identifier = identifier;
}
public String getIdentifier() {
return this.identifier;
}
}
1.1
xml-axis/java/src/org/apache/axis/ime/MessageExchangeFaultListener.java
Index: MessageExchangeFaultListener.java
===================================================================
package org.apache.axis.ime;
import java.io.Serializable;
/**
* @author James M Snell ([EMAIL PROTECTED])
*/
public interface MessageExchangeFaultListener
extends Serializable {
public void onFault(
MessageExchangeCorrelator correlator,
Throwable exception);
}
1.209 +1 -0 xml-axis/java/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-axis/java/build.xml,v
retrieving revision 1.208
retrieving revision 1.209
diff -u -r1.208 -r1.209
--- build.xml 17 Oct 2002 23:34:57 -0000 1.208
+++ build.xml 26 Oct 2002 21:46:46 -0000 1.209
@@ -125,6 +125,7 @@
<exclude name="**/javax/xml/rpc/server/Servlet*.java"
unless="servlet.present"/>
<exclude name="**/*TestSuite.java" unless="junit.present"/>
<exclude name="**/org/apache/axis/encoding/ser/castor/*.java"
unless="castor.present"/>
+ <exclude name="**/org/apache/axis/ime/**/*" unless="compile.ime" />
</javac>
<copy file="${src.dir}/org/apache/axis/server/server-config.wsdd"
toDir="${build.dest}/org/apache/axis/server"/>
1.47 +13 -0 xml-axis/java/xmls/targets.xml
Index: targets.xml
===================================================================
RCS file: /home/cvs/xml-axis/java/xmls/targets.xml,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- targets.xml 25 Oct 2002 18:24:00 -0000 1.46
+++ targets.xml 26 Oct 2002 21:46:47 -0000 1.47
@@ -236,6 +236,15 @@
<echo level="verbose">iis.found=${iis.found}</echo>
<echo level="verbose">iis.base=${iis.base}</echo>
+
+ <!-- enables/disables compilation of the org.apache.axis.ime package -->
+ <condition property="compile.ime">
+ <and>
+ <equals arg1="${env.compileime}" arg2="true" />
+ </and>
+ </condition>
+ <echo level="verbose">compile.ime=${compile.ime}</echo>
+
</target>
<!-- print out the current enviroment.
@@ -312,6 +321,10 @@
<echo message="test.functional.fail = ${test.functional.fail}" />
<echo message="" />
+ <echo message="-- Internal Message Exchange ---" />
+ <echo message="" />
+ <echo message="compile.ime = ${compile.ime}" />
+ <echo message="" />
<pathconvert targetos="windows" property="classpath.as.string"
refid="classpath"/>
<echo message="classpath: ${classpath.as.string}"/>