| |
September 2002 Hartnäckiger ZustandcService, v2.0: Einleitung B-7 B // verursachen Sie politische Linien CORBA.Policy policies[5 ]; policies[0 ] = rootPOA.create_lifespan_policy( PortableServer.LifespanPolicyValue.PERSISTENT ); policies[1 ] = rootPOA.create_request_processing_policy( PortableServer.RequestProcessingPolicyValue. USE_DEFAULT_SERVANT ); policies[2 ] = rootPOA.create_id_uniqueness_policy( PortableServer.IdUniquenessPolicyValue.MULTIPLE_ID ); policies[3 ] = rootPOA.create_id_assignment_policy( PortableServer.IdAssignmentPolicyValue.USER_ID ); policies[4 ] = rootPOA.create_servant_retention_policy( PortableServer.ServantRetentionPolicyValue. NON_RETAIN ); // verursachen Sie POA für das Namengeben von Kontexten PortableServer.POAManager-poaMgr = rootPOA.the_POAManager(); PortableServer.POA-poa = rootPOA.create_POA( "nennend", Null, politische Linien ); // das erste mal, verursachen eine Wurzel, die Kontext nennt // und Drucke sein IOR wenn (firstTime) { byte[] root_id = home.create().short_pid(); CORBA.Object-root_naming_context = poa.create_reference_with_id( root_id, "IDL:omg.org/CosNaming/NamingContext:1.0" ); System.out.println( myOrb.object_to_string(root_naming_context) ); } // stellen Sie her und stellen Sie Bediensteten ein Servant(home, poa NamingContextImpl); poa.set_servant(servant); // Anfangsbediener poaMgr.activate(); myOrb.run(); mySession.close(); } |  |
|
| |
|
|