ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/agents/DirectAgentHandlerFactory.java
Revision: 1.1
Committed: Fri May 4 02:04:35 2001 UTC (22 years, 10 months ago) by ajm
Branch: MAIN
CVS Tags: HEAD
Log Message:
Loads of new framework but far from complete.

The BasicAgent class is as it says, a basic agent, with ability to be run from the command line to fire it into an agentstation.

AgentStations now have support for adding and removing agents and support for multiple listeners.  Also initial support for peer agent stations.  Attempted support at peer -> peer agent transfer, but run into problems.

Still no bytecode transfer, but location and method has been figured out.

The AgentSystem class is now the bootstrap class for an agent station.  It brings up the AgentStation (which is now singleton) and the Logger (also singleton - using standard i-scream logging techniques).  It is possible to specify a peer station that the booting agent station should connect to.

Initial TODO:

	agent class loader
	agent bytecode transfer
	solve peer -> peer problems - possibly by creating extra socket to send agent, but shouldn't really be needed

File Contents

# Content
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 }