Author: olamy
Date: Sat Jun 16 14:28:10 2012
New Revision: 1350931
URL: http://svn.apache.org/viewvc?rev=1350931&view=rev
Log:
document ehcache integration
Added:
incubator/directmemory/trunk/src/site/apt/ehcache-integration.apt (with
props)
Modified:
incubator/directmemory/trunk/src/site/site.xml
Added: incubator/directmemory/trunk/src/site/apt/ehcache-integration.apt
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/src/site/apt/ehcache-integration.apt?rev=1350931&view=auto
==============================================================================
--- incubator/directmemory/trunk/src/site/apt/ehcache-integration.apt (added)
+++ incubator/directmemory/trunk/src/site/apt/ehcache-integration.apt Sat Jun
16 14:28:10 2012
@@ -0,0 +1,63 @@
+ ------
+ EHCache Integration
+ ------
+ Olivier Lamy
+ ------
+ 2012-06-17
+ ------
+
+~~ Licensed to the Apache Software Foundation (ASF) under one
+~~ or more contributor license agreements. See the NOTICE file
+~~ distributed with this work for additional information
+~~ regarding copyright ownership. The ASF licenses this file
+~~ to you under the Apache License, Version 2.0 (the
+~~ "License"); you may not use this file except in compliance
+~~ with the License. You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing,
+~~ software distributed under the License is distributed on an
+~~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+~~ KIND, either express or implied. See the License for the
+~~ specific language governing permissions and limitations
+~~ under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+EHCache Integration
+
+ You can mix the use of the ehcache framework with DirectMemory. Recent
versions of ehcache have some features to store elements
+ in a heap off storage when overflow a number of objects or bytes in heap
cache.
+
+
+ First you need to declare dependency to the DirectMemory ehcache integration:
+
++------------------------
+ <dependency>
+ <groupId>org.apache.directmemory</groupId>
+ <artifactId>directmemory-ehcache</artifactId>
+ <version>0.1</version>
+ </dependency>
++------------------------
+
+ Note the heap off cache class to use is not currently configurable in
ehcahce see issue
{{{https://jira.terracotta.org/jira/browse/EHC-940}https://jira.terracotta.org/jira/browse/EHC-940}}.
+ So Apache DirectMemory contains same package/class name as needed by ehcache.
+
+ Activate the feature in ehcache:
+
++------------------------
+ CacheConfiguration cacheConfiguration = new CacheConfiguration();
+ cacheConfiguration.setName( "foo" );
+
+ cacheConfiguration.setOverflowToOffHeap( true );
+
+ cacheConfiguration.setMaxBytesLocalHeap( Long.valueOf( 100 * 1024 * 1024 ) );
+ cacheConfiguration.setMaxBytesLocalOffHeap( Long.valueOf( 100 * 1024 * 1024
) );
+
+ Cache cache = new Cache( cacheConfiguration );
+ CacheManager.getInstance().addCache( cache );
++------------------------
+
+
Propchange: incubator/directmemory/trunk/src/site/apt/ehcache-integration.apt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/directmemory/trunk/src/site/apt/ehcache-integration.apt
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: incubator/directmemory/trunk/src/site/site.xml
URL:
http://svn.apache.org/viewvc/incubator/directmemory/trunk/src/site/site.xml?rev=1350931&r1=1350930&r2=1350931&view=diff
==============================================================================
--- incubator/directmemory/trunk/src/site/site.xml (original)
+++ incubator/directmemory/trunk/src/site/site.xml Sat Jun 16 14:28:10 2012
@@ -52,6 +52,7 @@
<item name="Committer Environment"
href="committer-environment.html"/>
<item name="JIRA report" href="jira-report.html"/>
<item name="Changes report" href="changes-report.html"/>
+ <item name="EHCahce integration" href="ehcache-integration.html"/>
</menu>
<menu ref="reports" inherit="bottom"/>