You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directmemory.apache.org by ol...@apache.org on 2012/06/18 01:24:47 UTC

svn commit: r1351180 - in /incubator/directmemory/trunk/src/site: apt/simple-usage.apt.vm site.xml

Author: olamy
Date: Sun Jun 17 23:24:46 2012
New Revision: 1351180

URL: http://svn.apache.org/viewvc?rev=1351180&view=rev
Log:
add a simple usage page to use CacheService

Added:
    incubator/directmemory/trunk/src/site/apt/simple-usage.apt.vm   (with props)
Modified:
    incubator/directmemory/trunk/src/site/site.xml

Added: incubator/directmemory/trunk/src/site/apt/simple-usage.apt.vm
URL: http://svn.apache.org/viewvc/incubator/directmemory/trunk/src/site/apt/simple-usage.apt.vm?rev=1351180&view=auto
==============================================================================
--- incubator/directmemory/trunk/src/site/apt/simple-usage.apt.vm (added)
+++ incubator/directmemory/trunk/src/site/apt/simple-usage.apt.vm Sun Jun 17 23:24:46 2012
@@ -0,0 +1,67 @@
+ ------
+ DirectMemory Simple Usage
+ ------
+ 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
+
+DirectMemory Simple Usage
+
+
+  Add a dependency to the DirectMemory cache artifact:
+
++------------------------
+  <dependency>
+    <groupId>org.apache.directmemory.server</groupId>
+    <artifactId>directmemory-cache</artifactId>
+    <version>${project.version}</version>
+  </dependency>
++------------------------
+
+  Create your CacheService instance:
+
++------------------------
+  CacheService<Object, Object> cacheService = new DirectMemory<Object, Object>()
+    .setNumberOfBuffers( 10 )
+    .setSize( 1000 )
+    .setInitialCapacity( 100000 )
+    .setConcurrencyLevel( 4 )
+    .newCacheService();
++------------------------
+
+  Use the cache service to store object:
+
++------------------------
+  put( K key, V value )
+  put( K key, V value, int expiresIn )
+
+  Those methods returns a Pointer if this pointer is null your object has been stored
++------------------------
+
+  Retrieve an Object from the cache service:
+
++------------------------
+  V retrieve( K key );
++------------------------
+

Propchange: incubator/directmemory/trunk/src/site/apt/simple-usage.apt.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/directmemory/trunk/src/site/apt/simple-usage.apt.vm
------------------------------------------------------------------------------
    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=1351180&r1=1351179&r2=1351180&view=diff
==============================================================================
--- incubator/directmemory/trunk/src/site/site.xml (original)
+++ incubator/directmemory/trunk/src/site/site.xml Sun Jun 17 23:24:46 2012
@@ -48,6 +48,7 @@
 
     <menu name="Apache DirectMemory">
       <item name="About"                      href="index.html"/>
+      <item name="Simple Usage"               href="simple-usage.html"/>
       <item name="Server"                     href="server.html"/>
       <item name="Server Instance"            href="server-instance.html"/>
       <item name="EHCahce integration"        href="ehcache-integration.html"/>