CS 603 DCOM - PowerPoint PPT Presentation

About This Presentation
Title:

CS 603 DCOM

Description:

Or default to server specified in DCOM configuration on client machine ... DCOM. Distinction between Class and Instance Identifier. Implement multiple interfaces ... – PowerPoint PPT presentation

Number of Views:86
Avg rating:3.0/5.0
Slides: 16
Provided by: clif8
Category:
Tags: dcom | dcom

less

Transcript and Presenter's Notes

Title: CS 603 DCOM


1
CS 603DCOM
  • April 5, 2002

2
DCOM What is it?
  • Start with COM Component Object Model
  • Language-independent object interface
  • Add interprocess communication

3
DCOMDistributed COM
  • Looks like COM to the client
  • Built on DCE RPC
  • Extends to support full COM functionality

4
DCOM Architecture
5
Locating ObjectsActivation
  • CoCreateInstance(Ex)(ltCLSIDgt)
  • Interface pointer to uninitialized instance
  • Same as COM
  • CoiGetInstanceFromFile, FromStorage
  • Create new instance
  • CoGetClassObject(ltCLSIDgt)
  • Factory object that creates objects of ltCLSIDgt
  • CoGetClassObjectFromURL
  • Downloads necessary code from URL and
    instantiates
  • Can take server name as parameter
  • Or default to server specified in DCOM
    configuration on client machine
  • HKEY_CLASSES_ROOT\APPID\ltappid-guidgt
  • "RemoteServerName""ltDNS namegt
  • Also store information in ActiveDirectory

6
Example Auction System
  • Registry on Client
  • REGEDIT4
  • HKEY_CLASSES_ROOT\CLSID\ltCLSID_AuctionServergt
  • "AppID""ltAPPID_AuctionServergt"
  • HKEY_CLASSES_ROOT \APPID\ltAPPID_AuctionServergt
  • "RemoteServerName""auctions.r.us.com"
  • Note APPID_AuctionServer can have the same
    value as CLSID_AuctionServer.
  • Client Code
  • IAuction Auction new AuctionService // Uses
    generated AuctionService.class file.
  • Auction.PlaceBid(1324, 100000.00)
  • // Auction object gets garbage collected.

7
Naming Monikers
  • Above examples name classes
  • What if you want a specific instance?
  • One option Each instance at a separate machine
  • Better Monikers
  • Naming object with standard IMoniker interface
  • Object creates Moniker and registers it with
    libraries
  • Monikers have URL as human-readable version

8
Moniker Example
  • HRESULT hrS_OK
  • IBindCtx pBCNULL
  • hrCreateBindCtx(NULL, pBC)
  • if (SUCCEEDED(hr))
  • DWORD dwEaten IMoniker pMonikerNULL
  • // Create the moniker object.
  • hrMkParseDisplayName(pBC, L"file\\\\dtwmkt\\mkt
    \\productx1\\salesQ496.xyz!Summary", dwEaten,
    pMoniker)
  • if (SUCCEEDED(hr)) // Connect, create and
    initialize if necessary.
  • hrpMoniker-gtBindToObject(pBC, NULL,
    IID_ISalesInfo, pSales)
  • if (SUCCEEDED(hr)) // Perform the operation.
  • pSales-gtAdd( 1.1, "http//www/mkt/productx/budg
    et.xyz")
  • pSales-gtRelease()
  • pMoniker-gtRelease()
  • pBC-gtRelease()

9
Invocation
  • Marshaling and unmarshaling
  • Built on top of DCE RPC standard
  • All parameters defined with IDL
  • Uses Interface ID to look up stubs / code for
    class in Registry
  • DCE extension Interface Pointers
  • Pointer to proxy object
  • Allows callee to invoke parameter
  • Call returns to source

10
Additional Issues
  • Garbage Collection
  • Reference count on distributed objects
  • Addref and Release called explicitly
  • Ping / timeout to handle client failure
  • Referrals
  • Interface pointer refers to handling machine
  • Passing interface pointer removes intermediate
    machine from call

11
DCOM Security
  • Access security
  • Who can call an object?
  • Launch security
  • Who can create a new object?
  • Identity
  • Who is responsible for an object?
  • Connection Policy
  • Integrity
  • Privacy
  • Authentication

12
DCOM Security
  • Servers/clients can customize security
  • CoInitializeSecurity API
  • Starts with default
  • Access security
  • COM-provided checks
  • User-specified checks using COM
    authentication/etc.
  • IServerSecurity, IClientSecurity interfaces
  • Kerberos for delegation
  • Proxy tickets allow delegation of specific
    authorities
  • Also full delegation
  • IServerSecurityImpersonateClient()

13
Delegation
14
Threads (Apartments)
  • Single Threaded
  • Call blocks
  • Single Thread apartment
  • One thread per instance
  • Multi-Threaded Apartment
  • Multiple threads in an instance
  • Combine both
  • Allows call from single and multi-threaded

15
DCOM vs. CORBA
  • CORBA
  • Single interface name
  • Multiple inheritance
  • Dynamic Invocation Interface
  • C-style Exception Handling
  • Explicit and Implicit reference counts
  • Implemented by ORB with replaceable services
  • DCOM
  • Distinction between Class and Instance Identifier
  • Implement multiple interfaces
  • Type libraries for on-demand marshaling
  • 32 Bit Error Code
  • Explicit reference count only
  • Implemented by many independent services
Write a Comment
User Comments (0)
About PowerShow.com