Published on

Published in: Technology
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. ICE Introduction
  2. 2. Introduction Ice is an object-oriented middleware platform. Fundamentally, this means that Ice provides tools, APIs, and library support for building object-oriented client– server applications. Ice applications are suitable for use in heterogeneous environments: client and server can be written in different programming languages, can run on different operating systems and machine architectures, and can communicate using a variety of networking technologies. The source code for these applications is portable regardless of the deployment environment.
  3. 3. Terminology • Clients and Servers • Ice Objects – An Ice object is an entity in the local or a remote address space that can respond to client requests. – If an object has multiple simultaneous instantiations, it is still a single Ice object. – Each Ice object has one or more interfaces. Clients issue requests by invoking operations. – Each Ice object has a unique object identity(ID/UUID).
  4. 4. Terminology • Proxies – 1. Locates the Ice object – 2. Activates the Ice object’s server if it is not running – 3. Activates the Ice object within the server – 4. Transmits any in-parameters to the Ice object – 5. Waits for the operation to complete – 6. Returns any out-parameters and the return value to the client (or throws an exception in case of an error)
  5. 5. Terminology • Proxy: Direct ,Indirect ,Fixed Proxies • Servants – In practice, a servant is simply an instance of a class that is written by the server developer and that is registered with the server-side run time as the servant for one or more Ice objects. • At-Most-Once Semantics – retries are attempted only if it is known that a previous attempt definitely failed. This semantics guarantee that operations that are not idempotent can be used safely
  6. 6. • Synchronous Method Invocation • Asynchronous Method Invocation • (Batched)Oneway Method Invocation – Thread-Per-Message – TCP/IP or SSL • (Batched)Datagram Invocations – A datagram invocation uses UDP to invoke the operation.
  7. 7. Language Mappings • provided language mappings: C++, Java, C#, Python, Objective-C • client side:PHP and Ruby.
  8. 8. Client and Server Structure
  9. 9. Ice Protocol • Ice provides an RPC protocol that can use either TCP/IP or UDP as transport. In addition, Ice also allows you to use SSL as a transport. – message types – protocol state machine – encoding rules that determine how each type of data is represented on the wire – header for each message type
  10. 10. Hello World module Demo { interface Printer { void printString(string s); }; }; slice2java
  11. 11. Basic Slice Types
  12. 12. User-Defined Types • Enumerations • Structures • Sequences • Dictionaries • Constant Definitions and Literals
  13. 13. Object Adapters
  14. 14. • AMI – At client • AMD – At Server(same as AMI)
  15. 15. User AMI and AMD ["ami"] interface I { bool isValid(); float computeRate(); }; interface J { ["amd"] void startProcess(); ["ami", "amd"] int endProcess(); };
  16. 16. ICE protocol • Data Encoding – Size(255 rule) • Encapsulation • Slice – Format like:[int,data] – data’s length is“slice.length-4” • Basic Types • Strings:UTF8
  17. 17. ICE protocol • Sequences:[size,{a,b,c…}] • Dictionaries:[size,{struct, struct, struct…}] • Enumerators – [1 – 127]byte. – [128 - 32767]short – [>32767]int – The value is the ordinal value of the orresponding enumerator, with the first enumerator value encoded as zero. • Structures
  18. 18. ICE protocol Exceptions exception Base { int baseInt; string baseString; }; exception Derived extends Base { bool derivedBool; string derivedString; double derivedDouble; };
  19. 19. ICE protocol
  20. 20. ICE Protocol • Data Encoding – Sizes – Encapsulations – Slice: • To allow the receiver of an exception or class to ignore those parts of a value that it does not understand, exception and class values are marshaled as a sequence of slices – Types
  21. 21. ICE Protocol • Protocol Messages Types – Request (from client to server) – Batch request (from client to server) – Reply (from server to client) – Validate connection (from server to client) – Close connection (client to server or server to client)
  22. 22. ICE Protocol Request Message Body struct RequestData { int requestId; Ice::Identity id; Ice::StringSeq facet; string operation; byte mode; Ice::Context context; Encapsulation params; };
  23. 23. ICE Protocol • Batch Request Message Body struct BatchRequestData { Ice::Identity id; Ice::StringSeq facet; string operation; byte mode; Ice::Context context; Encapsulation params; };
  24. 24. ICE Protocol • Reply Message Body struct ReplyData { int requestId; byte replyStatus; Encapsulation body; // messageSize - 19 bytes };
  25. 25. ICE Protocol • Validate Connection Message A server sends a validate connection message when it receives a new connection The message indicates that the server is ready to receive requests; the client must not send any messages on the connection until it has received the validate connection message from the server. • Close Connection Message
  26. 26. ICE Protocol • Compression – Compression may not be supported on all platforms or in all language mappings. – Compression can be used in a request or batch request only if the endpoint advertises the ability to accept compressed messages – For efficiency reasons, the Ice protocol engine does not compress messages smaller than 100 bytes.
  27. 27. IceGrid
  28. 28. IceGrid
  29. 29. IceGrid • load balancing types – Random – Adaptive – Round Robin – Ordered
  30. 30. IceGrid- Registry Replication
  31. 31. IceGrid- Registry Replication 1. The slave replica contacts the master replica at startup and synchronizes its databases. Any subsequent modifications to the deployed applications are made via the master replica, which distributes them to all active slaves. 2. The nodes contact the master replica at startup to notify it about their avail-ability. 3. The master replica provides a list of slave replicas to the nodes so that the nodes can also notify the slaves. 4. The client’s configuration determines which replica it contacts initially. 5. In the case of a failure, the client automatically fails over to the slave. If the master registry’s host has failed, then Node1 and any servers that were active on this host also become unavailable. The use of object adapter replication (see Section 38.9) allows the client to transparently reestablish communication with a server on Node2.
  32. 32. Facets and Versioning
  33. 33. THANKS