Terracotta configuration file

Source: Internet
Author: User

1. <servers>
In the servers node, it is used to specify all servers in the servers array. The TC server uses the sub-node <DSO-port> to configure the service listening port to 9510, so that the TC client works in collaboration with the DSO mode.

2. <system> <configuration-model> development </configuration-model> </system>
Configure DSO as the Development Mode

3. <clients> <logs> terracotta/client-logs/pojo/chatter/% d </logs> </clients>
Tell DSO where to put the TC client log

4. <instrumented-classes> <include> <class-expression> demo. sharedqueue... * </class-expression> </include> </instrumented-classes>
The application requires these custom objects/classes to be shared. The subsequent declaration tells DSO what they need and when the application runs in DSO mode, then the instances of these classes
They will broadcast their changes in their own way.
When you plan to use a TC cluster for an application, a good method (and an MVC pattern) is to group all the classes under a package, this write method will change the list of tool classes.
Very concise.

<Instrumented-classes> <include> <class-expression> demo. chatter. chatmanager </class-expression> The chatmanager class has been shared. However, if some fields in this class are described as "transient", you should still maintain the characteristics of the "transient" field. By setting The value is not available between instances of different applications. Only Local Application Instances can create, read, and write these fields.
In the chatmanager class, most of the members ("transient" and others) are instantiated Based on the Creation. However, when DSO finds that an application object on the server is available, other application objects can only be referenced by that application, and its constructor does not
Called, the "transient" field will not be initialized at this point, so <On-load> is used to declare that when DSO loads an object from the server, this class is the operation that needs to be taken away.

5. <distributed-methods> <method-expression> void demo. chatter. chatmanager. sendnewmessageevent (...) </method-expression> </distributed-methods>
This method is a root object. This configuration can successfully make the call be stored in any application instance.

6. <transient-fields> <field-Name> demo. includeditor. Models. objectmanager. Listener </field-Name> </transient-fields>
This field belongs to the root object, so that these fields are "transient", so that these values can only be available locally.

7. <autolock> <method-expression> * demo. sharedqueue. *. * (...) </method-expression> </autolock>
This method (obtained from a local object) operates on an object that has been declared as shared. This part tells DSO that when these objects are called, it is assumed that a persistent lock is applied to them. In fact, this part declares that
The method found in the 'demo. sharedqueue. main' class. All method assumptions in this class need to be locked.

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.