Skip to content

Commit 2659096

Browse files
committed
Cleaned up a tiny bit of the code around running with terracotta
1 parent fbc5c85 commit 2659096

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/main/java/org/sharrissf/sample/EhcacheSearchPlaying.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,23 @@ private void initializeCache() {
4141
Configuration cacheManagerConfig = new Configuration();
4242

4343
// ***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+
//
4547
// TerracottaClientConfiguration tcConfig = new
46-
// TerracottaClientConfiguration().url("localhost:9510");
48+
// TerracottaClientConfiguration()
49+
// .url("localhost:9510");
4750
// cacheManagerConfig.addTerracottaConfig(tcConfig);
51+
4852
// ***To Cluster With Terracotta***
4953

5054
cacheManagerConfig.addDefaultCache(new CacheConfiguration());
5155

5256
CacheConfiguration cacheConfig = new CacheConfiguration("test", -1)
5357
.eternal(true)
54-
// .terracotta(new TerracottaConfiguration()
58+
// ***To Cluster With Terracotta***
59+
// .terracotta(new TerracottaConfiguration())
60+
// ***To Cluster With Terracotta***
5561
;
5662
Searchable searchable = new Searchable();
5763
cacheConfig.addSearchable(searchable);
@@ -71,14 +77,12 @@ private void initializeCache() {
7177
.expression("value.getAddress().getState()"));
7278

7379
// 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()));
7982

8083
/*
8184
* If you want to initialize it via ehcache.xml it would look like this:
85+
*
8286
* <cache name="test" maxElementsInMemory="0" eternal="true"
8387
* overflowToDisk="false"> <searchable> <searchAttribute name="age"/>
8488
* <searchAttribute name="name"

0 commit comments

Comments
 (0)