Skip to content

Commit fcf5a1c

Browse files
committed
Initial version. Tests are not passing yet.
1 parent f313462 commit fcf5a1c

16 files changed

+989
-0
lines changed

.gitignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*.iml
2+
/*.ipr
3+
/*.iws
4+
/.classpath
5+
/.idea
6+
/.project
7+
/.settings
8+
/ibderby
9+
/nb*
10+
/release.properties
11+
/target
12+
/test.db.lck
13+
/test.db.log
14+
/test.db.properties
15+
/test.db.script
16+
/test.db.tmp
17+
/src/docbkx
18+
velocity.log
19+
/bin

pom.xml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2010-2013 The MyBatis Team
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+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
19+
<modelVersion>4.0.0</modelVersion>
20+
21+
<parent>
22+
<groupId>org.mybatis</groupId>
23+
<artifactId>mybatis-parent</artifactId>
24+
<version>22</version>
25+
</parent>
26+
27+
<groupId>org.mybatis.caches</groupId>
28+
<artifactId>mybatis-redis</artifactId>
29+
<version>1.0.0-SNAPSHOT</version>
30+
<packaging>jar</packaging>
31+
32+
<name>mybatis-redis</name>
33+
<description>Redis support for MyBatis Cache</description>
34+
<url>https://github.com/mybatis/redis-cache</url>
35+
36+
<scm>
37+
<url>http://github.com/mybatis/redis-cache</url>
38+
<connection>scm:git:ssh://github.com/mybatis/redis-cache.git</connection>
39+
<developerConnection>scm:git:git+ssh://[email protected]/mybatis/redis-cache.git</developerConnection>
40+
<tag>HEAD</tag>
41+
</scm>
42+
<issueManagement>
43+
<system>GitHub Issue Management</system>
44+
<url>https://github.com/mybatis/redis-cache/issues</url>
45+
</issueManagement>
46+
<ciManagement>
47+
<system>Travis CI</system>
48+
<url>https://travis-ci.org/mybatis/redis-cache</url>
49+
</ciManagement>
50+
<distributionManagement>
51+
<site>
52+
<id>github</id>
53+
<url>gitsite:[email protected]/mybatis/redis-cache.git</url>
54+
</site>
55+
</distributionManagement>
56+
57+
<properties>
58+
<clirr.comparisonVersion>1.0.3</clirr.comparisonVersion>
59+
<findbugs.onlyAnalyze>org.mybatis.caches.redis.*</findbugs.onlyAnalyze>
60+
<gcu.product>Cache</gcu.product>
61+
</properties>
62+
63+
<dependencies>
64+
<!--
65+
| Provided dependencies
66+
-->
67+
<dependency>
68+
<groupId>org.mybatis</groupId>
69+
<artifactId>mybatis</artifactId>
70+
<version>3.2.8</version>
71+
<scope>provided</scope>
72+
</dependency>
73+
74+
<!--
75+
| compile dependencies
76+
-->
77+
<dependency>
78+
<groupId>redis.clients</groupId>
79+
<artifactId>jedis</artifactId>
80+
<version>2.6.2</version>
81+
<scope>compile</scope>
82+
</dependency>
83+
84+
<!--
85+
| trick to fix javadoc generation
86+
-->
87+
<dependency>
88+
<groupId>javax.transaction</groupId>
89+
<artifactId>transaction-api</artifactId>
90+
<version>1.1</version>
91+
<scope>provided</scope>
92+
</dependency>
93+
94+
<!--
95+
| test dependencies
96+
-->
97+
<dependency>
98+
<groupId>junit</groupId>
99+
<artifactId>junit</artifactId>
100+
<version>4.12</version>
101+
<scope>test</scope>
102+
</dependency>
103+
<dependency>
104+
<groupId>org.slf4j</groupId>
105+
<artifactId>slf4j-simple</artifactId>
106+
<version>1.7.10</version>
107+
<scope>test</scope>
108+
</dependency>
109+
</dependencies>
110+
111+
<build>
112+
<plugins>
113+
<plugin>
114+
<groupId>org.codehaus.mojo</groupId>
115+
<artifactId>cobertura-maven-plugin</artifactId>
116+
<executions>
117+
<execution>
118+
<goals>
119+
<goal>clean</goal>
120+
</goals>
121+
</execution>
122+
</executions>
123+
</plugin>
124+
</plugins>
125+
</build>
126+
127+
</project>

src/changes/changes.xml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2010-2014 The original author or authors.
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+
18+
<!--
19+
version: $Id: pom.xml 5144 2012-04-13 08:17:59Z simone.tripodi $
20+
-->
21+
<document xmlns="http://maven.apache.org/changes/1.0.0"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/changes/1.0.0 http://maven.apache.org/plugins/maven-changes-plugin/xsd/changes-1.0.0.xsd">
24+
<properties>
25+
<author>The MyBatis Team</author>
26+
<title>Changes</title>
27+
</properties>
28+
29+
<body>
30+
<release version="1.0.0-RC1" date="TBD" description="1.0.0-RC1 release">
31+
<action dev="simone.tripodi" type="update">
32+
First release canidate.
33+
</action>
34+
</release>
35+
</body>
36+
37+
</document>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright 2015 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.mybatis.caches.redis;
17+
18+
import redis.clients.jedis.JedisPoolConfig;
19+
20+
public class ConfigWithHost extends JedisPoolConfig {
21+
22+
private String host;
23+
24+
public String getHost() {
25+
return host;
26+
}
27+
28+
public void setHost(String host) {
29+
this.host = host;
30+
}
31+
32+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/*
2+
* Copyright 2014 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.mybatis.caches.redis;
17+
18+
import java.util.concurrent.TimeUnit;
19+
import java.util.concurrent.locks.Condition;
20+
import java.util.concurrent.locks.Lock;
21+
import java.util.concurrent.locks.ReadWriteLock;
22+
23+
/**
24+
* @author Iwao AVE!
25+
*/
26+
class DummyReadWriteLock implements ReadWriteLock {
27+
28+
private Lock lock = new DummyLock();
29+
30+
public Lock readLock() {
31+
return lock;
32+
}
33+
34+
public Lock writeLock() {
35+
return lock;
36+
}
37+
38+
static class DummyLock implements Lock {
39+
40+
public void lock() {
41+
// Not implemented
42+
}
43+
44+
public void lockInterruptibly() throws InterruptedException {
45+
// Not implemented
46+
}
47+
48+
public boolean tryLock() {
49+
return true;
50+
}
51+
52+
public boolean tryLock(long paramLong, TimeUnit paramTimeUnit) throws InterruptedException {
53+
return true;
54+
}
55+
56+
public void unlock() {
57+
// Not implemented
58+
}
59+
60+
public Condition newCondition() {
61+
return null;
62+
}
63+
}
64+
65+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2010-2014 The original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.mybatis.caches.redis;
17+
18+
import org.apache.ibatis.cache.decorators.LoggingCache;
19+
20+
/**
21+
* {@code LoggingCache} adapter for Ehcache.
22+
*
23+
* @author Simone Tripodi
24+
*/
25+
public final class LoggingRedisCache extends LoggingCache {
26+
27+
public LoggingRedisCache(final String id) {
28+
super(new RedisCache(id));
29+
}
30+
31+
}

0 commit comments

Comments
 (0)