tc-config.xml (Client)
 
 001:  <?xml version="1.0" encoding="UTF-8"?>
 002:  <!--
 003:  
 004:    All content copyright (c) 2003-2008 Terracotta, Inc.,
 005:    except as may otherwise be noted in a separate copyright notice.
 006:    All rights reserved.
 007:  
 008:  -->
 009:  <tc:tc-config xmlns:tc="http://www.terracotta.org/config"
 010:    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 011:    xsi:schemaLocation="http://www.terracotta.org/schema/terracotta-4.xsd">
 012:    <!-- Server is colocated with client and DSO is listening on
 013:         default port (9510). -->
 014:    <servers>
 015:      <server host="%i" name="sample"/>
 016:      <update-check>
 017:        <enabled>true</enabled>
 018:      </update-check>
 019:    </servers>
 020:  
 021:    <!-- Tell DSO where to put the generated client logs.
 022:         See the Terracotta Configuration Guide and Reference for additional
 023:         information. -->
 024:    <clients>
 025:      <logs>terracotta/client-logs/pojo/coordination/%D</logs>
 026:      <statistics>terracotta/client-statistics/pojo/coordination/%D</statistics>
 027:    </clients>
 028:  
 029:    <application>
 030:      <dso>
 031:        <!-- Our app requires these custom objects/classes to be shared - the following declarations
 032:             tells DSO which ones they are. When the app runs under DSO, instances of these classes
 033:             will broadcast changes in their state.
 034:  
 035:             A good idiom when writing an app that you intend to cluster via TC DSO, is to group the 
 036:             classes you wish to share under a single package (although if you follow the MVC pattern
 037:             this tends to happen naturally) - this way the list of classes you wish to instrument
 038:             can be concise -->
 039:        <instrumented-classes>
 040:          <include>
 041:            <class-expression>*..*</class-expression>
 042:          </include>
 043:        </instrumented-classes>
 044:  
 045:        <!-- These methods (originating from local objects) operates on objects declared as shared. This 
 046:             section tells DSO to assume a lock on those objects for the duration of the call; essentially this
 047:             section declares that all methods found for all classes found for all packages should assume the 
 048:             behavior described -->
 049:        <locks>
 050:          <autolock>
 051:            <method-expression>* *..*.*(..)</method-expression>
 052:          </autolock>
 053:        </locks>
 054:  
 055:        <!-- We declare the following fields a root, making it 
 056:             available for all instances of our app that runs via DSO -->
 057:        <roots>
 058:          <root>
 059:            <field-name>demo.coordination.Main.enterBarrier</field-name>
 060:          </root>
 061:          <root>
 062:            <field-name>demo.coordination.Main.exitBarrier</field-name>
 063:          </root>
 064:        </roots>
 065:      </dso>
 066:    </application>
 067:  </tc:tc-config>