1 |
//---PACKAGE DECLARATION--- |
2 |
package uk.org.iscream.client; |
3 |
|
4 |
//---IMPORTS--- |
5 |
import uk.org.iscream.componentmanager.*; |
6 |
import uk.org.iscream.core.*; |
7 |
import uk.org.iscream.util.*; |
8 |
|
9 |
/** |
10 |
* A servant for the LocalClient. |
11 |
* |
12 |
* @author $Author: tdb1 $ |
13 |
* @version $Id: ClientServant.java,v 1.7 2001/02/27 01:02:01 tdb1 Exp $ |
14 |
*/ |
15 |
class ClientServant extends ClientPOA { |
16 |
|
17 |
//---FINAL ATTRIBUTES--- |
18 |
|
19 |
/** |
20 |
* The current CVS revision of this class |
21 |
*/ |
22 |
public static final String REVISION = "$Revision: 1.7 $"; |
23 |
|
24 |
//---STATIC METHODS--- |
25 |
|
26 |
//---CONSTRUCTORS--- |
27 |
|
28 |
/** |
29 |
* Construct a new ClientServant, with a given Queue. |
30 |
* |
31 |
* @param queue The Queue that will link this class to the MonitorManager |
32 |
*/ |
33 |
public ClientServant(Queue queue) { |
34 |
_queue = queue; |
35 |
} |
36 |
|
37 |
//---PUBLIC METHODS--- |
38 |
|
39 |
/** |
40 |
* This should deal with the data... :) |
41 |
* |
42 |
* @param xml The String of XML data |
43 |
*/ |
44 |
public void receiveXML(String xml) { |
45 |
_queue.add(xml); |
46 |
} |
47 |
|
48 |
/** |
49 |
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
50 |
* method to provide clean logging (every class should have this). |
51 |
* |
52 |
* This uses the uk.org.iscream.util.FormatName class |
53 |
* to format the toString() |
54 |
* |
55 |
* @return the name of this class and its CVS revision |
56 |
*/ |
57 |
public String toString() { |
58 |
return FormatName.getName( |
59 |
_name, |
60 |
getClass().getName(), |
61 |
REVISION); |
62 |
} |
63 |
|
64 |
//---PRIVATE METHODS--- |
65 |
|
66 |
//---ACCESSOR/MUTATOR METHODS--- |
67 |
|
68 |
//---ATTRIBUTES--- |
69 |
|
70 |
/** |
71 |
* This is the friendly identifier of the |
72 |
* component this class is running in. |
73 |
* eg, a Filter may be called "filter1", |
74 |
* If this class does not have an owning |
75 |
* component, a name from the configuration |
76 |
* can be placed here. This name could also |
77 |
* be changed to null for utility classes. |
78 |
*/ |
79 |
private String _name = ClientMain.NAME; |
80 |
|
81 |
/** |
82 |
* This holds a reference to the |
83 |
* system logger that is being used. |
84 |
*/ |
85 |
private Logger _logger = ReferenceManager.getInstance().getLogger(); |
86 |
|
87 |
/** |
88 |
* A reference to our QUeue |
89 |
*/ |
90 |
private Queue _queue; |
91 |
|
92 |
//---STATIC ATTRIBUTES--- |
93 |
|
94 |
} |