1 | // Copyright (c) 2002 Dustin Sallings <dustin@spy.net> |
2 | |
3 | package net.spy.memcached.compat; |
4 | |
5 | import net.spy.memcached.compat.log.Logger; |
6 | import net.spy.memcached.compat.log.LoggerFactory; |
7 | |
8 | /** |
9 | * Superclass for all Spy Threads. |
10 | */ |
11 | public class SpyThread extends Thread { |
12 | |
13 | private transient Logger logger=null; |
14 | |
15 | // Thread has *eight* constructors. Damnit. |
16 | |
17 | /** |
18 | * Get an instance of SpyThread. |
19 | */ |
20 | public SpyThread() { |
21 | super(); |
22 | } |
23 | |
24 | /** |
25 | * Get an instance of SpyThread with a name. |
26 | * |
27 | * @param name thread name |
28 | */ |
29 | public SpyThread(String name) { |
30 | super(name); |
31 | } |
32 | |
33 | /** |
34 | * Get a Logger instance for this class. |
35 | * |
36 | * @return an appropriate logger instance. |
37 | */ |
38 | protected Logger getLogger() { |
39 | if(logger==null) { |
40 | logger=LoggerFactory.getLogger(getClass()); |
41 | } |
42 | return(logger); |
43 | } |
44 | |
45 | } |