@@ -41,17 +41,23 @@ private void initializeCache() {
41
41
Configuration cacheManagerConfig = new Configuration ();
42
42
43
43
// ***To Cluster With Terracotta***
44
- // cacheManagerConfig.addDefaultCache(new CacheConfiguration());
44
+ // add the ehcache-terracotta-ee jar to your class path and uncomment the
45
+ // code in the "To Cluster With Terracotta" sections
46
+ //
45
47
// TerracottaClientConfiguration tcConfig = new
46
- // TerracottaClientConfiguration().url("localhost:9510");
48
+ // TerracottaClientConfiguration()
49
+ // .url("localhost:9510");
47
50
// cacheManagerConfig.addTerracottaConfig(tcConfig);
51
+
48
52
// ***To Cluster With Terracotta***
49
53
50
54
cacheManagerConfig .addDefaultCache (new CacheConfiguration ());
51
55
52
56
CacheConfiguration cacheConfig = new CacheConfiguration ("test" , -1 )
53
57
.eternal (true )
54
- // .terracotta(new TerracottaConfiguration()
58
+ // ***To Cluster With Terracotta***
59
+ // .terracotta(new TerracottaConfiguration())
60
+ // ***To Cluster With Terracotta***
55
61
;
56
62
Searchable searchable = new Searchable ();
57
63
cacheConfig .addSearchable (searchable );
@@ -71,14 +77,12 @@ private void initializeCache() {
71
77
.expression ("value.getAddress().getState()" ));
72
78
73
79
// Coding your own extracter
74
- searchable
75
- .addSearchAttribute (new SearchAttribute ()
76
- .name ("name" )
77
- .className (
78
- "org.sharrissf.sample.EhcacheSearchPlaying$NameAttributeExtractor" ));
80
+ searchable .addSearchAttribute (new SearchAttribute ().name ("name" )
81
+ .className (NameAttributeExtractor .class .getName ()));
79
82
80
83
/*
81
84
* If you want to initialize it via ehcache.xml it would look like this:
85
+ *
82
86
* <cache name="test" maxElementsInMemory="0" eternal="true"
83
87
* overflowToDisk="false"> <searchable> <searchAttribute name="age"/>
84
88
* <searchAttribute name="name"
0 commit comments