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

IceInternal.ObserverHelper 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;

import Ice.Instrumentation.CommunicatorObserver;
import Ice.Instrumentation.InvocationObserver;

public final class ObserverHelper
{
    static public InvocationObserver
    get(Instance instance, String op)
    {
        CommunicatorObserver obsv = instance.initializationData().observer;
        if(obsv != null)
        {
            InvocationObserver observer = obsv.getInvocationObserver(null, op, _emptyContext);
            if(observer != null)
            {
                observer.attach();
            }
            return observer;
        }
        return null;
    }

    static public InvocationObserver
    get(Ice.ObjectPrx proxy, String op)
    {
        return get(proxy, op, null);
    }

    static public InvocationObserver
    get(Ice.ObjectPrx proxy, String op, java.util.Map context)
    {
        CommunicatorObserver obsv =
            ((Ice.ObjectPrxHelperBase)proxy)._getReference().getInstance().initializationData().observer;
        if(obsv != null)
        {
            InvocationObserver observer;
            if(context == null)
            {
                observer = obsv.getInvocationObserver(proxy, op, _emptyContext);
            }
            else
            {
                observer = obsv.getInvocationObserver(proxy, op, context);
            }
            if(observer != null)
            {
                observer.attach();
            }
            return observer;
        }
        return null;
    }

    private static final java.util.Map _emptyContext = new java.util.HashMap();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy