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,

You need to understand that when doing expressions the actual execution occurs later when you do invokeExpression. That is why you get ExpressionProxy's back. They are place-holders ("proxies") to the real IBeanProxy. Everything you do with an IExpression is simply pushing your requests on to a pipe that will be executed asynchronously from your requests. Not until invokeExpression does everything sync back up.

To use an ExpressionProxy in a call to something on the remote vm, see BeanAWTUtilities.invoke_addComponent as an example of how you push a method call onto an IExpression.

getBeanProxy() only returns fully instantiated bean proxies. Until the invokeExpression we only have the placeholder, the ExpressionProxy.

Rich


"Janak Mulani" <janak.mulani@xxxxxxxxx>
Sent by: ve-dev-bounces@xxxxxxxxxxx

10/21/2005 01:51 PM

Please respond to
Discussions people developing code for the Visual Editor project

To
"Discussions people developing code for the Visual Editor project" <ve-dev@xxxxxxxxxxx>
cc
Subject
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
 _______________________________________________
ve-dev mailing list
ve-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ve-dev


Back to the top