10. Distributed Object

advertisement
10. Distributed Object-Based Systems I
CSE5306 Lecture
Quiz 36 due 5PM
Saturday, 28 November 2015
[Team 1 : Chanakya, Mounika]
Introduction
• An object plays an important part in attaining distribution
transparency.
• Clients are offered services in the form of objects invoked.
• It is easy to hide distribution aspects behind an object’s interface.
[Team 1 : Chanakya, Mounika]
ARCHITECTURE
• Object orientation forms an important aspect in software
development and is popular since its inception.
• The natural ability to build software into well-defined and more or
less independent components is the reason for its popularity.
• Object orientation began to be used for developing distributed
systems in the 1980’s
• The notion of an independent object hosted by a remote server while
attaining a high degree of distribution transparency formed a solid
basis for developing a new generation of distributed systems.
[Team 1 : Chanakya, Mounika]
RUOK?
1. An object plays an important part in attaining distribution
transparency, because…
a. Clients are offered services in the form of objects invoked.
b. It is easy to hide distribution aspects behind an object’s interface.
c. All the above
d. None of the above
[Team 1 : Chanakya, Mounika]
Naming
• It evolves around the way references to object are supported.
• In JAVA the object references effectively correspond to portable proxy
implementation.
• However, this a language-dependent way of being able to refer to
remote objects. Again taking CORBA as an example, let us see
• SEC. 10.4 NAMING 467 describes how basic naming can also be
provided in a language and platform-independent way.
[Team 1 : Chanakya, Mounika]
RUOK
2.Which of the following effectively describes naming?
a. It evolves around the way references to object are supported.
b. In JAVA the object references effectively correspond to portable
proxy implementation.
c. All the above
d. None of the above
[Team 1 : Chanakya, Mounika]
10.1.1 Distributed Objects
• Data encapsulated by objects known as States and Operations on
those data is called methods which are offered through interface.
• Object interfaces are used by processes to access or manipulate the
state of object by invoking methods available to it.
• Strict separation between interfaces and objects implementing
interfaces is important for distributed systems i.e. having interface on
one machine and object on another machine. This organization is
called distributed objects.
[Team 02 Nikhil Joshi Shravan Kokkula]
10.1.1 Distributed Objects contd..
• As shown in fig, client
binds to a distributed
Object.
• Proxy is the implementation of
object`s interface on client side
which is then loaded into client's address space.(analogous
to client stub in
RPC)
• It marshals method invocations into messages and unmarshals reply messages to
return result of method invocation.
• Objects reside on server machine which has same interface as client machines
wherein Incoming invocation requests are sent to server stub, that unmarshals it
to offer method invocation at the object's interface at server side and forwards
reply messages to the client side proxy.
[Team 02 Nikhil Joshi Shravan Kokkula]
10.1.1 Distributed Objects contd..
• The server-side stub is often called as skeleton as it facilitates bare
means for letting the server middleware access the user-defined
objects.
• Distributed objects doesn’t have state distributed as it is present on
one machine.
• Interfaces implemented by objects are made available on other
machines known as remote objects.
• Therefore distributed objects, have the state itself which may be
physically distributed across multiple machines, but this distribution is
hidden from clients behind the object's interfaces.
Team 02 Nikhil Joshi Shravan Kokkula
RUOK?
• 3)Skeleton that facilitates bare means for its middleware access the
user-defined objects?
A. Server side stub.
B. Client side stub.
C. Server side stub and client side stub.
D. None of the above.
[Team 02 Nikhil Joshi Shravan Kokkula]
RUOK?
• 4)What is true about distributed objects?
A. Distributed objects doesn’t have state distributed.
B. State is object encapsulating data.
C. Implementation of the object’s interface is called proxy.
D. All of the above.
E. None of the above.
[Team 02 Nikhil Joshi Shravan Kokkula]
Objects
• Objects appear in many forms in distributed systems,such as in object
oriented languages .
• Compile time objects differ from run time objects.
• An object can be defined as an instance of class.
• A class is nothing but a blueprint or a template for creating different
objects which defines its properties and behaviors
Team03-Sashanka Teja lakkakula ,Savankumar Akbari
RUOK?
5)Which of the following exhibit behavior related to its class?
A.
B.
C.
D.
Method
Interface
Object
All of the above
Team03-Sashanka Teja lakkakula ,Savankumar Akbari
Compile time Objects
• Compile time objects makes easier to build application in distributed
system
• In Java, compiler compiles the class definition , which allows to create
object of class
• Interface adds functionality to class, allowing them to compile into client or
server side stub
• By this way distributed system can call remote machine
Team03-Sashanka Teja lakkakula ,Savankumar Akbari
Compile time Objects
• Compile time object depends on efficiency of programming language
for the compilation.
• Above limitation can restrict the working & functionality of
distributed system.
• Inorder to mitigate above drawback, Distributed objects can be
created at runtime instead of Compile time
Team03-Sashanka Teja lakkakula ,Savankumar Akbari
Runtime Objects
• This objects are created during the execution of the program.
• Used in many distributed operating application since it removes
language dependency.
• Such objects can be written in multiple language like java,c++,etc.
• Object adapter can be used to invoke method on remote maachine
Team03-Sashanka Teja lakkakula ,Savankumar Akbari
RUOK?
6) What is the major drawback of compile time object?
A. They are dependent on programming language used
B. They utilize more resources
C. They are comparatively slow
D. All of the above
E. None of the above
Team03-Sashanka Teja lakkakula ,Savankumar Akbari
RUOK?
7) Why run time objects are mostly used in distributed system
application ?
A. It is independent of language being used for execution
B. They are mainly machine independent
C. They can call remote machine to run instance from local machine
D. All of the above
Team03-Sashanka Teja lakkakula ,Savankumar Akbari
Object Adapter
• Used for executing program on remote machine
• Allows defining run time object in terms of interface they implement
• This interface is used to make remote call and takes care of all the
remote access request
Team03-Sashanka Teja lakkakula ,Savankumar Akbari
RUOK?
8) What is the main purpose of Object Adapter?
A. Adapter bind the object to its class
B. It allows remote execution of distributed system
C. Provides interface to local object
D. All of the above
E. None of the above
Team03-Sashanka Teja lakkakula ,Savankumar Akbari
Persistent Objects
• The objects that continue to exist even if they are currently not
contained in the address space of any server process.
• It is not dependent on its current server.
Team : 04 AISHWARYA RAJAGOPALAN
AISHWARYA RAJAN
R U OK?
9)A persistent object is
a) The objects that continue to exist even if they are currently not
contained in the address space of any server process.
b) Not dependent on its current server.
c) All of the above
d) None of the above
Team : 04 AISHWARYA RAJAGOPALAN
AISHWARYA RAJAN
Persistent Objects contd….
• The server that is currently managing the persistent object , can store
the objects state on secondary storage and then exit.
• A newly started server can read the objects state from storage into its
own address space and handle invocation requests.
Team : 04 AISHWARYA RAJAGOPALAN
AISHWARYA RAJAN
R U OK?
10)The functions of the server that is managing a persistent object are:
a) Can store the objects state on secondary storage and then exit.
b) A newly started server can read the objects state from storage into
its own address space and handle invocation requests.
c) All of the above
d) None of the above
Team : 04 AISHWARYA RAJAGOPALAN
AISHWARYA RAJAN
Transient Objects
• Transient object is an object that exists only as long as the server
hosting it exists.
• Once the server is out, the object also ceases to exist.
• For example, the message is discarded if it cannot be delivered to the
receiver immediately. A message will be delivered only if the receiver
is active.
Team : 04 AISHWARYA RAJAGOPALAN
AISHWARYA RAJAN
R U OK?
11) Difference between Transient and Persistent objects is that:
a)Transient objects live by the virtue of the server ,i.e. if the server
exists so will the object while persistent objects live independently
from a server, i.e. is the server exits, the object code and state remains
on disk.
b)An example of transient object is HTTP request while an example of
persistent object is an email.
c) Both a & b
d) None of them
Team : 04 AISHWARYA RAJAGOPALAN
AISHWARYA RAJAN
Enterprise Java Beans
• An EJB is a Java object hosted by a special server.
• Offers different ways for remote clients to invoke that
object.
• EJB technology supports application development
based on a multiplier, distributed object architecture
in which most of application’s logic is moved from the
client to the server.
[Team 05 - Abhinav Joshi, Sandeep Raveendran Thandassery]
R U O K?
12) Which of the following is true of an Enterprise Java Beans (EJB)?
a) EJB is a Java object hosted by a special server.
b) Offers different ways for remote clients to invoke Java object.
c) EJB technology supports application development based on a
multiplier, distributed object architecture.
d) All of the above.
e) None of the above.
[Team 05 - Abhinav Joshi, Sandeep Raveendran Thandassery]
EJB Server
• Provides support to separate application functionality from systemsoriented functionality.
• Contains:
• Container – holds EJBs, and provides interfaces to underlying services.
• Services – JMS, JNDI, JDBC, RMI
[Team 05 - Abhinav Joshi, Sandeep Raveendran Thandassery]
R U O K?
13) Which of the following components an EJB server contains?
a)
b)
c)
d)
Container – to hold EJBs
Services - JMS, JNDI, JDBC, RMI
Both a and b.
None of the above.
[Team 05 - Abhinav Joshi, Sandeep Raveendran Thandassery]
Types of EJBs
• Stateless session beans
A transient object which is invoked once, does its work, after which it
discards any information related to client.
• Stateful session beans
Maintains client related state, but lifetime is limited. When the client is
finished bean is automatically destroyed.
• Entity beans
A long living persistent object. Generally stored in database.
• Message-driven beans
Used to program objects to react to incoming messages. Cannot be directly
invoked by client. Better suited in a publish subscribe environment.
[Team 05 - Abhinav Joshi, Sandeep Raveendran Thandassery]
R U O K?
14) Which of the following accurately describes Message-driven
beans?
a)
b)
c)
d)
e)
Used to program objects to react to incoming messages.
Cannot be directly invoked by client.
Better suited in a publish subscribe environment.
All of the above.
None of the above.
[Team 05 - Abhinav Joshi, Sandeep Raveendran Thandassery]
10.1.3 Example: Globe Distributed Shared
Objects
• Scalability plays an important role in globe distributed shared objects.
• Similar to other object based systems it also follows encapsulation and operation on the
state
• But the main difference from other object based system is that objects are expected to
encapsulate the implementation of policies that describe the distribution of an object`s
state across multiple machines.
• Objects are in charge in globe distributed shared objects which decide how, when &
where it should be migrated.
• Also it takes decision regarding replication, Security policies and implementation.
[Team 06 (Shrey Ahluwalia, Shriya Shriya)]
RUOK?
15.Q: What are the characteristic of Global Distributed Shared Objects?
a) Scalability plays an important role in globe distributed shared
objects
b) It takes decision regarding replication, Security policies and
implementation Objects are in charge in globe distributed shared
objects which decide how, when & where it should be migrated
c) None of these
d) All of these
[Team 06 (Shrey Ahluwalia, Shriya Shriya)]
OBJECT MODEL
Objects in Globe :• Objects in Globe can be physically distributed and replicated across multiple
processes.
• Objects in Globe are termed as distributed shared objects, to reflect that objects are
normally shared between several processes.
• Local representative – Each process that is bound to a distributed shared object has a
local implementation of the interface known as local representative.
• Implementation details of the objects are hidden by the interface and only methods
are made visible.
• Classification of Globe local objects :1) Primitive local object – a local object that does not include any other local object
2) Composite local object – combination of multiple local objects.
Team 07 Abhinaya Ramachandran 1001268347 Dona Maria Jose 1001232757
General organization of a local object for distributed shared objects in Globe
1)
2)
3)
4)
Semantics sub object – implements the functionality
Communication sub object – provides standard interface to the underlying network
Replication sub object – implements actual distribution
Control sub objects – intermediate between the user defined interfaces and standardized interfaces
Team 07 Abhinaya Ramachandran 1001268347 Dona Maria Jose 1001232757
R U OK?
Match the following:16) Local representative 17) Primitive local object 18)Composite local object 19)Replication sub object –
20)Communication sub object-
a)
b)
c)
d)
e)
Combination of multiple local objects
Local implementation of the interface
Includes only a single local object
provides standard interface for underlying network
implements actual distribution
Team 07 Abhinaya Ramachandran 1001268347 Dona Maria Jose 1001232757
Processes Overview
• A key role in object-based distributed systems is played by object
servers, that is, the server designed to host distributed objects.
• We will concentrate on general aspects of object servers
• Next we focus on discuss open-source JBoss server.
Team 08
Akash Rana
Anmol Bhargava
Object Servers
• An object server is a server tailored to support distributed objects
• Important point to notice is that object server by itself does not
provide a specific service.
• Server provides only the means to invoke local objects
• Object server thus acts as a place where objects live.
Team 08
Akash Rana
Anmol Bhargava
RUOK
21. Object server by itself provides a specific service. (Say whether
true or false)
a) True
b) False (Correct answer)
c) Can’t say!
Team 08
Akash Rana
Anmol Bhargava
Open Source JBOSS Servers
• JBoss Application Server (or JBoss AS) is a free software/open-source
Java EE-based application server.
• Important distinction for this class of software is that it not only
implements a server that runs on Java, but it actually implements the
Java EE part of Java.
• JBoss application server operates cross-platform: usable on any
operating system that supports Java.
Team 08
Akash Rana
Anmol Bhargava
RUOK
22. Important distinction about JBOSS
a) Not only implements a server that runs on Java, but it actually
implements the Java EE part of Java. (Correct answer)
b) JBoss application server does not operate on Java hence crossplatform.
c) Paid software that makes it open source.
d) None of the above.
Team 08
Akash Rana
Anmol Bhargava
10.2.1 Object Servers
•
Servers tailored to support distributed objects, which doesn’t provide specific service
like other servers.
•
Specific services are implemented using specific objects in the server.
•
It provides only the means to invoke those objects through remote clients’ request.
•
So its easy to change those services by adding and removing objects.
•
Objects has 2 main parts; either separated or as single unit
• Data representing its State
• Code for executing its methods – can be shared among multiple objects.
•
Object server invokes these objects in a different way as compared to the conventional
one.
[Team 09; Nikhil Ravindran, Ruchir Kadam]
RUOK?
• 23Which of the following is NOT true for Object Servers?
a. Servers tailored to support distributed objects.
b. Services are being implemented using specific objects in the server, as its
not like traditional servers.
c. It provides means to invoke local objects by remote clients’ request.
d. Object has 2 main parts – State, Code
e. Changing services by adding and removing objects is not possible.
[Team 09; Nikhil Ravindran, Ruchir Kadam]
Alternatives for invoking an object
• For an object to be invoked, the object server needs to know which code to
execute, on which data it should operate, whether it should start a separate
thread to take care of the invocation.
• A much better approach is for a server to support different policies. Consider, for
example, transient objects.
• A reasonable policy is to create a transient object at the first invocation request
and to destroy it as soon as no clients are bound to it anymore.
• The advantage of this approach is that a transient object will need a server's
resources only as long as the object is really needed.
• The drawback is that an invocation may take some time to complete.
• There are many different policies with respect to threading. The simplest approach
is to implement the server with only a single thread of control.
• Alternatively, the server may have several threads, one for each of its objects.
Whenever an invocation request comes in for an object, the server passes the
request to the thread responsible for that object. The advantage of this approach is
that objects are automatically protected against concurrent access.
RUOK
24 What is the advantage of using transient objects ?
a. An in memory, read-only copy of a file could typically be implemented as a
transient object.
b. An invocation may take some time to complete.
c. A transient object will need a server's resources only as long as the object is
really needed.
d. None
Object Adapter
• The object must be brought into server’s address space before they
can be invoked.
• The decisions on how to invoke an object is part of activation policies.
• The need is there for grouping the objects as per policy which can be
done by mechanism called object adapter/wrapper.
• It can be defined as software implementing a specific activation
policy.
• It can have more than 1 objects under control and several object
adapters may reside in server implementing various policies.
Team 11
Vineet Nair
Arth Vyas
• When invocation request is sent to server , it is
first dispatched to appropriate object adapter.
• Here we can observe that object adapters are
unaware of the specific interfaces of objects
they control.
• The main activity for adapter is to extract
object reference from an invocation request
and subsequently dispatch the request to the
referenced object following the policy.
• Also seen in figure is that adapter directly
hands the invocation request to the sever side
stub of object.
Team 11
Vineet Nair
Arth Vyas
• Object Adapter can support different activation policies by simply configuring it at the
runtime.
• E.g. We can specify whether object should continue to exist after its associated
adapter has been stopped.
• Similarly it can be configured to generate object identifiers or let application provide
one. Also it maybe configured to operate in single threaded or multi threaded mode.
• To further the discussion, we see what the objects are really.
• As part of the implementation of such objects , server may access databases or call
special library routine.
• These implementation details are hidden from the adapters who communicates only
with a skeleton.
• The implementation of objects are different from language level objects. Hence, a
different terminology has been used.
• Servant is piece of code that implements an objects. Thus , java bean is seen as nothing
but as another kind of servant.
Team 11
Vineet Nair
Arth Vyas
RUOK?
• 25Which of the following statements are True?
a. Objects can be invoked only after they have been brought to
address space of the server.
b. The mechanism for grouping of objects as per policy is object
adapter’s job.
c. Object Adapter is piece of software that can be used to implement
specific activation policy.
d. All of the above.
e. None of the above.
Team 11
Vineet Nair
Arth Vyas
THE ICE RUNTIME SYSTEM
Introduction
• Ice runtime system have been developed in response to commercial object
based distributed system.
• An object server in Ice is nothing but an ordinary process that simply starts with
initializing the Ice runtime system (RTS).
• Run time environment is termed as Communicator
• Communicator manages number of basic resources, of which the most important
one is formed by a pool of threads.
• Communicator provides the means for configuring the environment.
• A communicator can also be used to create an object adapter.
Question
• 26 Which of the following is true about communicator?
1.
2.
3.
4.
It manages a pool of resources.
Configuration of environment
It is a part of ice runtime system.
All of above
Continue:
• Ice provides support for special objects known as locators.
• A locator is called when the adapter receives an incoming request for an object
that has not been explicitly added.
• For example, suppose a locator is handed a request for an object of which the
locator knows that its state is stored in a relational database system. The locator
has been programmed explicitly to handle such requests.
• There can be more than one locator added to an adapter. In that case, the
adapter would keep track of which object identifiers would belong to the same
locator.
• Using multiple locators allows supporting many objects by a single adapter
Question:
• 27Do an adaptor can have multiple locators?
• A. True
• B. False
THANK YOU
Communication
• Object Based Distributed Systems handle communication by:
• Invoking an object through a remote client
• The mechanism is based on remote procedure calls (RPCs)
• Prior to the remote procedure calls, other issues need to
dealt with
Team 13
Raman Kumaresan
Ankit Sheth
RUOK?
28What mechanism does Object Based Distributed Systems use to handle
communication?
a. Parameter passing.
b. Reference passing.
c. System call.
d. Remote Procedure calls.
e. All of the above.
Team 13
Raman Kumaresan
Ankit Sheth
Binding a client to an object
[Team 14 - Rehana Devani & Supreme]
Binding a client to an object
• systems supporting distributed objects provides systemwide object
references.
• object are freely passed between processes on different machines.
• hiding the actual implementation of an object reference makes it
opaque.
• When process holds an object reference
•
•
•
first bind to the referenced object before invoking any of its methods
Binding results in a proxy being placed in the process's address space
implementing an interface containing the methods the process can invoke
[Team 14 - Rehana Devani & Supreme]
Implicit and Explicit Binding
• With implicit binding, the client is offered a simple mechanism that
allows it to directly invoke methods using only a reference to an
object
• With implicit binding, the client is transparently bound to the object
at the moment the reference is resolved to the actual object
• the client should first call a special function to bind to the object
before it can actually invoke its methods
• Explicit binding generally returns a pointer to a proxy that is then
become locally available
[Team 14 - Rehana Devani & Supreme]
R U OK?
29)The order when process holds an systems supporting distributed object
reference
I.
II.
III.
IV.
a)
b)
c)
d)
first bind to the referenced object.
Binding results in a proxy being placed in the process's address space
invoking any of its methods
implementing an interface containing the methods the process can invoke
i -> iii -> iv ->ii
iii -> i -> ii -> iv
i -> ii ->iv->iii
i -> ii -> iii -> iv
[Team 14 - Rehana Devani & Supreme]
Implementation of Object
References
Team 15,
Padmashri Nonabur Krishnamurthy - 1001084560
Utphala Puttananjammagari - 1001246180
Implementation of Object References
• The object references should include most of the information
necessary.
• A simple object reference includes –
• Network address of the machine
• End point identification of the server
• The object identification
Team 15,
Padmashri Nonabur Krishnamurthy - 1001084560
Utphala Puttananjammagari - 1001246180
30What information does the object reference include?
a. Network address of the machine
b. End point identification of the server
c. The object identification
d. All of the above
e. None of the above
Team 15,
Padmashri Nonabur Krishnamurthy - 1001084560
Utphala Puttananjammagari - 1001246180
Drawbacks
The server is assigned different end point after recovery when the
server’s machine fails. Now all object references are invalid.
Solution: DCE has a local daemon per machine listening to a well
known end point. It has an end point table where it keeps the server to
end point assignments. The daemon is first contacted for the server’s
current end point while client to object binding. This requires encoding
server ID into the object reference that is used as an index to the end
point table.
Team 15,
Padmashri Nonabur Krishnamurthy - 1001084560
Utphala Puttananjammagari - 1001246180
Drawbacks
2. Encoding the network address of the server’s machine to the object
reference is not a good idea.
Solution: Instead of the local daemon maintaining the end point table,
let the location server keep the track of the machine where the object
server’s are running.
Team 15,
Padmashri Nonabur Krishnamurthy - 1001084560
Utphala Puttananjammagari - 1001246180
RUOK 2
31. What are the two drawbacks of implementing object references?
a. The server is assigned different end point after recovery when the
server’s machine fails. Now all object references are invalid.
b. Encoding the network address of the server’s machine to the object
reference is not a good idea.
c. Both a and b
d. Not a and b
Team 15,
Padmashri Nonabur Krishnamurthy - 1001084560
Utphala Puttananjammagari - 1001246180
32. What is the solution for the drawback 1?
a. Encoding server ID into the object reference.
b. Enhancing the end point table
c. Both a and b
d. None of the above
Team 15,
Padmashri Nonabur Krishnamurthy - 1001084560
Utphala Puttananjammagari - 1001246180
33. What is the solution for Drawback 2?
a. Encoding server ID into the object reference.
b. Enhancing the end point table
c. Both a and b
d. None of the above
Team 15,
Padmashri Nonabur Krishnamurthy - 1001084560
Utphala Puttananjammagari - 1001246180
Client and the Server
• Client and server are configures to use the same protocol stack.
• Apart from using the same transport protocol such as TCP, they are
use same protocols for marshaling and un-marshaling parameters.
• They also use same parameters for setting up connections, handling
errors and flow control.
Team 15,
Padmashri Nonabur Krishnamurthy - 1001084560
Utphala Puttananjammagari - 1001246180
34. Client and server role in object references?
a. Client and server are configures to use the same protocol stack.
b. Apart from using the same transport protocol such as TCP, they are
use same protocols for marshaling and un-marshaling parameters.
c. They also use same parameters for setting up connections, handling
errors and flow control.
d. All of the above
Team 15,
Padmashri Nonabur Krishnamurthy - 1001084560
Utphala Puttananjammagari - 1001246180
10.3.2 Static versus Dynamic
Remote Method Invocations
Static invocation:
• Uses predefined interface definitions.
• Required to know the object’s interface while developing client
application.
• Change in the interfaces leads to recompilation of application.
• General form: fobject.append(int)
Dynamic invocation:
• Method invocation composed at runtime
• Application choses at runtime which method to invoke.
• General form: invoke(fobject,id(append),int)
Team 16 (Hardik Parekh, Ankur Patel)
RUOK ?
35 What is the difference between static and dynamic invocation ?
a)
b)
c)
d)
Static invocation uses interface definitions that are predefined.
In dynamic methods, invocations are created during runtime.
Both a and b.
None of the above.
Team 16 (Hardik Parekh, Ankur Patel)
Download