• Post Reply Bookmark Topic Watch Topic
  • New Topic

Fail to run a remote object as local object .  RSS feed

 
chris liao
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am learning RMI-IIOP, but I met a trouble. I want to let a rmote object run as a local object in server side, but failed.

Please help me. My source code is below,


Server.java

....................................................


Remote impl= new XXXXImple();

/**
* Export remote object
*/
PortableRemoteObject.exportObject(impl);

/**
* Get tie class for remote object
*/
Tie tie = Util.getTie(impl);
tie.setTarget(impl);
tie.orb(ServerORB.orb);
Util.registerTarget(tie,impl);

/**
* Bind Tie object;
*/
corbaCtx.bind("bind_RMI",tie.thisObject());

Stub stub = (javax.rmi.CORBA.Stub)corbaCtx.reslove("bind_RMI",)

/**
* Result is false. why not be true ?
* But my all source is in server side with a server orb
*/
System.out.println("is local : " + Util.isLocal(stub))


............................................................................


XXXImpl_Stub.java

.....................

if(!Util.isLocal(this)){



}else {

//Why not run here ??

}

................................
 
Debu Panda
author
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just curios why would you use a local object as a remote object?

RMI-IIOP will add complexities and is less performant than local invocation.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!