Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.

Commit 06960ed

Browse files
committed
rename package and class name to more sane values
1 parent 7bc9c54 commit 06960ed

14 files changed

+122
-123
lines changed

build.xml

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?xml version="1.0" encoding="ISO-8859-1"?>
2-
<project name="java_memcached" default="package" basedir=".">
2+
<project name="memcached" default="package" basedir=".">
33

44
<property name="project.title" value="java memcached client" />
5-
<property name="code.dir" value="src/com/danga/MemCached" />
5+
<property name="code.dir" value="src/com/whalin/memcached" />
66
<property name="doc.dir" value="doc" />
77
<property name="src.dir" value="src" />
88
<property name="build.dir" value="classes" />
99

1010
<property environment="env"/>
1111
<property file="build.properties"/>
12-
<property name="project" value="java_memcached"/>
12+
<property name="project" value="memcached"/>
1313

1414
<path id="project.class.path">
1515
<pathelement path = "lib/log4j.jar"/>
@@ -18,75 +18,75 @@
1818
<!-- package release -->
1919
<!-- ant package -Dver=release_1.3 -Dlog4j=1 -->
2020
<target name="package" depends="clean, setup, log4j, logger, pkg-compile, jar, javadoc">
21-
<tar tarfile="java_memcached-${ver}.tar.gz" basedir="." includes="java_memcached-${ver}/**" compression="gzip"/>
22-
<zip destfile="java_memcached-${ver}.zip" basedir="." includes="java_memcached-${ver}/**"/>
23-
<copy file="java_memcached-${ver}/java_memcached-${ver}.jar" todir="."/>
21+
<tar tarfile="memcached-${ver}.tar.gz" basedir="." includes="memcached-${ver}/**" compression="gzip"/>
22+
<zip destfile="memcached-${ver}.zip" basedir="." includes="memcached-${ver}/**"/>
23+
<copy file="memcached-${ver}/memcached-${ver}.jar" todir="."/>
2424

25-
<checksum file="java_memcached-${ver}.tar.gz"/>
26-
<checksum file="java_memcached-${ver}.zip"/>
27-
<checksum file="java_memcached-${ver}.jar"/>
28-
<delete dir="java_memcached-${ver}" />
25+
<checksum file="memcached-${ver}.tar.gz"/>
26+
<checksum file="memcached-${ver}.zip"/>
27+
<checksum file="memcached-${ver}.jar"/>
28+
<delete dir="memcached-${ver}" />
2929

30-
<tar tarfile="java_memcached-${ver}.tar" basedir="." includes="java_memcached-${ver}.*"/>
30+
<tar tarfile="memcached-${ver}.tar" basedir="." includes="memcached-${ver}.*"/>
3131
</target>
3232

3333
<target name="clean">
3434
<delete dir="${build.dir}"/>
35-
<delete dir="java_memcached-${ver}" />
36-
<delete file="java_memcached-${ver}.tar.gz"/>
37-
<delete file="java_memcached-${ver}.zip"/>
38-
<delete file="java_memcached-${ver}.jar"/>
39-
<delete file="java_memcached-${ver}.tar.gz.MD5"/>
40-
<delete file="java_memcached-${ver}.zip.MD5"/>
41-
<delete file="java_memcached-${ver}.jar.MD5"/>
35+
<delete dir="memcached-${ver}" />
36+
<delete file="memcached-${ver}.tar.gz"/>
37+
<delete file="memcached-${ver}.zip"/>
38+
<delete file="memcached-${ver}.jar"/>
39+
<delete file="memcached-${ver}.tar.gz.MD5"/>
40+
<delete file="memcached-${ver}.zip.MD5"/>
41+
<delete file="memcached-${ver}.jar.MD5"/>
4242
</target>
4343

4444
<target name="setup">
45-
<mkdir dir="java_memcached-${ver}"/>
46-
<mkdir dir="java_memcached-${ver}/javadocs"/>
47-
<mkdir dir="java_memcached-${ver}/src/com/danga/MemCached"/>
48-
<mkdir dir="java_memcached-${ver}/classes"/>
49-
<mkdir dir="java_memcached-${ver}/doc"/>
45+
<mkdir dir="memcached-${ver}"/>
46+
<mkdir dir="memcached-${ver}/javadocs"/>
47+
<mkdir dir="memcached-${ver}/src/com/whalin/memcached"/>
48+
<mkdir dir="memcached-${ver}/classes"/>
49+
<mkdir dir="memcached-${ver}/doc"/>
5050

