1 |
//---PACKAGE DECLARATION--- |
2 |
|
3 |
//---IMPORTS--- |
4 |
import java.io.IOException; |
5 |
import java.net.Socket; |
6 |
|
7 |
/** |
8 |
* An implementation of the HandlerFactory interface that is |
9 |
* a factory for a handler that handles agents being injected |
10 |
* into the system. |
11 |
* |
12 |
* @author $Author: tdb1 $ |
13 |
* @version $Id: TemplateClass.java,v 1.11 2001/03/22 21:50:41 tdb1 Exp $ |
14 |
*/ |
15 |
class DirectAgentHandlerFactory implements HandlerFactory { |
16 |
|
17 |
//---FINAL / FINAL STATIC ATTRIBUTES--- |
18 |
|
19 |
/** |
20 |
* The current CVS revision of this class |
21 |
*/ |
22 |
public static final String REVISION = "$Revision: 1.11 $"; |
23 |
|
24 |
//---STATIC METHODS--- |
25 |
|
26 |
//---CONSTRUCTORS--- |
27 |
|
28 |
//---PUBLIC METHODS--- |
29 |
|
30 |
public Handler newHandler(Socket socket) throws IOException { |
31 |
return (Handler) new DirectAgentHandler(socket); |
32 |
} |
33 |
|
34 |
public String getName() { |
35 |
return _name; |
36 |
} |
37 |
|
38 |
/** |
39 |
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
40 |
* method to provide clean logging (every class should have this). |
41 |
* |
42 |
* This uses the uk.ac.ukc.iscream.util.FormatName class |
43 |
* to format the toString() |
44 |
* |
45 |
* @return the name of this class and its CVS revision |
46 |
*/ |
47 |
public String toString() { |
48 |
return FormatName.getName( |
49 |
_name, |
50 |
getClass().getName(), |
51 |
REVISION); |
52 |
} |
53 |
|
54 |
//---PRIVATE/PROTECTED METHODS--- |
55 |
|
56 |
//---ACCESSOR/MUTATOR METHODS--- |
57 |
|
58 |
//---ATTRIBUTES--- |
59 |
|
60 |
/** |
61 |
* This is the friendly identifier of the |
62 |
* component this class is running in. |
63 |
* eg, a Filter may be called "filter1", |
64 |
* If this class does not have an owning |
65 |
* component, a name from the configuration |
66 |
* can be placed here. This name could also |
67 |
* be changed to null for utility classes. |
68 |
*/ |
69 |
private String _name = "DirectAgentHandlerFactory"; |
70 |
|
71 |
/** |
72 |
* This holds a reference to the |
73 |
* system logger that is being used. |
74 |
*/ |
75 |
private Logger _logger = Logger.getInstance(); |
76 |
|
77 |
//---STATIC ATTRIBUTES--- |
78 |
|
79 |
} |