Returns a client proxy object for the local component view.
486372
public EJBLocalObject getLocalObject()
    {
        if (localObject != null)
        {
            if (localWrapperProxyState != null &&
                localWrapperProxyState.ivWrapper == null)
            {
                localWrapperProxyState.connect(ivBeanId, localWrapper);
            }
            return localObject;
        }

        throw new IllegalStateException("Local interface not defined");
    }
430293
def pass_local_client(
    method=None,
    clean=None,
    up_to_date=None,
    commit=None,
    ignore_std_streams=True,
    lock=None,
):
    """"""
    if method is None:
        return functools.partial(
            pass_local_client,
            clean=clean,
            up_to_date=up_to_date,
            commit=commit,
            ignore_std_streams=ignore_std_streams,
            lock=lock,
        )

    def new_func(*args, **kwargs):
        ctx = click.get_current_context()
        client = ctx.ensure_object(LocalClient)
        stack = contextlib.ExitStack()

        # Handle --isolation option:
        if get_git_isolation():
            client = stack.enter_context(client.worktree())

        transaction = client.transaction(
            clean=clean,
            up_to_date=up_to_date,
            commit=commit,
            ignore_std_streams=ignore_std_streams
        )
        stack.enter_context(transaction)

        if lock or (lock is None and commit):
            stack.enter_context(client.lock)

        with stack:
            result = ctx.invoke(method, client, *args, **kwargs)
        return result

    return functools.update_wrapper(new_func, method)
688256
private <T> T getProxyObject(
      T originalObject, AdWordsSession session, Class<T> cls, boolean isUtility) {
    // Find the retry strategy of this class type.
    ApiRetryStrategy retryStrategy =
        ApiRetryStrategyManager.getRetryStrategy(cls.getSimpleName(), isUtility);

    // If no corresponding retry strategy, just use the original object instead of a wrapping proxy.
    if (retryStrategy == null) {
      return originalObject;
    }

    InvocationHandler invocationHandler =
        new ApiInvocationHandlerWithRateLimiter(originalObject, session, retryStrategy);
    return Reflection.newProxy(cls, invocationHandler);
  }
242200
private Management getProxyChain(Management m)
            throws ModuleInitializationException {
        try {
            invocationHandlers = getInvocationHandlers();
            return (Management) ProxyFactory.getProxy(m, invocationHandlers);
        } catch (Exception e) {
            throw new ModuleInitializationException(e.getMessage(), getRole());
        }
    }
966729
@Override
    public Class<?> getProxyClass() {
        if (proxyClass != null) {
            return proxyClass;
        }
        try {
            if (StringUtils.isNotBlank(interfaceId)) {
                this.proxyClass = ClassUtils.forName(interfaceId);
                if (!proxyClass.isInterface()) {
                    throw ExceptionUtils.buildRuntime("service.interfaceId",
                        interfaceId, "interfaceId must set interface class, not implement class");
                }
            } else {
                throw ExceptionUtils.buildRuntime("service.interfaceId",
                    "null", "interfaceId must be not null");
            }
        } catch (SofaRpcRuntimeException e) {
            throw e;
        } catch (Throwable e) {
            throw new SofaRpcRuntimeException(e.getMessage(), e);
        }
        return proxyClass;
    }
543199
function(client, sinfo) {
  let proxy = client.proxies;
  return !!proxy.sys && !! proxy.sys[sinfo.serverType];
}
750455
public static Invoker getInvoker(Object proxyObject, String proxyType) {
        try {
            ExtensionClass<Proxy> ext = ExtensionLoaderFactory.getExtensionLoader(Proxy.class)
                .getExtensionClass(proxyType);
            if (ext == null) {
                throw ExceptionUtils.buildRuntime("consumer.proxy", proxyType,
                    "Unsupported proxy of client!");
            }
            Proxy proxy = ext.getExtInstance();
            return proxy.getInvoker(proxyObject);
        } catch (SofaRpcRuntimeException e) {
            throw e;
        } catch (Throwable e) {
            throw new SofaRpcRuntimeException(e.getMessage(), e);
        }
    }
1181582
public static <T extends VersionedProtocol> T getProxy(
      Class<T> protocol,
      long clientVersion, InetSocketAddress addr,
      Configuration conf, SocketFactory factory) throws IOException {
    return getProtocolProxy(protocol, clientVersion,
        addr, conf, factory).getProxy();
  }
829876
private Proxy getMavenProxy() {
        if (mavenSettings != null) {
            final List<Proxy> proxies = mavenSettings.getProxies();
            if (proxies != null && !proxies.isEmpty()) {
                if (mavenSettingsProxyId != null) {
                    for (Proxy proxy : proxies) {
                        if (mavenSettingsProxyId.equalsIgnoreCase(proxy.getId())) {
                            return proxy;
                        }
                    }
                } else {
                    for (Proxy aProxy : proxies) {
                        if (aProxy.isActive()) {
                            return aProxy;
                        }
                    }
                }
            }
        }
        return null;
    }
