Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ve-dev] Getting Parent's Proxy Host

Hi Rich,
 
Thanks! Few more questions:
 
To instantiate BeanProxy for a component I call in ULCComponentProxyAdapter (extends BeanProxyAdapter)
 
protected final IProxy primInstantiateDroppedPart(IExpression _expression_) throws AllocationException {
  preInstantiateStuff(_expression_);
  IProxy newbean = primPrimInstantiateDroppedPart(_expression_);
  postInstantiateStuff(_expression_, newbean);
  return newbean;
 }
 
It returns an ExpressionProxy. In postInstantiateStuff, I want to add this bean to the ULCDialog (our free form) )in the VM:
 
For this, in VE 1.0, we were doing the following:
 
 public static void addVisualComponentToFreeForm(IBeanProxyDomain domain, IBeanProxy visualComponentProxy) {
        IMethodProxy methodProxy = getEnvironmentTypeProxy(domain).getMethodProxy("addToFreeForm",
                "com.ulcjava.base.application.ULCComponent");
        try {
            methodProxy.invoke(getEnvironmentTypeProxy(domain), visualComponentProxy);
        } catch (ThrowableProxy e) {
            JavaVEPlugin.log("Unable to add the visual component to the free form on target VM");
            JavaVEPlugin.log(e, Level.WARNING);
        }
    }
 
In the target VM we have a class Environment which has a method addToFreeForm which inturn adds the component to the ULCDailog.
 
Note we do not hold proxies to the FF dialog in IDE at all. We just hold a proxy to this Environment class which facades the dialog.
 
Now the questions:
 
1. primInstantiateDroppedPart is returning ExpressionProxy. Our method addVisualComponentToFreeForm takes IBeanProxy. How do I get this out of ExpressionProxy?
 
2. Is there a way I can find out if primInstantiateDroppedPart actually insatiated a class on target VM? I am not getting any exceptions, but getBeanProxy() is returning null? Although newBean is not null! What should one look at in a variable type ExpressionProxy to see that it is properly created?
 
3. In our targetVMHelper class to invoke methods on target VM, we use IBeanProxy, using which we get IMethodProxy and the invoke methods on this.
Does this need to change? If so how?
 
 
Thanks and regards,
 
Janak
 

Back to the top