diff options
author | Benoit Foucher <benoit@zeroc.com> | 2012-10-12 11:34:53 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2012-10-12 11:34:53 +0200 |
commit | 23c1e3b603a9d902593ffe9f99562fcda3af1589 (patch) | |
tree | 60ea7cdc0da5a9676ca12350ac82b069cc86eb5e /java/src/IceInternal/ConnectionObserverI.java | |
parent | .NET demo project updates (diff) | |
download | ice-23c1e3b603a9d902593ffe9f99562fcda3af1589.tar.bz2 ice-23c1e3b603a9d902593ffe9f99562fcda3af1589.tar.xz ice-23c1e3b603a9d902593ffe9f99562fcda3af1589.zip |
Added support for Glacier2 MX and fixed ICE-4880
Diffstat (limited to 'java/src/IceInternal/ConnectionObserverI.java')
-rw-r--r-- | java/src/IceInternal/ConnectionObserverI.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/java/src/IceInternal/ConnectionObserverI.java b/java/src/IceInternal/ConnectionObserverI.java new file mode 100644 index 00000000000..4cb0edad9aa --- /dev/null +++ b/java/src/IceInternal/ConnectionObserverI.java @@ -0,0 +1,49 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +package IceInternal; + +public class ConnectionObserverI extends IceMX.Observer<IceMX.ConnectionMetrics> + implements Ice.Instrumentation.ConnectionObserver +{ + public void + sentBytes(final int num) + { + _sentBytes = num; + forEach(_sentBytesUpdate); + } + + public void + receivedBytes(int num) + { + _receivedBytes = num; + forEach(_receivedBytesUpdate); + } + + private MetricsUpdate<IceMX.ConnectionMetrics> _sentBytesUpdate = new MetricsUpdate<IceMX.ConnectionMetrics>() + { + public void + update(IceMX.ConnectionMetrics v) + { + v.sentBytes += _sentBytes; + } + }; + + private MetricsUpdate<IceMX.ConnectionMetrics> _receivedBytesUpdate = new MetricsUpdate<IceMX.ConnectionMetrics>() + { + public void + update(IceMX.ConnectionMetrics v) + { + v.receivedBytes += _receivedBytes; + } + }; + + private int _sentBytes; + private int _receivedBytes; +}
\ No newline at end of file |