
org.eclipse.scout.rt.client.ModelContextProxy Maven / Gradle / Ivy
/*
* Copyright (c) 2010, 2023 BSI Business Systems Integration AG
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.scout.rt.client;
import java.lang.reflect.Proxy;
import org.eclipse.scout.rt.client.context.ClientRunContext;
import org.eclipse.scout.rt.client.context.ClientRunContexts;
import org.eclipse.scout.rt.client.ui.desktop.IDesktop;
import org.eclipse.scout.rt.client.ui.desktop.outline.IOutline;
import org.eclipse.scout.rt.client.ui.form.IForm;
import org.eclipse.scout.rt.platform.ApplicationScoped;
import org.eclipse.scout.rt.platform.exception.DefaultExceptionTranslator;
import org.eclipse.scout.rt.platform.reflect.ReflectionUtility;
/**
* This class provides functionality to proxy an object to apply the given {@link ModelContext} to the calling
* {@link ClientRunContext} of the thread invoking a proxied method.
*
* @since 5.1
*/
@ApplicationScoped
public class ModelContextProxy {
/**
* Creates a Java Proxy for the given object with the given {@link ModelContext} applied when invoking the object's
* methods.
*
* @param object
* The object to be proxied.
* @param modelContext
* The {@link ModelContext} to be applied when invoking the object's methods.
* @return proxied object.
*/
@SuppressWarnings("unchecked")
public
© 2015 - 2025 Weber Informatics LLC | Privacy Policy