CHAPTER 18 594 THE .NET REMOTING LAYER (Web server logs)
CHAPTER 18 594 THE .NET REMOTING LAYER Figure 18-6. The default lease information for CarProvider itfLease.RenewOnCallTime.Seconds); Console.WriteLine(); } } Now that you have this helper type in place, assume LeaseInfo.LeaseStats() is called within the GetJBCByIndex() and GetAllAutos() methods of the CarProvider type. Once you recompile the server and client assemblies (again, simply to ensure Visual Studio 2005 copies the latest and greatest version of the CarGeneralAsm.dll to the client and server application directories), run the application once again. Your server s console window should now look something like Figure 18-6. Altering the Default Lease Characteristics Obviously, the default lease characteristics of a CAO/WKO-singleton type may not be appropriate for each and every CAO or WKO-singleton remote object. If you wish to alter these default settings, you have two approaches: You can adjust the default lease settings using a server-side *.config file. You can programmatically alter the settings of a type s default lease by overriding members of the MarshalByRefObject base class. While each of these options will indeed alter the default lease settings, there is a key difference. When you make use of a server-side *.config file, the lease settings affect all objects hosted by the server process. In contrast, when you override select members of the MarshalByRefObject type, you are able to change lease settings on an object-by-object basis. To illustrate changing the default lease settings via a remoting *.config file, assume you have updated the server-side XML data with the following additional
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.