wonder_laptop -3 Junior Poster in Training

hello there, this is really urgent, do you know how to convert from a string to AgletProxy ??

i have two classes : Parent.java and Child.java,

The Parent.java class, creates a child , passes it its agletproxy while creating it and dispatches it to another machine :

package examples.help;
    import com.ibm.aglet.Aglet;
    import com.ibm.aglet.AgletContext;
    import com.ibm.aglet.AgletID;
    import com.ibm.aglet.AgletProxy;
    import java.net.URL;

    public class Parent extends Aglet {
    private AgletContext context;
    private AgletProxy parentProxy;
    private AgletID agletID;
    public void run() {
    try {
    context = getAgletContext();
    parentProxy = getProxy();
    String agletProxy = parentProxy.toString();

    System.out.println("The Parent Proxy is : " + parentProxy.toString());
    try {
    AgletProxy childProxy = context.createAglet(getCodeBase(), "examples.help.Child", agletProxy);
    childProxy.dispatch(new URL("atp://localhost:2000"));
    } catch (Exception e) {
    catch(Exception ex)


The Child.java class, uses Parent's agletproxy sent to it via the creation method , to sends back a message to the parent

package examples.help;
import com.ibm.aglet.Aglet;
import com.ibm.aglet.event.MobilityAdapter;
import com.ibm.aglet.event.MobilityEvent;

public class Child extends Aglet {

private String parentProxy;
public void onCreation(Object init) {

parentProxy = (String)init;
addMobilityListener( new MobilityAdapter(){

public void onArrival(MobilityEvent me) {
System.out.println("ParentProxy : " +parentProxy);

aHomeProxy = (AgletProxy) parentProxy;
aHomeProxy.sendOnewayMessage(new Message("I have arrived safely",remoteContext.getAgletProxy(id)));


but the probem is with the 2 green lines above, how can i convert the parent proxy back to an AgletProxy so the child can use it to send a message to the parent ? im getting an error "incompatible type" when im converting the string to AgletProxy => (aHomeProxy = (AgletProxy) parentProxy; )

please if you know the answer, plz reply ! thank you :))

jwenting commented: it's not urgent, kid -3
ztini commented: Urgency is subjective; this did not deserve down rate. +1