CSC 8560 Computer Networks Project

Download Report

Transcript CSC 8560 Computer Networks Project

CSC 8560 Computer Networks
Project-1
Chat Room Application using CORBA (IIOP)
Abhishek Bachchan
Vishal Patangia
CORBA (Common Object Request Broker Architecture)
CORBA (Common Object Request Broker
Architecture), is a set of industry standards
for distributed object software technology.
The technical goal of the CORBA standards is
to allow reliable, platform-independent
remote execution of object-oriented software
in wide and local area network environments.
Object Request Broker (ORB)
The ORB acts as sort of a "software bus" that
manages
storage,
interaction
and
communications of object-based application
executing on the respective platforms across
a wide or local area network.
Objects themselves are executed by the
operating system and application software
running on the environment where a given
ORB resides.
ORB Responsibilities





Given an object reference from a client, the ORB
locates the corresponding object implementation (the
server) on behalf of the client.
When the server is located, the ORB ensures that the
server is ready to receive the request.
The ORB on the client side accepts the parameters of
the method being invoked and marshals the
parameters to the network.
The ORB on the server side unmarshals the
parameters from the network and delivers them to the
server.
Return parameters, if any, are marshaled/unmarshaled
in the same way.
ORB Architecture
CORBA Interface Definition Language (IDL)
The CORBA IDL is a contractual definition
language used to define the interface to
objects.
An object interface is written in IDL, which is
then compiled to the implementation
language of choice (e.g.: C++, Java).
IDL Provides Language Independence
Because interfaces described in IDL can be
mapped to any programming language,
CORBA applications and components are
thus independent of the languages used to
implement them.
In other words, a client written in C++ can
communicate with a server written in Java,
which in turn can communicate with another
server written in COBOL, and so forth.
Inter-ORB Protocols
CORBA specification is neutral with respect to network
protocols. The CORBA standard specifies what is
known as the General Inter-ORB Protocol (GIOP),
which specifies, on a high level, a standard for
communication between various CORBA ORBs and
components.
GIOP, as its name suggests, is only a general protocol;
the CORBA standard also specifies additional
protocols that specialize GIOP to use a particular
transport protocol. For instance, GIOP-based
protocols exist for TCP/IP and DCE.
Internet Inter-ORB Protocol (IIOP)
The Internet Inter-ORB Protocol (IIOP) is a
specialization of the GIOP.
IIOP is the standard protocol for communication
between ORBs on TCP/IP based networks.
CORBA and the Networking Model
Essentially, CORBA applications are built on top of
GIOP-derived protocols such as IIOP. These
protocols, in turn, rest on top of TCP/IP, DCE, or
whatever underlying transport protocol the network
uses.
CORBA applications aren't limited to using only one of
these protocols; an application architecture can be
designed to use a bridge that would interconnect, for
instance, DCE-based application components with
IIOP-based ones.
Networking Model
Stubs and Skeletons
The IDL compiler generates what are known as client
stubs and server skeletons.
Client stubs and server skeletons serve as a sort of
"glue" that connects language-independent IDL
interface specifications to language-specific
implementation code.
A Client Stub, is a small piece of code that makes a
particular CORBA server interface available to a
client.
A Server Skeleton, is a piece of code that provides
the "framework" on which the server implementation
code for a particular interface is built.
Client Stubs and Server Skeleton
Remote Invocation with ORB
CORBA Features

Language independence

Platform independence

Location transparent – LAN, Internet. Object location is
completely transparent to application code. This makes CORBA
well suited to applications which require high-availability or in
which objects may be moving around a network.

Availability of tools and expertise

Interoperability - CORBA applications can communicate with
Java applications using Java's integrated CORBA support and
with COM/DCOM applications using a standardized gateway.
Chat IDL
module Chat{
interface Displayer
{
void
receive_update(in string msg, in string nam);
};
interface Publisher
{
typedef sequence<Displayer> DisplayerList;
void
void
void
};
};
add_displayer(in Displayer s);
remove_displayer(in Displayer s);
send_message(in string msg, in string nam);
Project Goal


To develop a Chat-Room Application using
Java as Programming Language based on
CORBA architecture standards.
We used Windows 2000 as the OS and the
campus LAN as our environment to test this
application.
Chat Application – Class Diagram
ORB Generated Classes and Interfaces
Diagram Link
Parts of Server Code
public static void main(String[] args) {
try {
// Initialize the ORB.
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);
// get a reference to the root POA
POA rootPOA = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
:
:
:
byte[] managerId = "ChatManager".getBytes();
myPOA.activate_object_with_id(managerId, chatServant);
// Activate the POA manager
rootPOA.the_POAManager().activate();
// Wait for incoming requests
orb.run();
}catch (Exception e) {
e.printStackTrace();
}
}
Parts of Client Code
public static void main(String[] args) {
try{
// Initialize the ORB.
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);
// Get the manager Id
byte[] managerId = "ChatManager".getBytes();
// Locate an account manager. Give the full POA name and the servant ID.
Chat.Publisher publisher =
Chat.PublisherHelper.bind(orb, "/chat_poa", managerId);
:
:
: