[Mc4j-cvs] mc4j/src/org/mc4j/console/util ConnectionInfoAction.java,1.4,1.5 ExceptionUtility.java,1.
Brought to you by:
ghinkl
From: Greg H. <gh...@us...> - 2006-04-12 19:14:41
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/console/util Modified Files: ConnectionInfoAction.java ExceptionUtility.java Log Message: Merging EMS into head for the 2.0 release work Index: ExceptionUtility.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/util/ExceptionUtility.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ExceptionUtility.java 5 Oct 2004 05:16:19 -0000 1.4 --- ExceptionUtility.java 12 Apr 2006 19:14:00 -0000 1.5 *************** *** 101,105 **** Method method = theClass.getMethod("getCause", GET_CAUSE_PARAMS ); ! return (Throwable)method.invoke(throwable, null ); } catch(Throwable t ) { // That didn't work, but that's ok --- 101,105 ---- Method method = theClass.getMethod("getCause", GET_CAUSE_PARAMS ); ! return (Throwable)method.invoke(throwable ); } catch(Throwable t ) { // That didn't work, but that's ok Index: ConnectionInfoAction.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/util/ConnectionInfoAction.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ConnectionInfoAction.java 19 Jan 2005 14:10:34 -0000 1.4 --- ConnectionInfoAction.java 12 Apr 2006 19:14:00 -0000 1.5 *************** *** 17,20 **** --- 17,21 ---- package org.mc4j.console.util; + import org.mc4j.ems.connection.EmsConnection; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; *************** *** 27,31 **** import java.text.Format; import java.text.MessageFormat; ! import java.util.Arrays; /** --- 28,33 ---- import java.text.Format; import java.text.MessageFormat; ! import java.util.Set; ! import java.util.WeakHashMap; /** *************** *** 35,47 **** public class ConnectionInfoAction extends CallableSystemAction { ! private static long serverHits; ! public static void addHit() { ! serverHits++; } - public static long getHits() { - return serverHits; - } public String getName() { return "Server calls"; --- 37,46 ---- public class ConnectionInfoAction extends CallableSystemAction { ! private static WeakHashMap<EmsConnection,String> map = new WeakHashMap<EmsConnection,String>(); ! public static void addStats(EmsConnection connection) { ! map.put(connection, null); } public String getName() { return "Server calls"; *************** *** 53,61 **** public static void resetStats() { - serverHits = 0; } public void performAction() { - serverHits = 0; } --- 52,58 ---- *************** *** 83,91 **** enableEvents(java.awt.AWTEvent.MOUSE_EVENT_MASK); // To get the size right: ! setText(f.format(new Object[] {new Double(999.0d), new Double(999.0d)})); setOpaque(false); setBorder(BorderFactory.createEmptyBorder(2,3,2,3)); ! setToolTipText("The number of server roundtrips made. Click to reset."); } --- 80,88 ---- enableEvents(java.awt.AWTEvent.MOUSE_EVENT_MASK); // To get the size right: ! setText(f.format(new Object[] {999.0d, 999.0d})); setOpaque(false); setBorder(BorderFactory.createEmptyBorder(2,3,2,3)); ! setToolTipText("The number of server roundtrips / The number of connection failures."); } *************** *** 112,116 **** private void update(boolean ticked) { ! setText(String.valueOf(getHits())); } --- 109,122 ---- private void update(boolean ticked) { ! long hits = 0; ! long failures = 0; ! ! Set<EmsConnection> connections = map.keySet(); ! for (EmsConnection connection : connections) { ! hits += connection.getRoundTrips(); ! failures += connection.getFailures(); ! } ! ! setText(String.valueOf(hits) + "/" + String.valueOf(failures)); } |