View Javadoc

1   package org.apache.directmemory.conf;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  /**
23   * @since 0.2
24   */
25  public abstract class DefaultConfiguration
26      implements ConfigurationService
27  {
28      private int numberOfBuffers = 1;
29  
30      private int initialCapacity = 100000;
31  
32      private int ramMegaBytes = 1;
33  
34      private int concurrencyLevel = 4;
35  
36      private long disposalTime = 10L;
37  
38      @Override
39      public int getNumberOfBuffers()
40      {
41          return numberOfBuffers;
42      }
43  
44      @Override
45      public int getInitialCapacity()
46      {
47          return initialCapacity;
48      }
49  
50      @Override
51      public int getRamMegaBytes()
52      {
53          return ramMegaBytes;
54      }
55  
56      @Override
57      public int getConcurrencyLevel()
58      {
59          return concurrencyLevel;
60      }
61  
62      @Override
63      public long getDisposalTime()
64      {
65          return disposalTime;
66      }
67  
68      @Override
69      public void setNumberOfBuffers( int numberOfBuffers )
70      {
71          this.numberOfBuffers = numberOfBuffers;
72      }
73  
74      @Override
75      public void setInitialCapacity( int initialCapacity )
76      {
77          this.initialCapacity = initialCapacity;
78      }
79  
80      @Override
81      public void setRamMegaBytes( int ramMegaBytes )
82      {
83          this.ramMegaBytes = ramMegaBytes;
84      }
85  
86      @Override
87      public void setConcurrencyLevel( int concurrencyLevel )
88      {
89          this.concurrencyLevel = concurrencyLevel;
90      }
91  
92      @Override
93      public void setDisposalTime( long disposalTime )
94      {
95          this.disposalTime = disposalTime;
96      }
97  
98  }