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/spring/jmx/%D</logs>
 026:      <statistics>terracotta/client-statistics/spring/jmx/%D</statistics>
 027:    </clients>
 028:  
 029:    <application>
 030:      <!-- See the Terracotta Spring Guide for more details of the the <spring/> 
 031:           section of the  tc-config file -->
 032:      <spring>
 033:        <!-- Tell DSO about the webapp we're sharing -->
 034:        <jee-application name="jmx">
 035:          <application-contexts>
 036:            <application-context>
 037:              <!-- Tell DSO the location of the bean definition file for this 
 038:                   application context -->
 039:              <paths>
 040:                <path>*/applicationContext.xml</path>
 041:              </paths>
 042:              <!-- Here we're telling DSO about the list of Spring beans that we
 043:                   we wish to share -->
 044:              <beans>
 045:                <bean name="clusteredCounter" />
 046:                <bean name="clusteredHistory" />
 047:              </beans>
 048:            </application-context>
 049:          </application-contexts>
 050:  
 051:          <!-- Our app requires these custom objects/classes to be shared - the following declarations
 052:               tells DSO which ones they are. When the app runs under DSO, instances of these classes
 053:               will broadcast changes in their state.
 054:  
 055:               A good idiom when writing an app that you intend to cluster via TC DSO, is to group the 
 056:               classes you wish to share under a single package (although if you follow the MVC pattern
 057:               this tends to happen naturally) - this way the list of classes you wish to instrument
 058:               can be concise -->
 059:          <instrumented-classes>
 060:            <include>
 061:              <!-- Here, we say, instrument the 'demo.jmx.HistoryData' class -->
 062:              <class-expression>demo.jmx.HistoryData</class-expression>
 063:            </include>
 064:          </instrumented-classes>
 065:        </jee-application>
 066:      </spring>
 067:    </application>
 068:  </tc:tc-config>