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.