01: package com.whirlycott.cache;
02:
03: /*
04:
05: Licensed under the Apache License, Version 2.0 (the "License");
06: you may not use this file except in compliance with the License.
07: You may obtain a copy of the License at
08:
09: 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: */
18:
19: /**
20: * Represents the configuration for an individual Cache object.
21: *
22: * @author <a href="mailto:peter.royal@pobox.com">peter royal</a>
23: */
24: public class CacheConfiguration {
25:
26: /**
27: * The backend implementation of ManagedCache that this cache will use.
28: */
29: private String backend;
30:
31: /**
32: * The maximum number of elements that can be in this cache. This is a soft limit.
33: */
34: private int maxSize;
35:
36: /**
37: * The name of the cache.
38: */
39: private String name;
40:
41: /**
42: * The eviction policy that this cache will use.
43: */
44: private String policy;
45:
46: public CacheConfiguration() {
47: }
48:
49: public CacheConfiguration(String name, int maxSize) {
50: this .maxSize = maxSize;
51: this .name = name;
52: }
53:
54: public String getBackend() {
55: return backend;
56: }
57:
58: public void setBackend(final String backend) {
59: this .backend = backend;
60: }
61:
62: public int getMaxSize() {
63: return maxSize;
64: }
65:
66: public String getName() {
67: return name;
68: }
69:
70: public void setMaxSize(final int maxSize) {
71: this .maxSize = maxSize;
72: }
73:
74: public void setName(final String name) {
75: this .name = name;
76: }
77:
78: public String getPolicy() {
79: return policy;
80: }
81:
82: public void setPolicy(String policy) {
83: this.policy = policy;
84: }
85: }
|