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