Главная /
Построение распределенных систем на Java /
Какие из следующих утверждений являются верными:
Какие из следующих утверждений являются верными:
вопросПравильный ответ:
механизм сериализации использует снимки памяти, поэтому не может быть использован для переноса объектов между узлами разной аппаратной архитектуры
механизм сериализации позволяет сохранить состояние метода объекта в процессе его работы таким образом, что после восстановления, метод продолжит свою работу с того момента, на котором он был остановлен
механизм сериализации сохраняет лишь значение полей объекта, но не сохраняет состояния его методов в процессе их выполнения
Сложность вопроса
92
Сложность курса: Построение распределенных систем на Java
91
Оценить вопрос
Комментарии:
Аноним
Это очень не сложный решебник по интуиту.
24 сен 2020
Аноним
Спасибо за сайт
05 июл 2019
Другие ответы на вопросы из темы интернет-технологии интуит.
- # В какой строчке кода осуществляется чтение сообщения клиента: 1 package com.asw.jms.ex1; 2 3 import javax.jms.*; 4 import javax.annotation.Resource; 5 import java.io.InputStreamReader; 6 import java.io.IOException; 7 import java.util.Hashtable; 8 import java.util.Enumeration; 9 10 public class BillingService { 11 @Resource(mappedName = "jms/ConnectionFactory") 12 private static ConnectionFactory connectionFactory; 13 @Resource(mappedName = "jms/Queue") 14 private static Queue queue; 15 16 Hashtable hash = new Hashtable(); 17 public void addNewCard(Card c) { 18 hash.put(c.cardNumber, c); 19 }; 20 21 public void performCardOperation(CardOperation co){ 22 Card c = (Card)hash.get(co.card); 23 if (c==null) return; 24 c.balance+=co.amount; 25 hash.put(co.card,c); 26 }; 27 28 public void printCards(){ 29 for(Enumeration e = hash.elements();e.hasMoreElements();) 30 System.out.println(e.nextElement()); 31 } 32 33 public static void main(String[] args) { 34 String destType = null; 35 Connection connection = null; 36 Session session = null; 37 Destination dest = (Destination) queue; 38 MessageConsumer consumer = null; 39 ObjectListener listener = null; 40 TextMessage message = null; 41 InputStreamReader inputStreamReader = null; 42 char answer = '\0'; 43 try { 44 connection = connectionFactory.createConnection(); 45 session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); 46 consumer = session.createConsumer(dest); 47 listener = new ObjectListener(new BillingService()); 48 consumer.setMessageListener(listener); 49 connection.start(); 50 System.out.println( 51 "To end program, type Q or q, " + "then <return>"); 52 inputStreamReader = new InputStreamReader(System.in); 53 while (!((answer == 'q') || (answer == 'Q'))) { 54 try { 55 answer = (char) inputStreamReader.read(); 56 } catch (IOException e) { 57 System.err.println("I/O exception: " + e.toString()); 58 } 59 } 60 } catch (JMSException e) { 61 System.err.println("Exception occurred: " + e.toString()); 62 } finally { 63 if (connection != null) { 64 try { 65 connection.close(); 66 } catch (JMSException e) { 67 } 68 } 69 } 70 } 71 }
- # Протокол обмена данными между клиентом и сервером, предложенный в первой части лекции обладает следующими недостатками:
- # Файл, с IDL-описанием может содержать:
- # В строке 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 }
- # Описание Card addNewCard(in string personName, in string card) в определении BillingService.idl означает, что объектная ссылка Card, возвращаемая методом, "указывает" на: