View Javadoc

1   package org.apache.jcs.auxiliary.disk.jdbc;
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  import org.apache.jcs.auxiliary.AuxiliaryCache;
23  import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
24  import org.apache.jcs.auxiliary.AuxiliaryCacheFactory;
25  import org.apache.jcs.engine.behavior.ICompositeCacheManager;
26  
27  /***
28   * This factory should create mysql disk caches.
29   * <p>
30   * @author Aaron Smuts
31   */
32  public class JDBCDiskCacheFactory
33      implements AuxiliaryCacheFactory
34  {
35      private String name = "JDBCDiskCacheFactory";
36  
37      /***
38       * This factory method should create an instance of the mysqlcache.
39       */
40      public AuxiliaryCache createCache( AuxiliaryCacheAttributes rawAttr, ICompositeCacheManager arg1 )
41      {
42          JDBCDiskCacheManager mgr = JDBCDiskCacheManager.getInstance( (JDBCDiskCacheAttributes) rawAttr );
43          return mgr.getCache( (JDBCDiskCacheAttributes) rawAttr );
44      }
45  
46      /***
47       * The name of the factory.
48       */
49      public void setName( String nameArg )
50      {
51          name = nameArg;
52      }
53  
54      /***
55       * Returns the display name
56       */
57      public String getName()
58      {
59          return name;
60      }
61  }