Microsoft .NET Remoting provides a framework that allows objects to interact with one another across application domains. The framework provides a number of services, including activation, lifetime support, and communication channels responsible for transporting messages to and from remote applications. Formatters are used for encoding and decoding the messages before they are transported by the channel. Applications can use binary encoding where performance is critical or XML encoding where interoperability with other frameworks that provide similar functionality is essential. One method of encoding is to use XML, which uses the SOAP protocol when transporting messages from one application domain to the other. It was designed with security in mind, and a number of hooks are provided that allow channel sinks to gain access to the messages and serialized stream before the stream is transported over the channel. Attempting to manage the lifetime of remote objects without support from the underlying framework is often cumbersome, so .NET Remoting provides a number of activation models to choose from. These models fall into two categories:
Client-activated objects are under the control of a lease-based lifetime manager that ensures the object is garbage collected when its lease expires. In the case of server-activated objects, developers have a choice of selecting either a "single call" or "singleton" model. The lifetime of singletons are also controlled by lease-based lifetime. The Java EE .NET interoperability solutions described in this chapter use .NET Remoting for integration. The solutions described in this chapter include
|