Lecture 14 The command invocation protocol Generic Protocol
























- Slides: 24

Lecture 14 The command invocation protocol

Generic Protocol • We will learn about a generic protocol. • Will allow clients to execute remote commands on the server. • In previous lectures we have seen:

The protocol • A command is sent by a client but executed by the server (on the server process). • A class that “packages” a function and arguments. • The server may pass a single argument to the command. • This argument can hold different services that the command can interract with.

Remote. Command. Invocation. Protocol

Java Serialization • Object serialization: an object can be represented as a sequence of bytes. • This sequence includes the object's data and type, and the types of data stored in the object. • A serialized object (i. e. , a byte[]) can be deserialized back into a copy of the original object. • The byte[] that represent the object and its data can be used to recreate the object in memory. • The process is JVM independent.

Java Serialization • Classes Object. Input. Stream and Object. Output. Stream can serialize and deserialize any Serializable object. • A class is Serializable if it: • Implements the Serializable interface or it super class is Serializable. • Its first non-serializable super class has a no-args constructor. • All its non-transient fields must be serializable. • Serializable has no methods or fields. • In principle – any data can be serialized.

Message Encoder Decoder (previous lecture)

Message Encoder Decoder for arbitrary objects • Previously we saw an implementation for String. • The Object. Encoder. Decoder is a binary encoder decoder. • An Object will be serialized into Byte array: N, b 1, b 2, b 3, . . . , bn • N - the message will start with the number of bytes. • Sent in binary representation (methods int. To. Byte(), byte. To. Int()).





A generic client for our generic protocol


Example: News. Feed. Server • This server will allow clients to execute two commands: • Publish news to a (TV) channel by its name • Fetch all the news which were published to a specific (TV) channel • The main object that is manipulated by the server is the News. Feed:

The client commands receive the News. Feed and manipulate it


News. Feed implementation • Since the news feed can be manipulated concurrently by different handlers in the server it must be thread safe.


The server main (thread-per-client…)

The client main



• The client code will print: second client received: [System Programmer, knowledge in C++, Java and Python required. call 0 x 134693 F] third client received: [new SPL assignment is out soon!!, THE CAKE IS A LIE!]
Lecture 14 The command invocation protocol Generic Protocol
Remote Object Invocation Distributed objects Remote method invocation
Command Prompt nslookup Command Prompt nslookup Command Prompt
Recipient Command Exp Command Address Command HASH function
Command Displayable Canvas Screen Command Listener Command BACK
Logic Model Generic Social Developmental Evaluation Styles Generic
Talking About Student Art Generic Game Generic Game
Generic Medications by Sue Henderson Definition Generic medications
Generic Drug For Allopurinol Schedule allopurinol generic 300
Generic constants Generate statements Generic constant declaration entity
Proscar Generic Price Bulk finasteride generic for proscar
Regulation of Generic Drugs Office of Generic Drugs
Buy Generic Proscar Uk Kvartiri generic finasteride 5
PENGENALAN GENERIC TOPIK Mengapa harus Generic Mendeklarasikan Class
Order Generic Proscar Reviews order generic proscar reviews
Generic Classes Use Cases Inheritance Generic Classes The
Much Does Generic Proscar Cost Qld generic proscar
Generic Programming Karl Lieberherr 322021 Generic Programming 1
Documentary On Generic Drugs generic drugs health canada
Generic Finasteride Results Aqa generic proscar from canada
Generic Proscar For Sale Dfw generic finasteride for
Command Control Special Needs Inmates Instructors Aid Command
MODULE 2 UNIT 5 Incident Command Unified Command
Incident Command Triage Objectives Describe Incident Command System