Skip to content

Commit dca920f

Browse files
committed
Disabling external locking & some legal headers
1 parent 0a42be2 commit dca920f

17 files changed

+107
-32
lines changed

src/main/java/org/mybatis/caches/memcached/AbstractPropertySetter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,8 +28,7 @@
2828
* Converts a keyed property string in the Config to a proper Java
2929
* object representation.
3030
*
31-
* @version $Id$
32-
* @param <T>
31+
* @author Simone Tripodi
3332
*/
3433
abstract class AbstractPropertySetter<T> {
3534

src/main/java/org/mybatis/caches/memcached/BooleanPropertySetter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818
/**
1919
* Setter from String to Boolean representation.
2020
*
21-
* @version $Id$
21+
* @author Simone Tripodi
2222
*/
2323
final class BooleanPropertySetter extends AbstractPropertySetter<Boolean> {
2424

src/main/java/org/mybatis/caches/memcached/CompressorTranscoder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
3434
* The Transcoder that compress and decompress the stored objects using the
3535
* GZIP compression algorithm.
3636
*
37-
* @version $Id$
37+
* @author Simone Tripodi
3838
*/
3939
final class CompressorTranscoder implements Transcoder<Object> {
4040

src/main/java/org/mybatis/caches/memcached/ConnectionFactorySetter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,7 +21,7 @@
2121
/**
2222
* Setter from String to ConnectionFactory representation.
2323
*
24-
* @version $Id$
24+
* @author Simone Tripodi
2525
*/
2626
final class ConnectionFactorySetter extends AbstractPropertySetter<ConnectionFactory> {
2727

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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.memcached;
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+
}
42+
43+
public void lockInterruptibly() throws InterruptedException {
44+
}
45+
46+
public boolean tryLock() {
47+
return true;
48+
}
49+
50+
public boolean tryLock(long paramLong, TimeUnit paramTimeUnit) throws InterruptedException {
51+
return true;
52+
}
53+
54+
public void unlock() {
55+
}
56+
57+
public Condition newCondition() {
58+
return null;
59+
}
60+
}
61+
62+
}

src/main/java/org/mybatis/caches/memcached/InetSocketAddressListPropertySetter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
2424
/**
2525
* Setter from String to list of InetSocketAddress representation.
2626
*
27-
* @version $Id$
27+
* @author Simone Tripodi
2828
*/
2929
final class InetSocketAddressListPropertySetter extends AbstractPropertySetter<List<InetSocketAddress>> {
3030

src/main/java/org/mybatis/caches/memcached/IntegerPropertySetter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818
/**
1919
* Setter from String to Integer representation.
2020
*
21-
* @version $Id$
21+
* @author Simone Tripodi
2222
*/
2323
final class IntegerPropertySetter extends AbstractPropertySetter<Integer> {
2424

src/main/java/org/mybatis/caches/memcached/LoggingMemcachedCache.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
2020
/**
2121
* {@code LoggingCache} adapter for Memcached.
2222
*
23-
* @version $Id$
23+
* @author Simone Tripodi
2424
*/
2525
public final class LoggingMemcachedCache extends LoggingCache {
2626

src/main/java/org/mybatis/caches/memcached/MemcachedCache.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,14 +16,13 @@
1616
package org.mybatis.caches.memcached;
1717

1818
import java.util.concurrent.locks.ReadWriteLock;
19-
import java.util.concurrent.locks.ReentrantReadWriteLock;
2019

2120
import org.apache.ibatis.cache.Cache;
2221

2322
/**
2423
* The Memcached-based Cache implementation.
2524
*
26-
* @version $Id$
25+
* @author Simone Tripodi
2726
*/
2827
public final class MemcachedCache implements Cache {
2928

@@ -32,7 +31,7 @@ public final class MemcachedCache implements Cache {
3231
/**
3332
* The {@link ReadWriteLock}.
3433
*/
35-
private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
34+
private final ReadWriteLock readWriteLock = new DummyReadWriteLock();
3635

3736
/**
3837
* The cache id.

src/main/java/org/mybatis/caches/memcached/MemcachedClientWrapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
2828
import org.apache.ibatis.logging.LogFactory;
2929

3030
/**
31-
* @version $Id$
31+
* @author Simone Tripodi
3232
*/
3333
final class MemcachedClientWrapper {
3434

src/main/java/org/mybatis/caches/memcached/MemcachedConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
2626
/**
2727
* The Memcached client configuration.
2828
*
29-
* @version $Id$
29+
* @author Simone Tripodi
3030
*/
3131
final class MemcachedConfiguration {
3232

src/main/java/org/mybatis/caches/memcached/MemcachedConfigurationBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
2424
/**
2525
* Converter from the Config to a proper {@link MemcachedConfiguration}.
2626
*
27-
* @version $Id$
27+
* @author Simone Tripodi
2828
*/
2929
final class MemcachedConfigurationBuilder {
3030

src/main/java/org/mybatis/caches/memcached/StringPropertySetter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818
/**
1919
* Identity String setter.
2020
*
21-
* @version $Id$
21+
* @author Simone Tripodi
2222
*/
2323
final class StringPropertySetter extends AbstractPropertySetter<String> {
2424

src/main/java/org/mybatis/caches/memcached/StringUtils.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
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+
*/
116
package org.mybatis.caches.memcached;
217

318
import java.security.MessageDigest;

src/main/java/org/mybatis/caches/memcached/TimeUnitSetter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
2020
/**
2121
* Setter from String to TimeUnit representation.
2222
*
23-
* @version $Id$
23+
* @author Simone Tripodi
2424
*/
2525
final class TimeUnitSetter extends AbstractPropertySetter<TimeUnit> {
2626

src/main/java/org/mybatis/caches/memcached/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -17,6 +17,6 @@
1717
/**
1818
* Contains Memcached support for MyBatis Cache.
1919
*
20-
* @version $Id$
20+
* @author Simone Tripodi
2121
*/
2222
package org.mybatis.caches.memcached;

src/test/java/org/mybatis/caches/memcached/MemcachedTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 The MyBatis Team
2+
* Copyright 2012-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)