1 / 15

CS 603 DCOM

CS 603 DCOM. April 5, 2002. DCOM – What is it?. Start with COM – Component Object Model Language-independent object interface Add interprocess communication. DCOM: Distributed COM. Looks like COM to the client Built on DCE RPC Extends to support full COM functionality. DCOM Architecture.

nay
Download Presentation

CS 603 DCOM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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. DCOM:Distributed COM • Looks like COM to the client • Built on DCE RPC • Extends to support full COM functionality

  4. DCOM Architecture

  5. Locating Objects:Activation • CoCreateInstance(Ex)(<CLSID>) • Interface pointer to uninitialized instance • Same as COM • CoiGetInstanceFromFile, FromStorage • Create new instance • CoGetClassObject(<CLSID>) • Factory object that creates objects of <CLSID> • 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\{<appid-guid>}] "RemoteServerName"="<DNS name>“ • Also store information in ActiveDirectory

  6. Example: Auction System • Registry on Client: REGEDIT4 [HKEY_CLASSES_ROOT\CLSID\{<CLSID_AuctionServer>}] "AppID"="{<APPID_AuctionServer>}" [HKEY_CLASSES_ROOT \APPID\{<APPID_AuctionServer>}] "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 hr=S_OK; IBindCtx* pBC=NULL; hr=CreateBindCtx(NULL, &pBC); if (SUCCEEDED(hr)) { DWORD dwEaten; IMoniker* pMoniker=NULL; // Create the moniker object. hr=MkParseDisplayName(pBC, L"file:\\\\dtwmkt\\mkt\\productx1\\salesQ496.xyz!Summary", &dwEaten, &pMoniker); if (SUCCEEDED(hr)) { // Connect, create and initialize if necessary. hr=pMoniker->BindToObject(pBC, NULL, IID_ISalesInfo, &pSales); if (SUCCEEDED(hr)) { // Perform the operation. pSales->Add( 1.1, "http://www/mkt/productx/budget.xyz") pSales->Release(); } pMoniker->Release(); } pBC->Release(); }

  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 IServerSecurity::ImpersonateClient()

  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. 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 DCOM vs. CORBA

More Related