5151
<!-- copy source -->
52-
<copy todir="java_memcached-${ver}/src/com/danga/MemCached">
52+
<copy todir="memcached-${ver}/src/com/whalin/memcached">
5353
<fileset dir="${code.dir}" defaultexcludes="true" excludes="**/*.xml **/*.swp **/*.swo"/>
5454
</copy>
5555

5656
<!-- copy doc dir -->
57-
<copy todir="java_memcached-${ver}/doc">
57+
<copy todir="memcached-${ver}/doc">
5858
<fileset dir="${doc.dir}" defaultexcludes="true" excludes="**/*.swp **/*.swo"/>
5959
</copy>
6060

6161
<!-- copy license to root -->
62-
<copy file="${doc.dir}/LICENSE.txt" todir="java_memcached-${ver}"/>
62+
<copy file="${doc.dir}/LICENSE.txt" todir="memcached-${ver}"/>
6363

6464
<!-- copy changelog to root -->
65-
<copy file="${doc.dir}/CHANGELOG.txt" todir="java_memcached-${ver}"/>
65+
<copy file="${doc.dir}/CHANGELOG.txt" todir="memcached-${ver}"/>
6666
</target>
6767

6868
<!-- if logger is log4j then need to filter to make sure import exists -->
6969
<target name="log4j" if="log4j" depends="clean, setup">
70-
<replace dir="java_memcached-${ver}/src/com/danga/MemCached" token="//import org.apache.log4j.Logger;" value="import org.apache.log4j.Logger;">
70+
<replace dir="memcached-${ver}/src/com/whalin/memcached" token="//import org.apache.log4j.Logger;" value="import org.apache.log4j.Logger;">
7171
<include name="**/*.java"/>
7272
</replace>
7373
</target>
7474

7575
<target name="logger" unless="log4j" depends="clean, setup">
76-
<replace dir="java_memcached-${ver}/src/com/danga/MemCached" token="import org.apache.log4j.Logger;" value="//import org.apache.log4j.Logger;">
76+
<replace dir="memcached-${ver}/src/com/whalin/memcached" token="import org.apache.log4j.Logger;" value="//import org.apache.log4j.Logger;">
7777
<include name="**/*.java"/>
7878
</replace>
7979
</target>
8080

8181
<!-- javadocs -->
8282
<target name="javadoc" depends="clean, setup, log4j, logger">
8383
<delete>
84-
<fileset dir="java_memcached-${ver}/javadocs" />
84+
<fileset dir="memcached-${ver}/javadocs" />
8585
</delete>
8686

87-
<javadoc sourcepath="java_memcached-${ver}/src"
88-
destdir="java_memcached-${ver}/javadocs"
89-
packagenames= "com.danga.*"
87+
<javadoc sourcepath="memcached-${ver}/src"
88+
destdir="memcached-${ver}/javadocs"
89+
packagenames= "com.whalin.*"
9090
author= "true"
9191
private="true"
9292
version="true"
@@ -101,13 +101,13 @@
101101

102102
<!-- compilation target for packeging operations -->
103103
<target name="pkg-compile" depends="clean, setup, log4j, logger">
104-
<javac debug="yes" srcdir="java_memcached-${ver}/src" destdir="java_memcached-${ver}/classes" deprecation="true">
104+
<javac debug="yes" srcdir="memcached-${ver}/src" destdir="memcached-${ver}/classes" deprecation="true">
105105
<classpath refid="project.class.path"/>
106106
</javac>
107107
</target>
108108

109109
<target name="jar" depends="pkg-compile">
110-
<jar compress="yes" jarfile="java_memcached-${ver}/java_memcached-${ver}.jar" basedir="java_memcached-${ver}/classes"/>
110+
<jar compress="yes" jarfile="memcached-${ver}/memcached-${ver}.jar" basedir="memcached-${ver}/classes"/>
111111
</target>
112112

113113
<!-- compilation target -->

src/com/whalin/memcached/ByteBufArrayInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @author greg whalin <[email protected]>
1717
* @version 2.0
1818
*/
19-
package com.danga.MemCached;
19+
package com.whalin.memcached;
2020

2121
import java.io.ByteArrayOutputStream;
2222
import java.io.IOException;

src/com/whalin/memcached/ContextObjectInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* @author Vin Chawla <[email protected]>
2323
* @version 2.0
2424
*/
25-
package com.danga.MemCached;
25+
package com.whalin.memcached;
2626

2727
import java.util.*;
2828
import java.util.zip.*;

src/com/whalin/memcached/ErrorHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @author Dan Zivkovic <[email protected]>
2222
* @version 2.0
2323
*/
24-
package com.danga.MemCached;
24+
package com.whalin.memcached;
2525

