package poaLocal;
import util.Util;
import org.omg.CORBA.ORB;
import org.omg.PortableServer.POA;
import org.omg.PortableServer.Servant;
public class Server
{
public static void main(String[] args)
{
| try {
| |
| | // create the jBroker ORB
| | ORB orb = ORB.init(args, null);
| |
| | // create a servant
| | Servant hello = new HelloImpl();
| |
| | // get the root POA
| | POA rootPOA = (POA) orb.resolve_initial_references("RootPOA");
| |
| | // create a stringified object reference
| | String helloIOR = orb.object_to_string(
| | rootPOA.servant_to_reference(hello));
| |
| | // write the stringified object reference
| | Util.writeIOR(helloIOR, "ior", true);
| |
| | // activate the Root POA
| | rootPOA.the_POAManager().activate();
| |
| | // start the client thread
| | ClientThread client = new ClientThread(orb);
| | client.start();
| |
| } catch (Exception ex) {
| | ex.printStackTrace();
| }
}
}