647538
@SuppressWarnings("unchecked")
    public static <T> ThreadLocalProxy<T> createThreadLocalProxy(Class<T> type) {
        ThreadLocalProxy<?> proxy = null;
        if (UriInfo.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalUriInfo();
        } else if (HttpHeaders.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalHttpHeaders();
        } else if (ProtocolHeaders.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalProtocolHeaders();
        } else if (SecurityContext.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalSecurityContext();
        } else if (ContextResolver.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalContextResolver<>();
        } else if (Request.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalRequest();
        } else if (Providers.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalProviders();
        } else if (MessageContext.class.isAssignableFrom(type)) {
            proxy = new ThreadLocalMessageContext();
// Liberty Change for CXF Begin
        } else if (type.getName().equals(MessageContext.class.getName())) {
            MessageContextProxyClassLoader loader = new MessageContextProxyClassLoader(getClassLoader(Proxy.class), getClassLoader(type), getClassLoader(ThreadLocalProxy.class));
            proxy = (ThreadLocalProxy<T>) Proxy.newProxyInstance(loader,
                                                                 new Class[] { type, ThreadLocalProxy.class },
                                                                 new ProxyInvocationHandler(new ThreadLocalMessageContext()));
// Liberty Change for CXF Begin
        }

        if (proxy == null && isServletApiContext(type.getName())) {
            proxy = createThreadLocalServletApiContext(type.getName());
        }
        if (proxy == null) {
            ClassLoader loader
                = proxyClassLoaderCache.getProxyClassLoader(Proxy.class.getClassLoader(), 
                                                            new Class<?>[]{Proxy.class, ThreadLocalProxy.class, type}); 
            if (!canSeeAllClasses(loader, new Class<?>[]{Proxy.class, ThreadLocalProxy.class, type})) {
                // Liberty change start - (LOG to Tr)
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "find a loader from ProxyClassLoader cache," 
                        + " but can't see all interfaces");
                
                    Tr.debug(tc, "create a new one with parent  " + Proxy.class.getClassLoader());
                }
                //Liberty change end
                proxyClassLoaderCache.removeStaleProxyClassLoader(type);
                proxyClassLoaderCache.getProxyClassLoader(Proxy.class.getClassLoader(), 
                                                          new Class<?>[]{Proxy.class, ThreadLocalProxy.class, type}); 
            }
            return (ThreadLocalProxy<T>)Proxy.newProxyInstance(loader,
                                                     new Class[] {type, ThreadLocalProxy.class },
                                                     new ThreadLocalInvocationHandler<T>());
        }

        return (ThreadLocalProxy<T>) proxy;
    }
209385
public static <T> T getTargetObject(Object proxy, Class<T> clazz) throws Exception {
        while( (AopUtils.isJdkDynamicProxy(proxy))) {
            return clazz.cast(getTargetObject(((Advised)proxy).getTargetSource().getTarget(), clazz));
        }

        return clazz.cast(proxy);
    }
992854
def proxy_it(request, port):
    """"""

    # Check if we have websocket proxy configured
    websocket_proxy = request.registry.settings.get("pyramid_notebook.websocket_proxy", "")
    if websocket_proxy.strip():
        r = DottedNameResolver()
        websocket_proxy = r.maybe_resolve(websocket_proxy)

    if "upgrade" in request.headers.get("connection", "").lower():
        if websocket_proxy:
            return websocket_proxy(request, port)
        else:
            # If we run on localhost on pserve, we should never hit here as requests go directly to IPython Notebook kernel, not us
            raise RuntimeError("Websocket proxy support is not configured.")

    proxy_app = WSGIProxyApplication(port)

    return request.get_response(proxy_app)
389274
public static <T extends VersionedProtocol> ProtocolProxy<T> getProtocolProxy(
      Class<T> protocol,
      long clientVersion, InetSocketAddress addr, Configuration conf,
      SocketFactory factory) throws IOException {
    UserGroupInformation ugi = null;
    try {
      ugi = UserGroupInformation.login(conf);
    } catch (LoginException le) {
      throw new RuntimeException("Couldn't login!");
    }
    return getProtocolProxy(protocol, clientVersion, addr, ugi, conf, factory);
  }
364693
def getElement(self, namespaceURI, localName):
        '''
        
        '''
        node = self._dom.getElement(self.node, localName, namespaceURI, default=None)
        if node:
            return ElementProxy(self.sw, node)
        return None
636294
public InvocationHandler getInvocationHandler(Object proxy) {
        Field field = getInvocationHandlerField();
        try {
            return (InvocationHandler) field.get(proxy);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException("Object is not a proxy of correct type", e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
596232
@SneakyThrows
    protected View getResultingView(final IndirectClient<Credentials, CommonProfile> client, final J2EContext webContext, final Ticket ticket) {
        val action = client.getRedirectAction(webContext);
        if (RedirectAction.RedirectType.SUCCESS.equals(action.getType())) {
            return new DynamicHtmlView(action.getContent());
        }
        val builder = new URIBuilder(action.getLocation());
        val url = builder.toString();
        LOGGER.debug("Redirecting client [{}] to [{}] based on identifier [{}]", client.getName(), url, ticket.getId());
        return new RedirectView(url);
    }
587345
def get_object(conn, binding_name, object_cls):
        
        try:
            obj = conn.rootContext.resolve(binding_name)
            narrowed = obj._narrow(object_cls)
        except CORBA.TRANSIENT:
            raise IOError('Attempt to retrieve object failed')

        if narrowed is None:
            raise IOError('Attempt to retrieve object got a different class of object')

        return narrowed