package org.apache.catalina.tribes.group.interceptors;
+import java.text.DecimalFormat;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+
import org.apache.catalina.tribes.ChannelException;
import org.apache.catalina.tribes.ChannelMessage;
import org.apache.catalina.tribes.Member;
import org.apache.catalina.tribes.group.InterceptorPayload;
import org.apache.catalina.tribes.io.ChannelData;
import org.apache.catalina.tribes.io.XByteBuffer;
-import java.text.DecimalFormat;
-import org.apache.catalina.tribes.membership.MemberImpl;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
super.sendMessage(destination, msg, payload);
}catch ( ChannelException x ) {
msgTxErr.addAndGet(1);
- access.addAndGet(-1);
+ if ( access.get() == 1 ) access.addAndGet(-1);
throw x;
}
mbTx += ((double)(bytes*destination.length))/(1024d*1024d);
return interval;
}
+ public double getLastCnt() {
+ return lastCnt;
+ }
+
+ public double getMbAppTx() {
+ return mbAppTx;
+ }
+
+ public double getMbRx() {
+ return mbRx;
+ }
+
+ public double getMbTx() {
+ return mbTx;
+ }
+
+ public AtomicLong getMsgRxCnt() {
+ return msgRxCnt;
+ }
+
+ public AtomicLong getMsgTxCnt() {
+ return msgTxCnt;
+ }
+
+ public AtomicLong getMsgTxErr() {
+ return msgTxErr;
+ }
+
+ public long getRxStart() {
+ return rxStart;
+ }
+
+ public double getTimeTx() {
+ return timeTx;
+ }
+
+ public long getTxStart() {
+ return txStart;
+ }
+
}
while (i.hasNext()) {
Map.Entry e = (Map.Entry) i.next();
MapEntry entry = (MapEntry) super.get(e.getKey());
- if ( entry.isSerializable() ) {
+ if ( entry != null && entry.isSerializable() ) {
boolean copy = (mapmsg.getMsgType() == mapmsg.MSG_STATE_COPY);
MapMessage me = new MapMessage(mapContextName,
copy?MapMessage.MSG_COPY:MapMessage.MSG_PROXY,
while (i.hasNext()) {
Map.Entry e = (Map.Entry) i.next();
MapEntry entry = (MapEntry) super.get(e.getKey());
+ if (entry==null) continue;
if (entry.isPrimary() && inSet(member,entry.getBackupNodes())) {
if (log.isDebugEnabled()) log.debug("[1] Primary choosing a new backup");
try {
while (i.hasNext()) {
Map.Entry e = (Map.Entry) i.next();
MapEntry entry = (MapEntry) super.get(e.getKey());
- if (entry.isPrimary() && value.equals(entry.getValue())) return true;
+ if (entry!=null && entry.isPrimary() && value.equals(entry.getValue())) return true;
}//while
return false;
}//end if
while ( i.hasNext() ) {
Map.Entry e = (Map.Entry)i.next();
MapEntry entry = (MapEntry)super.get(e.getKey());
- if ( entry.isPrimary() && entry.getValue()!=null) values.add(entry.getValue());
+ if (entry!=null && entry.isPrimary() && entry.getValue()!=null) values.add(entry.getValue());
}
return Collections.unmodifiableCollection(values);
}