|
| 1 | +/* License added by: GRADLE-LICENSE-PLUGIN |
| 2 | + * |
| 3 | + * Copyright (C) 2012 Shawn Hartsock <[email protected]> |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | + |
1 | 18 | package com.pssd.cache;
|
2 | 19 |
|
3 | 20 | import com.pssd.cache.errors.ConfigurationFoundButNotAccessableException;
|
|
13 | 30 | import java.util.LinkedList;
|
14 | 31 |
|
15 | 32 | /**
|
16 |
| - * The basic idea here is to build caches based on objects. |
| 33 | + * The basic idea here is to build caches based on objects. You would assemble a POJO that was appropriate for use |
| 34 | + * as a key in a hash. This would be an object that held all the salient variables for the method. Then you back off |
| 35 | + * your particular method into an anonymous inner class implementing the CacheableFunction interface. |
| 36 | + * <p/> |
| 37 | + * In the testing directory, the class SimpleCacheUser shows one of the simplest ways to use this Caching API. |
17 | 38 | * <p/>
|
18 | 39 | * @author Shawn Hartsock
|
19 | 40 | */
|
20 | 41 | public class CacheFactory {
|
21 | 42 | /**
|
22 | 43 | * The singleton owner of caches in this system.
|
23 | 44 | */
|
24 |
| - final static CacheManager cacheManager = new CacheManager(); |
| 45 | + final static CacheManager cacheManager = new CacheManager(); //TODO: allow configuration from XML in classpath |
25 | 46 |
|
26 | 47 | /**
|
27 | 48 | * builds a CacheConfiguration object based on properties
|
@@ -190,3 +211,4 @@ private static Object put(final Ehcache cache, final Object parameter, final Cac
|
190 | 211 | return result;
|
191 | 212 | }
|
192 | 213 | }
|
| 214 | + |
0 commit comments