2626
public interface ErrorHandler {
2727

src/com/whalin/memcached/LineInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @author greg whalin <[email protected]>
1818
* @version 2.0
1919
*/
20-
package com.danga.MemCached;
20+
package com.whalin.memcached;
2121

2222
import java.io.IOException;
2323

src/com/whalin/memcached/Logger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* @author Greg Whalin <[email protected]>
1818
* @version 2.0
1919
*/
20-
package com.danga.MemCached;
20+
package com.whalin.memcached;
2121

2222
import java.util.*;
2323

src/com/whalin/memcached/MemCachedClient.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* MemCached client for Java
2+
* Memcached client for Java
33
* Copyright (c) 2008 Greg Whalin
44
* All rights reserved.
55
*
@@ -17,7 +17,7 @@
1717
* @author Greg Whalin <[email protected]>
1818
* @version 2.0
1919
*/
20-
package com.danga.MemCached;
20+
package com.whalin.memcached;
2121

2222
import java.util.*;
2323
import java.util.zip.*;
@@ -45,7 +45,7 @@
4545
* Some examples of use follow.<br/>
4646
* <h3>To create cache client object and set params:</h3>
4747
* <pre>
48-
* MemCachedClient mc = new MemCachedClient();
48+
* MemcachedClient mc = new MemcachedClient();
4949
*
5050
* // compression is enabled by default
5151
* mc.setCompressEnable(true);
@@ -59,14 +59,14 @@
5959
* </pre>
6060
* <h3>To store an object:</h3>
6161
* <pre>
62-
* MemCachedClient mc = new MemCachedClient();
62+
* MemcachedClient mc = new MemcachedClient();
6363
* String key = "cacheKey1";
6464
* Object value = SomeClass.getObject();
6565
* mc.set(key, value);
6666
* </pre>
6767
* <h3>To store an object using a custom server hashCode:</h3>
6868
* <pre>
69-
* MemCachedClient mc = new MemCachedClient();
69+
* MemcachedClient mc = new MemcachedClient();
7070
* String key = "cacheKey1";
7171
* Object value = SomeClass.getObject();
7272
* Integer hash = new Integer(45);
@@ -80,20 +80,20 @@
8080
* </ul>
8181
* <h3>To delete a cache entry:</h3>
8282
* <pre>
83-
* MemCachedClient mc = new MemCachedClient();
83+
* MemcachedClient mc = new MemcachedClient();
8484
* String key = "cacheKey1";
8585
* mc.delete(key);
8686
* </pre>
8787
* <h3>To delete a cache entry using a custom hash code:</h3>
8888
* <pre>
89-
* MemCachedClient mc = new MemCachedClient();
89+
* MemcachedClient mc = new MemcachedClient();
9090
* String key = "cacheKey1";
9191
* Integer hash = new Integer(45);
9292
* mc.delete(key, hashCode);
9393
* </pre>
9494
* <h3>To store a counter and then increment or decrement that counter:</h3>
9595
* <pre>
96-
* MemCachedClient mc = new MemCachedClient();
96+
* MemcachedClient mc = new MemcachedClient();
9797
* String key = "counterKey";
9898
* mc.storeCounter(key, new Integer(100));
9999
* System.out.println("counter after adding 1: " mc.incr(key));
@@ -103,7 +103,7 @@
103103
* </pre>
104104
* <h3>To store a counter and then increment or decrement that counter with custom hash:</h3>
105105
* <pre>
106-
* MemCachedClient mc = new MemCachedClient();
106+
* MemcachedClient mc = new MemcachedClient();
107107
* String key = "counterKey";
108108
* Integer hash = new Integer(45);
109109
* mc.storeCounter(key, new Integer(100), hash);
@@ -114,38 +114,38 @@
114114
* </pre>
115115
* <h3>To retrieve an object from the cache:</h3>
116116
* <pre>
117-
* MemCachedClient mc = new MemCachedClient();
117+
* MemcachedClient mc = new MemcachedClient();
118118
* String key = "key";
119119
* Object value = mc.get(key);
120120
* </pre>
121121
* <h3>To retrieve an object from the cache with custom hash:</h3>
122122
* <pre>
123-
* MemCachedClient mc = new MemCachedClient();
123+
* MemcachedClient mc = new MemcachedClient();
124124
* String key = "key";
125125
* Integer hash = new Integer(45);
126126
* Object value = mc.get(key, hash);
127127
* </pre>
128128
* <h3>To retrieve an multiple objects from the cache</h3>
129129
* <pre>
130-
* MemCachedClient mc = new MemCachedClient();
130+
* MemcachedClient mc = new MemcachedClient();
131131
* String[] keys = { "key", "key1", "key2" };
132132
* Map&lt;Object&gt; values = mc.getMulti(keys);
133133
* </pre>
134134
* <h3>To retrieve an multiple objects from the cache with custom hashing</h3>
135135
* <pre>
136-
* MemCachedClient mc = new MemCachedClient();
136+
* MemcachedClient mc = new MemcachedClient();
137137
* String[] keys = { "key", "key1", "key2" };
138138
* Integer[] hashes = { new Integer(45), new Integer(32), new Integer(44) };
139139
* Map&lt;Object&gt; values = mc.getMulti(keys, hashes);
140140
* </pre>
141141
* <h3>To flush all items in server(s)</h3>
142142
* <pre>
143-
* MemCachedClient mc = new MemCachedClient();
143+
* MemcachedClient mc = new MemcachedClient();
144144
* mc.flushAll();
145145
* </pre>
146146
* <h3>To get stats from server(s)</h3>
147147
* <pre>
148-
* MemCachedClient mc = new MemCachedClient();
148+
* MemcachedClient mc = new MemcachedClient();
149149
* Map stats = mc.stats();
150150
* </pre>
151151
*
@@ -156,7 +156,7 @@
156156
* @author Vin Chawla <[email protected]>
157157
* @version 1.5
158158
*/
159-
public class MemCachedClient {
159+
public class MemcachedClient {
160160

161161
// logger
162162
private static Logger log =
@@ -224,7 +224,7 @@ public class MemCachedClient {
224224
/**
225225
* Creates a new instance of MemCachedClient.
226226
*/
227-
public MemCachedClient() {
227+
public MemcachedClient() {
228228
init();
229229
}
230230

@@ -234,7 +234,7 @@ public MemCachedClient() {
234234
*
235235
* @param poolName name of SockIOPool
236236
*/
237-
public MemCachedClient( String poolName ) {
237+
public MemcachedClient( String poolName ) {
238238
this.poolName = poolName;
239239
init();
240240
}
@@ -245,7 +245,7 @@ public MemCachedClient( String poolName ) {
245245
*
246246
* @param classLoader ClassLoader object.
247247
*/
248-
public MemCachedClient( ClassLoader classLoader ) {
248+
public MemcachedClient( ClassLoader classLoader ) {
249249
this.classLoader = classLoader;
250250
init();
251251
}
@@ -258,7 +258,7 @@ public MemCachedClient( ClassLoader classLoader ) {
258258
* @param classLoader ClassLoader object.
259259
* @param errorHandler ErrorHandler object.
260260
*/
261-
public MemCachedClient( ClassLoader classLoader, ErrorHandler errorHandler ) {
261+
public MemcachedClient( ClassLoader classLoader, ErrorHandler errorHandler ) {
262262
this.classLoader = classLoader;
263263
this.errorHandler = errorHandler;
264264
init();
@@ -273,7 +273,7 @@ public MemCachedClient( ClassLoader classLoader, ErrorHandler errorHandler ) {
273273
* @param errorHandler ErrorHandler object.
274274
* @param poolName SockIOPool name
275275
*/
276-
public MemCachedClient( ClassLoader classLoader, ErrorHandler errorHandler, String poolName ) {
276+
public MemcachedClient( ClassLoader classLoader, ErrorHandler errorHandler, String poolName ) {
277277
this.classLoader = classLoader;
278278
this.errorHandler = errorHandler;
279279
this.poolName = poolName;
@@ -2041,10 +2041,10 @@ else if ( line.startsWith( ERROR ) || line.startsWith( CLIENT_ERROR ) || line.st
20412041
protected final class NIOLoader {
20422042
protected Selector selector;
20432043
protected int numConns = 0;
2044-
protected MemCachedClient mc;
2044+
protected MemcachedClient mc;
20452045
protected Connection[] conns;
20462046

2047-
public NIOLoader( MemCachedClient mc ) {
2047+
public NIOLoader( MemcachedClient mc ) {
20482048
this.mc = mc;
20492049
}
20502050

@@ -2232,7 +2232,7 @@ public void doMulti( boolean asString, Map<String, StringBuilder> sockKeys, Stri
22322232
private void handleError( Throwable e, String[] keys ) {
22332233
// if we have an errorHandler, use its hook
22342234
if ( errorHandler != null )
2235-
errorHandler.handleErrorOnGet( MemCachedClient.this, e, keys );
2235+
errorHandler.handleErrorOnGet( MemcachedClient.this, e, keys );
22362236

22372237
// exception thrown
22382238
log.error( "++++ exception thrown while getting from cache on getMulti" );

0 commit comments

Comments
 (0)