1 |
tdb |
1.11 |
/* |
2 |
|
|
* i-scream central monitoring system |
3 |
tdb |
1.12 |
* http://www.i-scream.org.uk |
4 |
tdb |
1.11 |
* Copyright (C) 2000-2002 i-scream |
5 |
|
|
* |
6 |
|
|
* This program is free software; you can redistribute it and/or |
7 |
|
|
* modify it under the terms of the GNU General Public License |
8 |
|
|
* as published by the Free Software Foundation; either version 2 |
9 |
|
|
* of the License, or (at your option) any later version. |
10 |
|
|
* |
11 |
|
|
* This program is distributed in the hope that it will be useful, |
12 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 |
|
|
* GNU General Public License for more details. |
15 |
|
|
* |
16 |
|
|
* You should have received a copy of the GNU General Public License |
17 |
|
|
* along with this program; if not, write to the Free Software |
18 |
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 |
|
|
*/ |
20 |
|
|
|
21 |
tdb |
1.6 |
//---PACKAGE DECLARATION--- |
22 |
tdb |
1.10 |
package uk.org.iscream.cms.server.client; |
23 |
tdb |
1.1 |
|
24 |
tdb |
1.6 |
//---IMPORTS--- |
25 |
tdb |
1.10 |
import uk.org.iscream.cms.server.componentmanager.*; |
26 |
|
|
import uk.org.iscream.cms.server.core.*; |
27 |
tdb |
1.13 |
import uk.org.iscream.cms.util.*; |
28 |
tdb |
1.14 |
import uk.org.iscream.cms.server.clientinterface.*; |
29 |
tdb |
1.1 |
|
30 |
tdb |
1.6 |
/** |
31 |
|
|
* A servant for the LocalClient. |
32 |
ajm |
1.9 |
* This represents the Client interface for CORBA |
33 |
|
|
* clients connecting to the i-scream system on the ClientInterface. |
34 |
|
|
* |
35 |
|
|
* The i-scream ClientInterface pumps data over CORBA into the |
36 |
|
|
* queue, using the recieveXML method. The MonitorManager |
37 |
|
|
* then handles pulling the data out of this queue. |
38 |
tdb |
1.6 |
* |
39 |
tdb |
1.11 |
* @author $Author: tdb $ |
40 |
tdb |
1.14 |
* @version $Id: ClientServant.java,v 1.13 2003/02/05 16:43:44 tdb Exp $ |
41 |
tdb |
1.6 |
*/ |
42 |
tdb |
1.1 |
class ClientServant extends ClientPOA { |
43 |
tdb |
1.6 |
|
44 |
|
|
//---FINAL ATTRIBUTES--- |
45 |
|
|
|
46 |
|
|
/** |
47 |
|
|
* The current CVS revision of this class |
48 |
|
|
*/ |
49 |
tdb |
1.14 |
public static final String REVISION = "$Revision: 1.13 $"; |
50 |
tdb |
1.6 |
|
51 |
|
|
//---STATIC METHODS--- |
52 |
|
|
|
53 |
|
|
//---CONSTRUCTORS--- |
54 |
tdb |
1.7 |
|
55 |
|
|
/** |
56 |
|
|
* Construct a new ClientServant, with a given Queue. |
57 |
|
|
* |
58 |
|
|
* @param queue The Queue that will link this class to the MonitorManager |
59 |
|
|
*/ |
60 |
|
|
public ClientServant(Queue queue) { |
61 |
|
|
_queue = queue; |
62 |
|
|
} |
63 |
tdb |
1.6 |
|
64 |
|
|
//---PUBLIC METHODS--- |
65 |
|
|
|
66 |
|
|
/** |
67 |
ajm |
1.9 |
* Adds the inbound data to our queue when the CORBA method is called. |
68 |
tdb |
1.6 |
* |
69 |
|
|
* @param xml The String of XML data |
70 |
|
|
*/ |
71 |
tdb |
1.1 |
public void receiveXML(String xml) { |
72 |
tdb |
1.7 |
_queue.add(xml); |
73 |
tdb |
1.1 |
} |
74 |
tdb |
1.6 |
|
75 |
|
|
/** |
76 |
|
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
77 |
|
|
* method to provide clean logging (every class should have this). |
78 |
|
|
* |
79 |
tdb |
1.13 |
* This uses the uk.org.iscream.cms.util.FormatName class |
80 |
tdb |
1.6 |
* to format the toString() |
81 |
|
|
* |
82 |
|
|
* @return the name of this class and its CVS revision |
83 |
|
|
*/ |
84 |
|
|
public String toString() { |
85 |
|
|
return FormatName.getName( |
86 |
|
|
_name, |
87 |
|
|
getClass().getName(), |
88 |
|
|
REVISION); |
89 |
|
|
} |
90 |
|
|
|
91 |
|
|
//---PRIVATE METHODS--- |
92 |
|
|
|
93 |
|
|
//---ACCESSOR/MUTATOR METHODS--- |
94 |
|
|
|
95 |
|
|
//---ATTRIBUTES--- |
96 |
|
|
|
97 |
|
|
/** |
98 |
|
|
* This is the friendly identifier of the |
99 |
|
|
* component this class is running in. |
100 |
|
|
* eg, a Filter may be called "filter1", |
101 |
|
|
* If this class does not have an owning |
102 |
|
|
* component, a name from the configuration |
103 |
|
|
* can be placed here. This name could also |
104 |
|
|
* be changed to null for utility classes. |
105 |
|
|
*/ |
106 |
|
|
private String _name = ClientMain.NAME; |
107 |
|
|
|
108 |
|
|
/** |
109 |
|
|
* This holds a reference to the |
110 |
|
|
* system logger that is being used. |
111 |
|
|
*/ |
112 |
|
|
private Logger _logger = ReferenceManager.getInstance().getLogger(); |
113 |
tdb |
1.7 |
|
114 |
|
|
/** |
115 |
ajm |
1.9 |
* A reference to our Queue to place the inbond data into. |
116 |
tdb |
1.7 |
*/ |
117 |
|
|
private Queue _queue; |
118 |
tdb |
1.6 |
|
119 |
|
|
//---STATIC ATTRIBUTES--- |
120 |
|
|
|
121 |
tdb |
1.1 |
} |