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