ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/agents/Station.java
Revision: 1.2
Committed: Fri May 4 02:04:35 2001 UTC (23 years, 7 months ago) by ajm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +72 -1 lines
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

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