Skip to content

Commit 4507c4f

Browse files
committed
add error handler, multiple tweaks and fixes
1 parent a320d95 commit 4507c4f

File tree

5 files changed

+233
-5
lines changed

5 files changed

+233
-5
lines changed

doc/CHANGELOG.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
08 Jul 2007 (gwhalin)
2+
-- add support for ErrorHandler hook (submitted by Dan Zivkovic @ Apple)
3+
-- ability to disable URLEncoding keys
4+
15
08 Apr 2007 (gwhalin)
26
-- added addOrIncr/addOrDecr methods
37
-- internal map changed to avoid possible key collision in internal data
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
package com.danga.MemCached;
2+
3+
/**
4+
* This is an interface implemented by classes that want to receive callbacks
5+
* in the event of an error in {@link MemCachedClient}. The implementor can do
6+
* things like flush caches or perform additioonal logging.
7+
*
8+
* @author Dan Zivkovic <[email protected]>
9+
* @version 1.5
10+
*/
11+
public interface ErrorHandler {
12+
13+
/**
14+
* Called for errors thrown during initialization.
15+
*/
16+
public void handleErrorOnInit( final MemCachedClient client ,
17+
final Throwable error );
18+
19+
/**
20+
* Called for errors thrown during {@link MemCachedClient#get(String)} and related methods.
21+
*/
22+
public void handleErrorOnGet( final MemCachedClient client ,
23+
final Throwable error ,
24+
final String cacheKey );
25+
26+
/**
27+
* Called for errors thrown during {@link MemCachedClient#getMulti(String)} and related methods.
28+
*/
29+
public void handleErrorOnGet( final MemCachedClient client ,
30+
final Throwable error ,
31+
final String[] cacheKeys );
32+
33+
/**
34+
* Called for errors thrown during {@link MemCachedClient#set(String,Object)} and related methods.
35+
*/
36+
public void handleErrorOnSet( final MemCachedClient client ,
37+
final Throwable error ,
38+
final String cacheKey );
39+
40+
/**
41+
* Called for errors thrown during {@link MemCachedClient#delete(String)} and related methods.
42+
*/
43+
public void handleErrorOnDelete( final MemCachedClient client ,
44+
final Throwable error ,
45+
final String cacheKey );
46+
47+
/**
48+
* Called for errors thrown during {@link MemCachedClient#flushAll()} and related methods.
49+
*/
50+
public void handleErrorOnFlush( final MemCachedClient client ,
51+
final Throwable error );
52+
53+
/**
54+
* Called for errors thrown during {@link MemCachedClient#stats()} and related methods.
55+
*/
56+
public void handleErrorOnStats( final MemCachedClient client ,
57+
final Throwable error );
58+
59+
} // interface

0 commit comments

Comments
 (0)