All Downloads are FREE. Search and download functionalities are using the official Maven repository.

IceInternal.ConnectionObserverI Maven / Gradle / Ivy

Go to download

Ice is a comprehensive RPC framework that helps you build distributed applications with minimal effort using familiar object-oriented idioms

There is a newer version: 3.7.10
Show newest version
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//

package IceInternal;

public class ConnectionObserverI
    extends IceMX.ObserverWithDelegate
    implements Ice.Instrumentation.ConnectionObserver
{
    @Override
    public void
    sentBytes(final int num)
    {
        _sentBytes = num;
        forEach(_sentBytesUpdate);
        if(_delegate != null)
        {
            _delegate.sentBytes(num);
        }
    }

    @Override
    public void
    receivedBytes(int num)
    {
        _receivedBytes = num;
        forEach(_receivedBytesUpdate);
        if(_delegate != null)
        {
            _delegate.receivedBytes(num);
        }
    }

    private MetricsUpdate _sentBytesUpdate = new MetricsUpdate()
        {
            @Override
            public void
            update(IceMX.ConnectionMetrics v)
            {
                v.sentBytes += _sentBytes;
            }
        };

    private MetricsUpdate _receivedBytesUpdate = new MetricsUpdate()
        {
            @Override
            public void
            update(IceMX.ConnectionMetrics v)
            {
                v.receivedBytes += _receivedBytes;
            }
        };

    private int _sentBytes;
    private int _receivedBytes;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy