Главная / Построение распределенных систем на Java / В строке 41, в классе BillingServiceServer: 1 // BillingServiceServer.java 2 package com.asw.corba.ex1; 3 4 // пакеты OMG CORBA 5 import org.omg.CosNaming.*; 6 import org.omg.CORBA.*; 7 import org.omg.PortableServer.*; 8 import org.omg.PortableServer.POA;

В строке 41, в классе BillingServiceServer: 1 // BillingServiceServer.java 2 package com.asw.corba.ex1; 3 4 // пакеты OMG CORBA 5 import org.omg.CosNaming.*; 6 import org.omg.CORBA.*; 7 import org.omg.PortableServer.*; 8 import org.omg.PortableServer.POA; 9 import com.asw.corba.ex1.BillingServiceModule.*; 10 11 public class BillingServiceServer { 12 public static void main(String args[]) { 13 try{ 14 // create and initialize the ORB 15 ORB orb = ORB.init(args, null); 16 17 // get reference to rootpoa & activate the POAManager 18 POA rootpoa = 19 POAHelper.narrow(orb.resolve_initial_references("RootPOA")); 20 rootpoa.the_POAManager().activate(); 21 22 // create servant and register it with the ORB 23 BillingServiceImpl BSImpl = new BillingServiceImpl(); 24 BSImpl.setORB(orb); 25 26 // get object reference from the servant 27 org.omg.CORBA.Object ref = rootpoa.servant_to_reference(BSImpl); 28 BillingService href = BillingServiceHelper.narrow(ref); 29 30 // get the root naming context 31 // NameService invokes the name service 32 org.omg.CORBA.Object objRef = 33 orb.resolve_initial_references("NameService"); 34 // Use NamingContextExt which is part of the Interoperable 35 // Naming Service (INS) specification. 36 NamingContextExt ncRef = NamingContextExtHelper.narrow(objRef); 37 38 // bind the Object Reference in Naming 39 String name = "BillingService"; 40 NameComponent path[] = ncRef.to_name( name ); 41 ncRef.rebind(path, href); 42 43 System.out.println("BillingServiceServer ready and waiting ..."); 44 45 // wait for invocations from clients 46 orb.run(); 47 } 48 49 catch (Exception e) { 50 System.err.println("ERROR: " + e); 51 e.printStackTrace(System.out); 52 } 53 System.out.println("BillingServer Exiting ..."); 54 } 55 }

вопрос

Правильный ответ:

производится связывание имени сервиса с экземпляром объекта, реализующим сервис
создается экземпляр объекта, который может принимать удаленные вызовы
производится останов сервиса
Сложность вопроса
67
Сложность курса: Построение распределенных систем на Java
91
Оценить вопрос
Очень сложно
Сложно
Средне
Легко
Очень легко
Комментарии:
Аноним
Зачёт всё. Бегу кутить отмечать 4 за тест интуит
14 июн 2018
Аноним
Экзамен сдан на пять с минусом. Спасибо сайту
14 сен 2016
Оставить комментарий
Другие ответы на вопросы из темы интернет-технологии интуит.