Author: fhanik Date: Fri Mar 17 22:37:07 2006 New Revision: 386815 URL: http://svn.apache.org/viewcvs?rev=386815&view=rev Log: send options is configurable on the abstract map
Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/LazyReplicatedMap.java tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/ReplicatedMap.java Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=386815&r1=386814&r2=386815&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java Fri Mar 17 22:37:07 2006 @@ -65,6 +65,8 @@ private transient boolean stateTransferred = false; private transient Object stateMutex = new Object(); private transient ArrayList mapMembers = new ArrayList(); + + private transient int channelSendOptions = Channel.SEND_OPTIONS_DEFAULT; //------------------------------------------------------------------------------ // CONSTRUCTORS @@ -78,10 +80,15 @@ * @param initialCapacity int - the size of this map, see HashMap * @param loadFactor float - load factor, see HashMap */ - public AbstractReplicatedMap(Channel channel, long timeout, String mapContextName, int initialCapacity, - float loadFactor) { + public AbstractReplicatedMap(Channel channel, + long timeout, + String mapContextName, + int initialCapacity, + float loadFactor, + int channelSendOptions) { super(initialCapacity, loadFactor); - init(channel, mapContextName, timeout); + init(channel, mapContextName, timeout, channelSendOptions); + } /** @@ -91,9 +98,13 @@ * @param mapContextName String - unique name for this map, to allow multiple maps per channel * @param initialCapacity int - the size of this map, see HashMap */ - public AbstractReplicatedMap(Channel channel, long timeout, String mapContextName, int initialCapacity) { + public AbstractReplicatedMap(Channel channel, + long timeout, + String mapContextName, + int initialCapacity, + int channelSendOptions) { super(initialCapacity); - init(channel, mapContextName, timeout); + init(channel, mapContextName, timeout, channelSendOptions); } /** @@ -102,18 +113,21 @@ * @param timeout long - timeout for RPC messags * @param mapContextName String - unique name for this map, to allow multiple maps per channel */ - public AbstractReplicatedMap(Channel channel, long timeout, String mapContextName) { + public AbstractReplicatedMap(Channel channel, + long timeout, + String mapContextName, + int channelSendOptions) { super(); - init(channel, mapContextName, timeout); + init(channel, mapContextName, timeout, channelSendOptions); } protected Member[] wrap(Member m) { return new Member[] {m}; } - private void init(Channel channel, String mapContextName, long timeout) { + private void init(Channel channel, String mapContextName, long timeout, int channelSendOptions) { final String chset = "ISO-8859-1"; - + this.channelSendOptions = channelSendOptions; this.channel = channel; this.rpcTimeout = timeout; @@ -134,7 +148,7 @@ //send out a map membership message, only wait for the first reply MapMessage msg = new MapMessage(this.mapContextName, MapMessage.MSG_START, false, null, null, null, wrap(channel.getLocalMember(false))); - Response[] resp = rpcChannel.send(channel.getMembers(), msg, rpcChannel.FIRST_REPLY, Channel.SEND_OPTIONS_DEFAULT, timeout); + Response[] resp = rpcChannel.send(channel.getMembers(), msg, rpcChannel.FIRST_REPLY, channelSendOptions, timeout); for (int i = 0; i < resp.length; i++) { messageReceived(resp[i].getMessage(), resp[i].getSource()); } @@ -254,7 +268,7 @@ if (backup != null) { MapMessage msg = new MapMessage(mapContextName, MapMessage.MSG_STATE, false, null, null, null, null); - Response[] resp = rpcChannel.send(new Member[] {backup}, msg, rpcChannel.FIRST_REPLY, Channel.SEND_OPTIONS_DEFAULT, rpcTimeout); + Response[] resp = rpcChannel.send(new Member[] {backup}, msg, rpcChannel.FIRST_REPLY, channelSendOptions, rpcTimeout); if (resp.length > 0) { msg = (MapMessage) resp[0].getMessage(); ArrayList list = (ArrayList) msg.getValue(); Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/LazyReplicatedMap.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/LazyReplicatedMap.java?rev=386815&r1=386814&r2=386815&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/LazyReplicatedMap.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/LazyReplicatedMap.java Fri Mar 17 22:37:07 2006 @@ -85,7 +85,7 @@ * @param loadFactor float - load factor, see HashMap */ public LazyReplicatedMap(Channel channel, long timeout, String mapContextName, int initialCapacity, float loadFactor) { - super(channel,timeout,mapContextName,initialCapacity,loadFactor); + super(channel,timeout,mapContextName,initialCapacity,loadFactor, Channel.SEND_OPTIONS_DEFAULT); } /** @@ -96,7 +96,7 @@ * @param initialCapacity int - the size of this map, see HashMap */ public LazyReplicatedMap(Channel channel, long timeout, String mapContextName, int initialCapacity) { - super(channel,timeout,mapContextName,initialCapacity); + super(channel,timeout,mapContextName,initialCapacity, Channel.SEND_OPTIONS_DEFAULT); } /** @@ -106,7 +106,7 @@ * @param mapContextName String - unique name for this map, to allow multiple maps per channel */ public LazyReplicatedMap(Channel channel, long timeout, String mapContextName) { - super(channel,timeout,mapContextName); + super(channel,timeout,mapContextName, Channel.SEND_OPTIONS_DEFAULT); } Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/ReplicatedMap.java URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/ReplicatedMap.java?rev=386815&r1=386814&r2=386815&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/ReplicatedMap.java (original) +++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/tipis/ReplicatedMap.java Fri Mar 17 22:37:07 2006 @@ -68,7 +68,7 @@ */ public ReplicatedMap(Channel channel, long timeout, String mapContextName, int initialCapacity, float loadFactor) { - super(channel, timeout, mapContextName, initialCapacity, loadFactor); + super(channel, timeout, mapContextName, initialCapacity, loadFactor, Channel.SEND_OPTIONS_DEFAULT); } /** @@ -79,7 +79,7 @@ * @param initialCapacity int - the size of this map, see HashMap */ public ReplicatedMap(Channel channel, long timeout, String mapContextName, int initialCapacity) { - super(channel, timeout, mapContextName, initialCapacity); + super(channel, timeout, mapContextName, initialCapacity, Channel.SEND_OPTIONS_DEFAULT); } /** @@ -89,7 +89,7 @@ * @param mapContextName String - unique name for this map, to allow multiple maps per channel */ public ReplicatedMap(Channel channel, long timeout, String mapContextName) { - super(channel, timeout, mapContextName); + super(channel, timeout, mapContextName, Channel.SEND_OPTIONS_DEFAULT); } //------------------------------------------------------------------------------ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]