Summary


The SQL-NS Hosting API can be used to build custom applications that host the SQL-NS execution engine. When hosted in a custom application, the engine behaves the same way it does when running in the SQL-NS Windows service. Hosting the engine provides an opportunity to consolidate the running components of a SQL-NS instance into an existing application process.

The Hosting API consists of members of the NSInstance class. Methods for starting and stopping the engine are provided, along with a property that returns the current state of the engine, and an event used to signal fatal errors. In the hosting application's code, you create an NSInstance object for a particular SQL-NS instance and call the StartInstance() and StopInstance() methods as appropriate. You can also attach an event handler delegate to the Error event, to handle fatal errors in the engine's execution.

This chapter explains the semantics of the hosting API in general and then explores its use in the context of a sample application. This sample application serves as a generic engine host for any SQL-NS instance. Its source code illustrates the essential coding patterns involved in building hosting applications. Instructions in this chapter explain how to use the sample application to host the engine for one of the sample SQL-NS instances developed in a previous chapter.




Microsoft SQL Server 2005 Notification Services
Microsoft SQL Server 2005 Notification Services
ISBN: 0672327791
EAN: 2147483647
Year: 2006
Pages: 166
Authors: Shyam Pather

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net