Note that there are some explanatory texts on larger screens.

plurals
  1. POCORBA unclear stuff
    primarykey
    data
    text
    <p>I've recently began on working on my first CORBA project. I think I got the basic stuff , however there are some things that still elude me. One of these things is how CORBA handles several calls on the same object .</p> <p>Suppose I have a client that registers itself with the server , and then can receive work. The server sends work at random times. </p> <ul> <li><p>Are all these calls handled on the same thread ? This would mean that while the client is working , it cannot receive anything. In this case how could I give him a multithread behavior. </p> <ul> <li>Or on the other hand is a thread spawned for every call received ?. In this case do I need to protect the common data that can be accessed on each call ? What would be a good practice to do so</li> </ul></li> </ul> <p>Other thing I'd like to do is to create several workers and have them receive work ,but in my implementation only one worker is active . </p> <p>Below :</p> <pre><code>public static void main(String[] args) { try { connectWithServer(args); createWorkers(); // wait for invocations from clients orb.run(); } catch (Exception e) { System.out.println("ERROR : " + e) ; e.printStackTrace(System.out); } } static public void connectWithServer(String[] args)throws Exception { orb = ORB.init(args, null); // get reference to rootpoa &amp; activate the POAManager rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA")); rootpoa.the_POAManager().activate(); // get the root naming context org.omg.CORBA.Object objRef = orb.resolve_initial_references("NameService"); // Use NamingContextExt instead of NamingContext. This is // part of the Interoperable naming Service. NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef); // resolve the Object Reference in Naming taskBagImpl = TaskBagHelper.narrow(ncRef.resolve_str(SERVER_NAME)); System.out.println(TAG + " Obtained a handle on server object: " + taskBagImpl); } public static void createWorkers() throws Exception { for(int i = 0; i &lt; nrOfWorkers; i++) { WorkerImpl w = new WorkerImpl(); rootpoa.activate_object((Servant) w); Worker ref = WorkerHelper.narrow(rootpoa.servant_to_reference(w)); w.setRef(ref); taskBagImpl.registerWorker(w.getId(), ref); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload