Independent call object and independent object

Source: Internet
Author: User

Both types are server-activated objects.

 

<? XML version = "1.0" encoding = "UTF-8"?>
<Configuration>
<System. runtime. remoting>
<Application name = "simpleserver">
<Service>
<Wellknown mode = "singlecall" type = "simremote1.remoteobject, simremote1" objecturi = "remoteobject">
</Service>
<Channels>
<Channel ref = "TCP server" Port = "8080"/>
</Channels>
</Application>
</System. runtime. remoting>
</Configuration>

Client configuration file

<? XML version = "1.0" encoding = "UTF-8"?>
<Configuration> <system. runtime. remoting>
<Application name = "simpleclient">
<Client URL> // The original <client url = "TCP: // localhost: 8080/simpleserver">
// <Activated type = "simremote1.remoteobject, simremote1"/>
<Wellknown type = "simremote1.remoteobject, simremote1" url = "TCP: // localhost: 8080/simpleserver/remoteobject"/>
</Client>
<Channels>
<Channel ref = "tcp client"/>
</Channels>
</Application>
</System. runtime. remoting>
</Configuration>

An independent call object is created when the call starts and released when the call ends. Ensure that valuable memory is not occupied for a long time. The client can retain reference to the object proxy at any time. The proxy creates a remote object based on each call.

The called object is stateless.

For example, create a server object to read a large amount of data from the database and provide aggregated information to the client (the client may use a slow Internet connection, and the raw data is very large .), In this case, you need a client object or a separate object to obtain data. Otherwise, you must query the database again for each remote object called by the method.

 

Independent object

A single object is in the same state as a client activation object. But it is created by a server.

Mode = "Singleton"

The client configuration of a single object is the same as that of a single called object.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.