Home Page Icon
Home Page
Table of Contents for
III. Appendixes
Close
III. Appendixes
by Gregory Brill
Applying COM+
Copyright
About the Author
About the Technical Reviewers
Acknowledgments
Tell Us What You Think
Introduction
Who Will Benefit From This Book?
Who Is This Book Not For?
Organization of This Book
I. COM Basics
1. COM+: An Evolution
COM+ and the Declarative Model
The Difference Between COM and COM+
Fundamental Principles of COM and COM+
The Theoretical Reason for Interfaces
The Practical Reason for Interfaces
RPC: The Origin of COM Interfaces?
Interface Definition Language
Compiling the IDL File
What Does COM Have to Do with RPC?
From Traditional RPC to COM and COM+
IDL: the Beginning or the End?
COM Objects in Visual C++
The coclass
Implementing the coclass in in C++
Visual Basic
Finding Registered Type Libraries
The The Library Block
Interface Block, Revisited
Inheriting from IDispatch
Method Declarations
Summary
2. COM Fundamentals
The Role of IUnknown
Release()
Implementing Release()
AddRef()
Guidelines for Reference Counts and Object Lifetime
QueryInterface()
Using QueryInterface()
Where Does COM Live?
Dynamic Link Libraries (DLLs)
Type Libraries and Resources
The Registry and Self-Registration
A COM+ Variation—Surrogate Processes
Summary
3. COM Internals
Virtual Function Tables (vtables), Abstract Base Classes, and Polymorphism
Interfaces as Abstract Base Classes
Polymorphism in Practice
Writing COM Objects in C++
Internal Structure of a Vtable
The ICalc and IFinancial Vtables and Their Relation to COMCalc
C++ Clients
Problems with the Fundamental Tenet of COM
Putting It All Together (RPC, DLL, Type Libraries, vtables)
COMCalc C++ Example
Specifying GUIDs in Code
Inheriting from IUnknown
STDMETHOD, STDMETHODIMP, and Method Implementation
Multiple Inheritance
Implementation of QueryInterface()
Class Factories
Class Factories, IClassFactory, and Other Interfaces
IClassFactory's CreateInstance() Method
Global Scope for Class Factories
The Win32 CoGetClassObject() Method
Summary
II. COM+ Components and Services
4. Threading and Apartment Models
Threads and Processes
Race Conditions and Threading Issues
Apartments
Message Queues as Synchronization Aides
Threads and Objects
Serialization Through Message Queues
Enter The Apartment
Single-Threaded Apartments (STA)
Multi-Threaded Apartments (MTA)
Protecting the STA with Message Queues
Marshaling Interfaces
Global Interface Table (GIT) Marshaling
Moving Interfaces Between Processes
Marshaling Interfaces the Hard Way
Declaring Apartments
The Free-Threaded Marshaler (FTM)
The Thread Neutral Apartment (TNA)
Summary
5. Method Invocation and Marshaling
Type Library Marshaling
Late Binding
The Architecture of Late Binding
Invoke Arguments and Marshaling
The Variant
What Can a Variant Hold?
Invoking a Method on IDispatch
Late Binding, Type Libraries, and the Tale of IDispatch
Object Definition Language (ODL) Files
Dispinterfaces
Dual Interfaces
Late Binding, Marshaling, and the oleautomation Tag
J++ and Dual Interfaces
Supporting Dual or Custom Interfaces in J++
Examining the Wrapper
Summary
References
6. The COM+ Catalog
From INI Files to the Registry to the Catalog
Configured Components and COM+ Applications
General COM+ Applications
Installing or Creating a New Application
Application Identity
Importing versus Installing Components
Automating Configuration
The COM+ Administration Objects Properties
Introducing the COM+ Administration Objects
Using the Administrative Objects
A Quick Tour: Pre-Installed COM+ Applications
COM+ QC Dead Letter Queue Listener
COM+ Utilities
IIS In-Process Applications and IIS Out-Of-Process Pooled Applications
IIS Utilities
System Application
Visual Studio APE Package
CRCs: A Snooper's Best Friend
Summary
7. Contexts
Introducing IObjectContext
COM and MTS Integration
COM and MTS Merge
Context: Two Different Definitions
Context: The Concept
COM Context Implementation
Interception
Contexts, Apartments and the Free Threaded Marshaler
Understanding and Using the Context Interfaces
IObjectContextInfo
ISecurityCallContext
IGetContextProperties
Summary
8. Transactions
ROLLBACK and COMMIT
Classical Transactions and Traditional Databases
Atomicity
Consistency
Isolation
Durability
A Transaction Scenario
The BEGIN TRANSACTION and COMMIT TRANSACTION Commands
Distributed Transactions
The DTC
Escrow and the Two-Phase Commit
The Two-Phased Commit Protocol
System Failure and Reconciliation
Microsoft's DTC: The Reality
Using Raw DTC to Coordinate Transactions Across Multiple Databases
Differences in Transaction Enlistment
Transaction Enlistment by Pooled Objects
Summary of Distributed Transactions and the DTC
COM+ Transactions
COM+ Transaction Declarative Settings
RDs: A First Look
COM+ Transaction Behavior: Voting
Base Clients, Voting, and the TransactionContext Object
The Methods of IObjectContext
CreateInstance: A Legacy Method
Basic Voting and Associated Methods
Basic Informational Methods
Finer Granularity Control with IContextState
Transactions, ASP Pages, and IIS
Summary
9. Compensating Resource Managers
The Resource Manager
Components of the CRM
Worker
The CRMClerk
Compensator
Phase I: Prepare
Step 1: General Prepare
Step 2: Prepare to Make Changes for Each Log Entry
Step 3: Finalize Changes
Phase II: Commit
Step 1: Prepare to Commit
Step 2: Make Changes for Each Log Entry
Step 3: Commit Changes
Aborting Transactions
Step 1: Prepare to Abort
Step 2: Undo Each Log Entry
Step 3: Finalizing Abortion
Handling Recovery
When In Doubt
The Complete Compensator
CRMs and Isolation
Summary
10. Queued Components
The Mystery of the Hanging News Feeder
Introducing Microsoft Message Queue
MSMQ as Middleware
MSMQ Sender Implementation
Creating and Opening a Queue
Sending the Message
MSMQ Receiver Implementation
Receiving a Message
Closing and Deleting a Queue
From MSMQ to COM+ Queued Components
Asynchronous Methods Calls with Queued Components
The Queued Components Abstraction: Introducing the Player, Listener, and Recorder
Creating a Queued Object Using a Moniker
The Recorder
The Player
Writing Queueable Objects
Queueable Settings for the Application
QC Internals
Disabling Security
Viewing Method Calls as Messages
Playing the Messages
Transactional and Non-Transactional Queues
The Different Queue Types: Private and Public
Interoperability Between MSMQ and QC
Manually Reading the Message
Persistence: Passing Objects Through Messages
Notification and Callbacks
Exception Classes
Callbacks and Events
Some Subtle Requirements for QC: Parallel Application Configurations Required for Sender and Receiver
Asynchronous COM
Asynchronous COM Implementation
Asynchronous COM Drawbacks
Summary
11. Events
Traditional COM Events
The Doubtful Future of Connection Points
The COM+ Event Model: Publisher and Subscriber
The Event Class
Creating an Event Class
Writing and Installing an Event Class
Subscriptions
Firing Synchronous and Asynchronous Events
Queued Event Classes versus Queued Subscribers
Event Filtering
Publisher Filters
Associating Publisher Filters with Event Classes
COM+ Administration Objects
Explicit Association of Publisher Filters by Clients
Implementing Publisher Filters
Initialize
PrepareToFire
Publisher Strategies
Publisher Properties
Evaluating Method Arguments
Summary
12. Security
Declarative Security
Entering Users in a Role
Granting Permissions to a Role
Configuring and Programming Security
Programming Security
ISecurityCallContext
Application Identity
Security Boundaries
Impersonation
Delegation
Cloaking
Authentication
Configuring Impersonation, Delegation, and Authentication
Lower Level Security
The CoInitializeSecurity Function
The CoSetProxyBlanket() Function
Lower Level Security, Roles and Cloaking: Bringing It All Together
Summary
III. Appendixes
A. ADO and OLE-DB
ODBC versus OLE-DB
Using ADO in COM+
ADO Examples
B. COM+ Synchronization Through Activities
Configuration
Activities and Transactions
C. Object Pooling
D. Passing Block Data, SAFEARRAYs
E. Queue Moniker Parameters
Parameters That Affect the Destination Queue
FormatName
PathName
ComputerName and QueueName
Parameters That Affect the MSMQ Message
AppSpecific
AuthLevel
Delivery
EncryptAlgorithm
HashAlgorithm
Journal
Label
MaxTimeToReachQueue
MaxTimeToReceive
Priority
PrivLevel
Trace
F. Application Proxies
Installing Application Proxies on NT 4
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
12. Security
Next
Next Chapter
A. ADO and OLE-DB
Part III. Appendixes
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset