База ответов ИНТУИТ

Построение распределенных систем на Java

<<- Назад к вопросам

Для определения интерфейса удаленного объекта, в IDL используется ключевое слово:

(Отметьте один правильный вариант ответа.)

Варианты ответа
interface(Верный ответ)
object
module,
Похожие вопросы
В какой строке кода BillingServiceImpl происходит чтение из сети аргументов, передаваемых в метод processOperations:
1  // BillingServiceImpl.java2  // BillingServiceImpl реализует удаленный интерфейс BillingService для 3  // предоставления удаленного объекта BillingService4  package com.asw.rmi.ex2;5   6  // Набор базовых пакетов Java7  import java.rmi.*;8  import java.util.*;9  import java.rmi.server.*;10   11  public class BillingServiceImpl extends UnicastRemoteObject 12  implements BillingService {13   14  private  Hashtable hash;  // хэш-таблица для хранения карт15  // инициализация сервера16  public BillingServiceImpl() throws RemoteException{17  super();18  hash = new Hashtable();19  }20   21  // реализация метода addNewCard интерфейса BillingService22  public void addNewCard(Card card) throws RemoteException {23   24  hash.put(card.cardNumber, card);25  }26   27  // реализация метода processOperations интерфейса BillingService28  public void processOperations(CardOperation[] operations) 29  throws RemoteException {30  for (int i=0;i<operations.length;i++){31  Card c = (Card)hash.get(operations[i].card);32  if (c==null) throw new NotExistsCardOperation();33  c.balance+=operations[i].amount;34  hash.put(operations[i].card,c);35  }36  }37   38  // реализация метода getCard интерфейса BillingService39  public Card getCard(String card) throws RemoteException{40  Card c = (Card)hash.get(card);41  return c;42  };43   44  // запуск удаленного объекта BillingService45  public static void main (String[] args) throws Exception {46  System.out.println("Initializing BillingService...");47   48  // создание удаленного объекта49  BillingService service = new BillingServiceImpl();50   51  //задание имени удаленного объекта52  String serviceName = "rmi://localhost/BillingService";53  // регистрация удаленного объекта BillingService в реестре rmiregistry54  Naming.rebind(serviceName, service);55  }56   57  }
В строке 54, в классе BillingServiceImpl:
1  // BillingServiceImpl.java2  // BillingServiceImpl реализует удаленный интерфейс BillingService для 3  // предоставления удаленного объекта BillingService4  package com.asw.rmi.ex2;5   6  // Набор базовых пакетов Java7  import java.rmi.*;8  import java.util.*;9  import java.rmi.server.*;10   11  public class BillingServiceImpl extends UnicastRemoteObject 12  implements BillingService {13   14  private  Hashtable hash;  // хэш-таблица для хранения карт15  // инициализация сервера16  public BillingServiceImpl() throws RemoteException{17  super();18  hash = new Hashtable();19  }20   21  // реализация метода addNewCard интерфейса BillingService22  public void addNewCard(Card card) throws RemoteException {23   24  hash.put(card.cardNumber, card);25  }26   27  // реализация метода processOperations интерфейса BillingService28  public void processOperations(CardOperation[] operations) 29  throws RemoteException {30  for (int i=0;i<operations.length;i++){31  Card c = (Card)hash.get(operations[i].card);32  if (c==null) throw new NotExistsCardOperation();33  c.balance+=operations[i].amount;34  hash.put(operations[i].card,c);35  }36  }37   38  // реализация метода getCard интерфейса BillingService39  public Card getCard(String card) throws RemoteException{40  Card c = (Card)hash.get(card);41  return c;42  };43   44  // запуск удаленного объекта BillingService45  public static void main (String[] args) throws Exception {46  System.out.println("Initializing BillingService...");47   48  // создание удаленного объекта49  BillingService service = new BillingServiceImpl();50   51  //задание имени удаленного объекта52  String serviceName = "rmi://localhost/BillingService";53  // регистрация удаленного объекта BillingService в реестре rmiregistry54  Naming.rebind(serviceName, service);55  }56   57  }
Определение удаленного интерфейса RMIExample должно выглядеть следующим образом:
В классе BillingServiceImpl для удаленного вызова посредством Java RMI доступны следующие методы:
Сколько методов, доступных для удаленного вызова, содержит Web-сервис Billing:
В классе BillingServiceImpl для удаленного вызова доступны следующие методы:
При использовании DII, в случае, если сигнатура удаленного метода изменена, необходимо:
Module BillingServiceModule (в определении BillingService.idl) при использовании утилиты idlj породит следующую синтаксическую конструкцию Java:
С помощью каких утилит, входящих в состав Sun Application Server, осуществляется запуск BillingClient и BillingService:
При использовании Sun Java System Application Server и набора скриптов из пакета The Java Web Services Tutorial вызов утилиты wsgen должен быть осуществлен: