Dickson K.W. Chiu - PowerPoint PPT Presentation

1 / 97
About This Presentation
Title:

Dickson K.W. Chiu

Description:

OMG Mission -Develop a single architecture, using object technology, for ... interfaces standardized by OMG (low level) ... OMG Business Object Task Force ... – PowerPoint PPT presentation

Number of Views:121
Avg rating:3.0/5.0
Slides: 98
Provided by: kwc6
Category:
Tags: chiu | dickson | omg

less

Transcript and Presenter's Notes

Title: Dickson K.W. Chiu


1
CSC3530 Software Technology Introduction to
Distributed Objects
  • Dickson K.W. Chiu
  • Dept. of Computer Science Engineering
  • Chinese University of Hong Kong, Shatin, HK
  • Thanks to Dr SC Cheung (HKUST)

2
Why Distributed Objects?
  • An object encapsulates
  • a piece of information
  • business logic on the information
  • Software building by component assembly
  • Facilitates the information to be located and
    manipulated anywhere in a distributed environment
  • Allows finer and more flexible granularity of
    distribution
  • Coexistence with legacy applications through
    wrapper interface
  • Self-describing (introspective) and self-managing
    entities
  • Portability / Mobility (JavaBean)
  • Mask platform-specific elements ? interoperability

3
Object Management Group (OMG)
  • publishes OMA (Object Management Architecture),
    CORBA (Common Object Broker Request Arch.) and
    UML (Unified Modeling Language)
  • a non-profit consortium made up of over 700
    software vendors and users http//www.omg.org/
  • with an objective to establish a framework for
    the integration of distributed object-oriented
    applications.
  • OMG Mission -Develop a single architecture, using
    object technology, for distributed application
    integration, guaranteeing
  • reusability of components
  • interoperability portability
  • basis in commercially available software
  • Focus on swiftly-developed, easily usable (off
    the shelf) component standards.

4
Object Management Architecture
Object Request Broker CORBA 2 IIOP
- ORBIX - IONA - Obj Broker BEA - VisiBroker
Borland - Omni Orb Olivetti - Component Broker
IBM
5
Object Management Architecture
  • Originally proposed in Fall 1990
  • Finalized in Jan 1995
  • Object architecture on which CORBA is defined ORB
    - A message bus for object communication
    regardless of any object's location or
    implementation.
  • Object Services provide fundamental assistance to
    application developers. Typical services include
    Naming, Event Notification, Transaction
    Management, Persistence and Trading.
  • Common Facilities provide common higher level
    services, such as printing, distributed
    documents.
  • Domain Objects provide commercial services, such
    as healthcare, telecommunications, ...

6
Functions of Object Request Broker
  • An abstract bus or proxy
  • Static and dynamic method invocation (dynamic
    which method to invoke determine at run time)
  • Self-describing system through Interface
    Repository (metadata)
  • Local / remote transparency (through IIOP)
  • Built-in security and transaction
  • Polymorphic messaging same function call on
    different object have different effect (e.g.,
    eat_banana )
  • Coexistence with existing systems (IDL
    interface description language)

7
RPC vs ORB
  • RPC call function with separated data
  • ORB
  • call a method with a specific object
  • Different object classes may respond to same
    method invocation differently (polymorphism)
  • As each object manages its own private instance
    data, the method is implemented on that specific
    instance data

8
What is CORBA?
  • "E-Commerce CORBA
  • extracted from an advertisement in the South
    China Morning Post in August

"Common Object Request Broker Architecture
(CORBA) has been increasingly recognized as the
open standard to deliver E-commerce and Internet
mission critical applications."
9
What is CORBA?
  • A standard NOT implementation
  • http//www.cobra.org/
  • Location transparency
  • object at anywhere on a network
  • Interoperability
  • object on any platforms
  • object in any languages
  • The Object Request Broker (ORB) is the middleware
    that establishes the client-server relationships
    between objects.

10
Developments of CORBA
  • 1991 CORBA 1.1 Standardize IDL
  • interoperability between different languages
  • 1995 CORBA 2.0 Standardize IIOP
  • IIOP - Internet Inter-Orb Protocol
  • interoperability between different ORBs
  • 1999 CORBA 3.0 Standardize Business
  • Objects
  • interoperability between business objects
  • Note J2EE is a Java implementation base on CORBA

11
CORA Architecture (another view)
12
CORBA Facilities
  • COBRAservices - interfaces standardized by OMG
    (low level)
  • COBRAfacilities for user objectives (high
    level)
  • Horizontal Facilities for general use
  • User Interface Facilities
  • Information Management Facilities
  • System Management Facilities
  • Task Management Facilities
  • Vertical Facilities for specialized application
    market, e.g., manufacturing, accounting

13
CORBA Domains
  • In COBRA a domain is a modeling concept
  • A set of objects for a defined functions, with a
    common set of rules and characteristics
  • Example of domain types network addressing
    network connectivity, reference, and transaction
  • Examples of specific domain objects e-commerce
    manufacturing, telecomm
  • Allows system partitioning into components
  • A domain can be a member of another domain
  • Domains related through federation (with bridges)
    or containment
  • Domains can coexists with common objects

14
What is a Component?
  • A marketable entity
  • NOT a complete application
  • Can be used in unpredictable combinations
  • Has a well-specified interface
  • Toolability imported within standard tool
    palette (container) for reuse
  • Event publish and subscribe
  • Configuration and property management
  • Scripting
  • Metadata and introspection (self-inspection)
  • Interoperability
  • Ease of use

15
CORBA Business Object
  • OMG Business Object Task Force
  • Application-independent concepts, e.g.,
    customers, invoice, car, patient
  • Self-contained deliverable with user interface,
    state and knows how to cooperate with other
    business objects
  • Cooperating business objects to form
    applications car reservation example

16
Business Object Components
  • Model/View/Controller paradigm (cf. Smalltalk,
    GUI)
  • Business objects model data, metadata,
    concurrency, business rules
  • Business process objects controller - business
    logic at enterprise level
  • Presentation objects view

17
Interoperability
C
C
COBOL
Java
C
C
COBOL
Java
Ada
Ada
IDL
IDL
IDL
IDL
IDL
IDL
IDL
IDL
IDL
IDL
Client
Server
Object Request Broker
18
Object Interaction
Bank Object
Clerk Object
Account Object
Statement Object
  • interface Bank
  • Account getAccount (in string name)

19
Object Passing by Value
get
Client Process
Server Process
Step 1
serialized object
copy of object
object
Client Process
Server Process
Step 2
copy of object
object
processing
Client Process
Server Process
Step 3
copy of object
object
20
Object Passing by Reference
get
Client Process
Server Process
Step 1
object reference
object
Client Process
Server Process
object reference
object
Step 2
method invocation
Client Process
Server Process
object reference
object
Step 3
processing
21
Client Callback Model
Security purpose http//java.sun.com/j2ee/tutori
al/1_3-fcs/doc/Security6.html
22
ORB Structure
23
Interface Description Language
Grid Object
Clients
  • interface Grid
  • readonly attribute short height
  • readonly attribute short width
  • void set ( in short row, in short col, in long
    value )
  • long get ( in short row, in short col )

24
IDL Compiler
  • IDL provides a programming language independent
    interface and supports multiple language mappings
    (e.g. C, C, Smalltalk, Java etc.).
  • A given IDL specification is compiled by an IDL
    compiler into header files, stubs and skeletons.
  • idl -B -S Grid.idl

25
A Common Type Hierarchy
26
Differences from C
  • No pointers
  • No Constructors or destructors
  • No overloaded methods
  • No int data type
  • Must specify parameter passing modes
  • No templates
  • No control constructs (e.g., while, if, case)
  • More data types like sequence any

27
IIOP and Multi-vendor ORBs
  • IIOP - Internet Inter-Orb Protocol
  • elaborates further on how agents may open TCP/IP
    connections and use them to transfer messages.
  • It defines the structure of an interoperable
    object reference (IOR) which consists of
    information to locate an object across the
    Internet.
  • Servers that are capable of accepting object
    requests publish TCP/IP addresses as
    interoperable object reference (IOR).

28
CORBA Inter-ORB Architecture (ref)
29
Basic Issues in CORBA Programming
  • Programming environment
  • how to build a CORBA application
  • CORBA initialization
  • how to initialize the CORBA environment and
    access the basic CORBA services at run time

30
CORBA Programming Environment
compile
use
Client OC
Client Impl
Client IDL Stub
Precompile by IDL Compiler
IDL for Counter
extend
Skeleton
compile
Server OC
Server Impl
Example Servant
load
modify
instantiate
register
Interface Repository
Implementation Repository
Object Adapter
31
Initializing CORBA
CORBA API
New Object
ORB
ORB_init
BOA_init
list_initial_services
resolve_initial_references
32
A Counter Example
Count Server
Client
increment( )
Attribute sum
  • Set the initial value of the sum attribute
  • Invoke the increment( ) method 1,000 times
  • Display the final value

33
The Counter Interface - count.idl
  • module Counter // file count.idl ...
  • interface Count
  • attribute long sum
  • long increment( )
  • Module
  • a naming context for a set of related interfaces
  • corresponds to Java package or C name space
  • Mapping CORBA IDL to C
  • idl2cpp count.idl

34
At Client Side
  • include Count_c.hh
  • int main(int argc, char argv )
  • CORBAORB_ptr orb CORBAORB_init(argc,
    argv)
  • Count_var Counter Count_bind(My Count)
  • // after binding the remote object is just used
    like normal
  • Counter-gtsum( 0 )
  • for ( int i 0 i lt 1000 i )
  • Counter-gtincrement( )
  • cout ltlt Sum ltlt Counter-gtsum( )

35
Server Side Count Implementation
  • // file CountImpl.h CountImpl.cpp ...
  • class CountImpl public virtual
    _sk_Counter_sk_Count
  • private
  • long _sum
  • public
  • CountImpl(const char object_nameNULL)
  • _sk_Count(object_name) _sum 0
  • virtual long sum( ) return _sum
  • virtual void sum( long val ) _sum val
  • virtual long increment( ) return _sum

36
Server side Server Implementation
  • int main (int argc, char argv )
  • try
  • CORBAORB_ptr orb CORBAORB_init(argc,
    argv)
  • CORBABOA_ptr boa orb-gtBOA_init(argc, argv)
  • CounterCount_var count new CountImpl("My
    Count")
  • boa-gtobj_is_ready(count)// export the count
    object
  • boa-gtimpl_is_ready( ) // ready to service
    requests
  • catch(const CORBAException e)
  • cerr ltlt e ltlt endl
  • return 0

37
Basic Object Adapter (BOA)
  • A plug-replaceable component
  • Without OA, objects are transient (i.e., cannot
    be automatically activated later by its
    reference)
  • Selected based on specific features, e.g.,
  • a vendor may supply two BOAs that
  • deploy one thread for similar connections
  • deploy different threads for each connection
  • A central component in CORBA implementations
  • But vendor specific, i.e., not portable across
    vendors
  • Not suitable for web deployment
  • POA (portable object adapter) is being defined
    for web deployment of CORBA Java objects

38
Registering the Server
  • putit -h lthostnamegt My Count ltexecutable filegt
  • The implementation repository maintains a mapping
    from the server name to the name of the
    executable file.
  • Upon receiving requests from clients, the
    implementation repository will invoke the
    executable file if the server does not exist.

39
Where do we go from here? (ref)
  • CORBA 3.0
  • Java to IDL Mapping
  • Server Portability (POA)
  • CORBA/DCOM
  • IIOP Firewall Support
  • port 683 for regular IIOP port 684 for IIOP
    over SSL
  • allows restricted bidirectional IIOP connections
    for callbacks Multiple Interfaces
  • Objects-by-Value
  • QoS control - Minimum / Real-time CORBA
  • CORBA Component Model - an extension of EJB model
  • Mapping CORBA to existing scripting languages,
    e.g., VBScript, CORBAScript, JavaScript, Perl, ...

40
Reference
  • www.omg.org
  • detailed information about CORBA and activities
    of OMG
  • http//www.it.swin.edu.au/cetus/oo_corba.html
  • contains lots of resources, tutorials, demo
    applications and examples on CORBA
  • Java
  • Java Programming With CORBA by A. Vogel K.
    Duddy, John Wiley Sons, 1997
  • Client/Server Proramming With Java and CORBAby
    D. Harkey R. Orfali, John Wiley Sons, 1998
  • C/C
  • CORBA Programming and Fundamentalsby J. Siegel,
    John Wiley Sons,1996
  • CORBA Distributed Objects using Orbixby Sean
    Baker, ACM Press, Addison-Wesley, 1997

41
CORBA Meets Java
  • CORBA Java is an ideal match where
  • Java provides platform independence
  • CORBA provides network and language transparency
  • However, the merge was complicated by
  • JavaSoft started to define another distributed
    object standards for Java when shipping Java RMI.
  • The complication was over when JavaSoft includes
    a CORBA/IIOP ORB as part of the JDK 1.2 core.
  • Java RMI APIs will run on top of CORBA/IIOP.

42
What exactly is a CORBA/Java ORB?
  • CORBA IIOP ORB written in pure Java
  • Generates Java language bindings from CORBA IDL
  • Allows a Java applet/application to invoke the
    method of another CORBA object via IIOP
    (bypassing CGI and HTTP)

RPC
C Object
Java Object
Java ORB
IIOP
C ORB
43
Java Clients COBRA IIOP vs HTTP-CGI
44
Java/CORBA vs other ORBs
45
Java IDL - A Java ORB by JavaSoft
  • Bundled in JDK1.2
  • Used together with idltojava compiler
  • Support transient objects
  • objects whose lifetimes are limited by their
    server processs lifetime
  • Support a transient nameserver
  • Organize objects into a tree-directory structure
  • No interface repository, i.e., no dynamic
    invocation

46
A Simple Example using Java IDL (ref)
Count Client
Count Server
Object Reference
Servant
increment( )
ORB
IIOP
47
The Interface of Counter - count.idl (ref)
  • module Counter // declare the java package
  • interface Count
  • attribute long sum
  • long increment( )
  • Mapping CORBA IDL to Java
  • idltojava -fno-cpp count.idl
  • ls
  • Counter/ count.idl

48
Count.java - Java Version of IDL (ref)
  • ls Counter/
  • Count.java CountHolder.java
    _CountStub.java
  • CountHelper.java _CountImplBase.java
  • cat Counter/Count.java
  • // Java version of the IDL
  • package Counter
  • public interface Count extends org.omg.CORBA.Objec
    t
  • int sum( )
  • void sum(int arg)
  • int increment( )

49
_CountImplBase.java - Server Skeleton (ref)
  • package Counter
  • public abstract class _CountImplBase extends
    org.omg.CORBA.DynamicImplementation
  • implements Counter.Count
  • // Constructor
  • public _CountImplBase()
  • super()
  • private static java.util.Dictionary _methods
    new java.util.Hashtable()
  • static
  • _methods.put("_get_sum", new
    java.lang.Integer(0))
  • _methods.put("_set_sum", new
    java.lang.Integer(1))
  • _methods.put("increment", new
    java.lang.Integer(2))

50
_CountImplBase.java (ref)
  • // DSI Dispatch call
  • public void invoke(org.omg.CORBA.ServerRequest
    r)
  • switch (((java.lang.Integer)
    _methods.get(r.op_name())).intValue())
  • case 0 // Counter.Count.sum
  • org.omg.CORBA.NVList _list
    _orb().create_list(0)
  • r.params(_list)
  • int ___result this.sum()
  • org.omg.CORBA.Any __result
    _orb().create_any()
  • __result.insert_long(___result)
  • r.result(__result)
  • break
  • case 1 // Counter.Count.sum
  • org.omg.CORBA.NVList _list
    _orb().create_list(0)
  • org.omg.CORBA.Any _arg
    _orb().create_any()
  • ...

51
_CountStub.java - Client Stub (ref)
  • package Counter
  • public class _CountStub
  • extends org.omg.CORBA.portable.ObjectImpl
  • implements Counter.Count
  • // IDL operations
  • // Implementation of attribute sum
  • public int sum()
  • org.omg.CORBA.Request r
    _request("_get_sum")
  • r.invoke()
  • int __result
  • __result r.return_value().extract_lon
    g()
  • return __result

52
_CountStub.java (ref)
  • public void sum(int arg)
  • org.omg.CORBA.Request r
    _request("_set_sum")
  • org.omg.CORBA.Any _sum
    r.add_in_arg()
  • _sum.insert_long(arg)
  • r.invoke()
  • // Implementation of CounterCountin
    crement
  • public int increment()
  • org.omg.CORBA.Request r
    _request("increment")
  • r.invoke()
  • int __result
  • __result r.return_value().extract_lon
    g()
  • return __result

53
CountHelper.java - cast object ref (ref)
  • package Counter
  • public class CountHelper
  • // It is useless to have instances of this
    class
  • private CountHelper()
  • ...
  • public static Counter.Count
    narrow(org.omg.CORBA.Object that)
  • throws org.omg.CORBA.BAD_PARAM
  • if (that null) return null
  • if (that instanceof Counter.Count) return
    (Counter.Count) that
  • if (!that._is_a(id())) throw new
    org.omg.CORBA.BAD_PARAM()
  • ...

54
CountHolder.java (ref)
  • // provides operations for out and inout
    arguments
  • package Counter
  • public final class CountHolder
  • implements org.omg.CORBA.portable.Streamable
  • ...
  • public void _write(org.omg.CORBA.portable.OutputS
    tream out)
  • Counter.CountHelper.write(out, value)
  • public void _read(org.omg.CORBA.portable.InputStr
    eam in)
  • value Counter.CountHelper.read(in)
  • ...

55
Sample code of Counter._example_Count (ref)
  • // optional, depending on products
  • // template helps programmers to develop
    CounterServant.java
  • package Counter
  • public class _example_Count extends
    Counter._CountImplBase
  • // constructor to give each instance a
    persistent name
  • public _example_Count( java.lang.String name )
    super( name )
  • public _example_Count( ) super( ) //
    anonymous object
  • public int increment( ) / implement
    operation... /
  • public void sum( int sum ) / implement
    attribute writer /
  • public int sum( ) / implement attribute
    reader /

56
CountServant Count Implementation (ref)
  • import Counter. // import
    package containing the stubs
  • import org.omg.CosNaming. // import the
    naming service
  • import org.omg.CORBA. // standard for
    CORBA classes
  • class CountServant extends Counter._CountImplBase
  • private int sum
  • public CountServant( ) // constructor
  • super( ) sum 0
  • System.out.println( "Count Object Created" )
  • public int sum( ) return sum // get sum
  • public void sum( int val ) sum val // set
    sum
  • public int increment( ) sum return sum

57
CountServer Main server program (ref)
  • import Counter.
  • import org.omg.CosNaming.
  • import org.omg.CORBA.
  • public class CountServer
  • public static void main(String args)
  • try
  • ORB orb ORB.init(args, null) // creat
    ORB
  • CountServant count new CountServant()
    // create servant
  • orb.connect(count) // register servant
  • org.omg.CORBA.Object objRef // get
    root naming context
  • orb.resolve_initial_references("NameService")
  • NamingContext rootContext
    NamingContextHelper.narrow(objRef)
  • NameComponent nc new NameComponent("My
    Count", "")
  • NameComponent path nc
  • rootContext.rebind(path, count)
  • java.lang.Object sync new
    java.lang.Object() // create a sync object
  • synchronized(sync) sync.wait() //
    wait for clients invocation
  • catch(Exception e)
  • System.err.println("ERROR " e)
    e.printStackTrace(System.out)

58
Java IDL and Object Adapter (ref)
  • Unlike the C implementation, CountServer using
    Java IDL does not invoke BOA
  • Web deployment requires the use of a Portable
    Object Adapter (POA)
  • POA implementations CORBA 3.0 / J2EE
  • Java IDL will include POA features when it is
    available
  • Before that, Java servants bind to ORB directly
    without invoking an OA
  • Without OA, objects are transient (i.e., cannot
    be automatically activated later by its reference)

59
CountClient - Client Implementation (ref)
  • import Counter. // import package containing
    the stubs
  • import org.omg.CosNaming. // import the naming
    service
  • import org.omg.CORBA. // standard for CORBA
    classes
  • class CountClient
  • public static void main( String args ) //
    for an java application
  • ORB orb ORB.init( args, null ) // create an
    ORB object
  • org.omg.CORBA.Object objRef // get reference
    to name server
  • orb.resolve_initial_references("NameService")
  • NamingContext rootContext NamingContextHelper.n
    arrow(objRef)
  • NameComponent nc new NameComponent(My Count",
    "") //id,kind
  • NameComponent path nc
  • Counter.Count counter CountHelper.narrow(
    rootContext.resolve(path) )
  • counter.sum( (int) 0 )
  • for (int i 0 i lt 1000 i )
    counter.increment( )
  • System.out.println( "Sum " counter.sum( ) )

60
Running the Counter Application
  • Start the Java IDL name server
  • tnameserv -ORBInitialPort xxx
  • cssu152.cs.ust.hk tnameserv -ORBInitialPort 1055
    -ORBInitialHost yyy
  • 2 13075
  • cssu152.cs.ust.hk Initial Naming Context
  • IOR000000000000002849444c3a6f6d672e6f72672f436f73
    4e616d696e672f4e616d696e67436f
  • 6e746578743a312e3000000000010000000000000038000100
    0000000012637373753135322e6373
  • 2e7573742e686b0097a100000018afabcafe000000027bb573
    28000000080000000000000000
  • TransientNameServer setting port for initial
    object references to 1055
  • Transient means the directory information will
    lose when the server dies

61
Running the Counter Application
  • Start the CountServer
  • java CountServer -ORBInitialPort xxx
  • cssu152.cs.ust.hk java CountServer
    -ORBInitialPort 1055
  • 3 13082
  • Start the CountClient
  • java CountClient -ORBInitialPort xxx
  • cssu152.cs.ust.hk java CountClient
    -ORBInitialPort 1055
  • Sum 1000
  • cssu152.cs.ust.hk java CountClient
    -ORBInitialPort 1055
  • Sum 1000

62
Object Activation
  • CORBA defines four modes to activate object
    instances
  • Persistent server
  • start server program manually
  • Shared server
  • start server automatically in response to an
    invocation of a persistent object
  • Process per connection (-p unshared)
  • each client connection gets its own instance of
    count
  • the instance dies when the connection is closed
  • Process per request (-p per-method) like CGI

63
Sharing policy (each object/thread)
Server S
Client1
Count_bind(Counter1S)
Client2
Counter1
Count_bind(Counter2S)
Counter2
Client3
Count_bind(Counter3S)
Counter3
putit -shared -marker ltmarkergt ltpathgt
64
Unshared Policy
Client1
Counter1
Count_bind(Counter1S)
Client2
Count_bind(Counter2S)
Counter2
Client3
Counter3
Count_bind(Counter3S)
putit -unshared -marker ltmarkergt ltpathgt
65
Shared Server (Visibrokers way) (ref)
  • package Counter
  • public class CreateSvr // create the persistent
    server count
  • public static void main(String args ) throws
    Exception
  • java.util.Properties p new java.util.Properties
    ()
  • p.put(org.omg.CORBA.ORBClass,com.visigenic.vbr
    oker.orb.ORB)
  • ORB orb ORB.init(args, p)
  • BOA boa orb.BOA_init() // create a BOA
  • CountServant count new CountServant(MyCount)
    //persistent obj
  • boa.obj_is_ready(count)
  • // register count to the naming server
  • // Now dont block - just exit
  • java -DORBservicesCosNaming -DSVCnamerootRoot
    Counter.CreateSvr

66
Shared Server (Visibrokers way) (ref)
  • package Counter
  • public class RestoreSvr // restore the
    persistent server count
  • public static void main(String args ) throws
    Exception
  • java.util.Properties p new java.util.Properties
    ()
  • p.put(org.omg.CORBA.ORBClass,com.visigenic.vbr
    oker.orb.ORB)
  • ORB orb ORB.init(args, p)
  • BOA boa orb.BOA_init() // create a BOA
  • CountServant count new CountServant(MyCount)
    //persistent
  • boa.obj_is_ready(count)
  • // does not bother to register count to the
    naming server
  • // Now block forever
  • oadutil reg -I CounterCountServant -o MyCount
    -java Counter.RestoreSvr -p shared
  • putit -shared -marker ltmarkergt ltpathgt

67
Advantages Java Brought to CORBA
  • Simplifies code distribution in large CORBA
    systems
  • Let clients to receive the updated Java code from
    server.
  • Complements CORBAs agenting infrastructure
  • CORBA objects written in Java can be moved from
    node to node.
  • Facilitate CORBA to take off
  • Allows CORBA applications launching on the web
    which is the largest and the most popularly used
    information infrastructure.

68
An Object Web Model
1. Get HTML Page
2. Get Applet
HTTP Server
3. Load Applet
CORBA Server
4. CORBA IIOP
DBMS
Web Server
Web Browser
Tier 1
Tier 2
Tier 3
69
Object Web - Applying the Concepts of Objects on
the Web
  • An infrastructure bringing together HTTP, CORBA
    and Java play together.
  • A typical scenario
  • Web browser downloads an HTML page
  • Web browser retrieves Java applet from an HTTP
    server
  • Web browser loads and run the applet
  • Applet invokes CORBA server objects
  • Server objects reply to the applet
  • Make possible by Netscape shipping a CORBA/Java
    ORB with each copy of Communicator since June
    1998.

70
Does this work?
  • cssu152.cs.ust.hk cat HelloApplet.html
  • ltHTMLgt
  • ltHEADgt
  • ltTITLEgtHelloWorld Applet, a sample CORBA
    appletlt/TITLEgt
  • lt/HEADgt
  • ltBODYgt
  • ltAPPLET
  • CODE"Examples.javaidl.HelloWorld.HelloApp
    let.class"
  • WIDTH404 HEIGHT327gt
  • ltPARAM NAMEORBInitialHost
    VALUE"cssu152.cs.ust.hk"gt
  • ltPARAM NAMEORBInitialPort VALUE1059gt
  • Unable to load applet
  • lt/APPLETgt
  • lt/BODYgt
  • lt/HTMLgt

71
Two Major Security Issues
  • Sandbox
  • unsigned applets can communicate only with the
    host at which the applet is downloaded
  • Firewall
  • firewalls could not recognize IIOP messages or
    restrict remote connections to specific ports,
    say 80 (HTTP) or 443 (SSL)
  • How do CORBA vendors get around these two
    problems?

72
A Forwarder Solution - IIOP Gateway
  • Allows an applet invoke an object server on a
    host other than the one it originated
  • Route all interactions through the IIOP gateway

Download Applet
CORBA Application Server
HTTP Server
IIOP
IIOP
IIOP Gateway
CORBA-enabled objects run within the sandbox
73
A Forwarder Solution - IIOP Gateway (ref)
  • cssu152.cs.ust.hk cat HelloApplet.html
  • ltHTMLgt
  • ltHEADgt
  • ltTITLEgtHelloWorld Applet, a sample CORBA
    appletlt/TITLEgt
  • lt/HEADgt
  • ltBODYgt
  • ltAPPLET
  • CODE"Examples.javaidl.HelloWorld.HelloApple
    t.class"
  • WIDTH404 HEIGHT327gt
  • ltPARAM NAME OrbixWeb.IT_IIOP_PROXY_PORT
    VALUE"1090"gt
  • ltPARAM NAME OrbixWeb.IT_IIOP_PROXY_HOST
    VALUE"143.89.41.52"gt
  • ltPARAM NAME OrbixWeb.IT_IIOP_PROXY_PREFERR
    ED VALUE"true"gt
  • Unable to load applet
  • lt/APPLETgt
  • lt/BODYgt
  • lt/HTMLgt

74
A Forwarder Solution - IIOP Gateway
  • Gatekeeper (Visigenic's product)
  • Wonderwall (IONAs product)
  • Provides HTTP tunneling to allow communication
    across client-side firewalls which do not
    recognize IIOP (limitation no call-backs)

Client-side Firewall
http//
CORBA Application Server
HTTP Server
http//8080
IIOP
IIOP Gateway
75
A Forwarder Solution - IIOP Gateway
  • Provides web server services for client-side
    firewalls allowing only port 80 (HTTP) or 443
    (SSL)

CORBA Application Server
http//
IIOP
IIOP
Web Server / Gateway
76
COBRA Dynamic Invocation
  • Clients interact with servers without knowing
    their interfaces.
  • Interface discovery procedure
  • Clients get the object reference of a server at
    run time
  • Clients obtain the supported interface
  • Clients locate a method
  • Clients find out the method signature
  • Clients construct a request
  • Clients forward the request to the server
  • Transparency to the servers

77
Dynamic Invocation
2 get_interface( )
1
5 create_list( ) 6 add_item( ) 7
create_request( )
8 invoke( )
3 lookup_name( )
4 describe( )
78
Scenario of Dynamic Invocation
OperationDef
Client
Server
ORB
InterfaceDef
get_interface
lookup_name
NVList
describe
create_list
add_item
repeat
add_value
Request
create_request
invoke
delete
free
79
Static or Dynamic Invocation?
  • Dynamic invocation
  • more flexible
  • add new server classes to the system easily - no
    change in client implementation
  • suitable for an open environment (with little
    control or knowledge of the server classes)
  • error prone - little type checking at compile
    time
  • most in-house developments dont require this
    flexibility
  • Static invocation
  • pre-compile static interfaces in the form of
    stubs
  • perfect if the server interface is known at
    compile time
  • easier to program (good for beginners)
  • provides robust type checking
  • runs faster (40 times faster than dynamic
    invocation)
  • self-documenting (can tell the interface by
    examining the code)
  • suitable for a closed environment (i.e., in full
    control of the clients and servers)
  • portable stubs working with several ORBs are
    emerging

80
Benchmarks
81
CORBA Object Services (ref)
  • General Services
  • Life Cycle ? create, copy, move delete objects
  • Licensing ? license query different charging
    schemes
  • Time ? synchronize time manage time-triggered
    events
  • Distributed systems related services
  • Naming ? locate objects by name
  • Event ? event multicast (register / unregister)
  • Security ? access authentication encryption
  • Trading ? provide Yellow Pages for objects
    (publicize/bid)

82
CORBA Object Services (ref)
  • Database related services
  • Persistence ? store objects on persistent storage
  • Concurrency Control ? lock management
  • Transaction ? Two phase commit coordination
  • Externalization ? object data ? byte streams
  • Properties ? assign properties (name-value pairs)
    to objects
  • Relationship ? construct different relations
    between objects
  • Query ? make queries against collections of
    objects, based on SQL and Object Query Language
    (OQL)

83
CORBA Event Services
  • Standard CORBA method invocations
  • Synchronous execution of an operation provided by
    server object
  • Both requestor (client) and provider (server)
    must be present
  • Client blocks until operation returns
  • Only supports uni-cast communication
  • COBRA event service interfaces enable decoupled,
    asynchronous communication between objects
  • based on the "publish/subscribe" paradigm
  • asynchronous communication with multiple
    suppliers and consumers
  • useful for more sophisticated types of event
    services, e.g., altering and event correlation

84
Advantages of OMG Event Service
  • Anonymous consumers/suppliers - Publish and
    subscribe model
  • Group communication - supplier(s) to consumer(s)
  • Decoupled communication - asynchronous delivery
  • Abstraction for distribution - can help draw the
    lines of distribution in the system
  • Abstraction for concurrency - facilitate
    concurrent event handling

85
CORBA Service Participants
  • The OMG event service defines three roles
  • The Supplier role - Suppliers generate event data
  • The Consumer role - Consumers process event data
  • Event Channel - mediator that encapsulates the
    queueing and propagation semantics
  • Event data are communicated between suppliers and
    consumers by issuing standard CORBA (two-way)
    requests
  • Standard CORBA naming and object activation
    mechanisms can also be used
  • 2 general approaches for initiating event
    communication between suppliers consumers

86
Push Event Model
  • supplier of events to initiate the transfer of
    the event data to consumers
  • supplier takes the initiative

87
Pull Event Model
  • allows a consumer of events to request event data
    from a supplier
  • consumer takes the initiative

88
Event Channel Model
  • An event channel is an object that allows
    multiple suppliers to communicate with multiple
    consumers in a highly decoupled, asynchronous
    manner
  • Both a consumer and supplier of event
  • Event broadcast repeater or buffer or proxy

89
Event Channels Mechanisms
90
Communications in Event Channel
  • Push Style in Event Channel
  • Supplier pushes event data to an event channel
  • The event channel, in turn, pushes event data to
    all consumers
  • An event channel need not make any complex
    routing decision, e.g., it can simply deliver the
    data to all consumers
  • More complex semantics possible
  • Push Style in Event Channel
  • The consumer pulls event data from the event
    channel
  • The event channel, in turn, pulls event data from
    the suppliers
  • Can be optimized by adding a queuing mechanism
  • Mixed Style
  • An event channel can communicate with a supplier
    using one style of communication, and communicate
    with a consumer using a different style of
    communication

91
Multiple Consumers / Suppliers
  • An event channel may provide many-to-many
    communication
  • The channel consumes events from one or more
    suppliers, and supplies events to one or more
    consumers
  • Subject to the quality of service of a particular
    implementation, an event channel provides an
    event to all consumers
  • An event channel can support consumers and
    suppliers that use different communication models

92
CORBA Service Classes
93
Event Service (Push/Pull/Proxy)
proxy push supplier
disconnect_push_supplier( )
push( )
proxy push consumer
Push supplier
Push consumer
Event Channel
pull( ), try_pull( )
proxy pull consumer
Pull consumer
Pull supplier
proxy pull supplier
94
Event Service (Push Mode) (ref)
  • IDL implemented by the PushConsumer
  • interface PushConsumer
  • void push (in any data)
  • void disconnect_push_consumer ()
  • supplier communicates event data to the consumer
    by invoking the push operation on an object
    reference and passing the event data as a
    parameter
  • disconnect_push_consumer terminates event
    communication and releases resources
  • IDL implemented by the PushSupplier
  • interface PushSupplier
  • void disconnect_push_supplier( )
  • disconnect_push_supplier terminates event
    communication and releases resources

95
Event Service (Push Mode) (ref)
  • At PushSupplier
  • // locate the consumer proxy of the event channel
  • CosEventCommPushConsumer_var conproxy /
    /
  • any a
  • long x
  • x / codes to assign a value to x /
  • a ltlt x
  • conproxy-gtpush(a)
  • ...

96
Trader Service
Trader
ORB
2 Import Service
1 Export Service
Consumer
Supplier
ORB
ORB
3 Invoke Service
97
A Trader Scenario
Register
ServiceTypeRepository
Server
Client
Lookup
add_type
export
list_types
describe_type
query
Invoke method
Trader
Write a Comment
User Comments (0)
About PowerShow.com