1 |
+ |
/* |
2 |
+ |
* i-scream central monitoring system |
3 |
+ |
* http://www.i-scream.org.uk |
4 |
+ |
* 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 |
|
//---PACKAGE DECLARATION--- |
22 |
< |
package uk.org.iscream.client; |
22 |
> |
package uk.org.iscream.cms.server.client; |
23 |
|
|
24 |
|
//---IMPORTS--- |
25 |
< |
import uk.org.iscream.clientinterface.*; |
26 |
< |
import uk.org.iscream.componentmanager.*; |
27 |
< |
import uk.org.iscream.core.*; |
28 |
< |
import uk.org.iscream.util.*; |
25 |
> |
import uk.org.iscream.cms.server.clientinterface.*; |
26 |
> |
import uk.org.iscream.cms.server.componentmanager.*; |
27 |
> |
import uk.org.iscream.cms.server.core.*; |
28 |
> |
import uk.org.iscream.cms.server.util.*; |
29 |
|
|
30 |
|
/** |
31 |
|
* A startup component for the Local Clients. |
32 |
+ |
* This class starts the CORBA client used for alerting |
33 |
+ |
* purposes. It reads data using the ClientServant from CORBA |
34 |
+ |
* calls by the i-scream client interface. This data is then |
35 |
+ |
* used by the MonitorManager to pass to Monitors. Monitors then |
36 |
+ |
* analyse the data and raise alerts if needed, these are passed to |
37 |
+ |
* the Alerters, which send out alerts. They are looked after by |
38 |
+ |
* the AlerterManager. |
39 |
|
* |
40 |
|
* @author $Author$ |
41 |
|
* @version $Id$ |
62 |
|
//---PUBLIC METHODS--- |
63 |
|
|
64 |
|
/** |
65 |
< |
* This starts the Local Client component |
65 |
> |
* This starts the Local Client component. |
66 |
> |
* This starts the ClientServant, the MonitorManager and |
67 |
> |
* the AlerterManager, aswell as initialising any queues |
68 |
> |
* and obtaining any initial configuration. |
69 |
> |
* |
70 |
> |
* @throws ComponentStartException if the component fails to start |
71 |
|
*/ |
72 |
|
public void start() throws ComponentStartException { |
73 |
|
// get references to key objects |
111 |
|
try { |
112 |
|
// try to get the interval, if this fails, we won't start up the monitor |
113 |
|
int queueMonitorInterval = Integer.parseInt(cp.getProperty(NAME, "Queue.MonitorInterval")); |
114 |
< |
_alerterQueue.startMonitor(queueMonitorInterval*1000, _monitorQueue, NAME + " DataQueue"); |
115 |
< |
_monitorQueue.startMonitor(queueMonitorInterval*1000, _monitorQueue, NAME + " HeartbeatQueue"); |
114 |
> |
_alerterQueue.startMonitor(queueMonitorInterval*1000, _monitorQueue, NAME + " Alerter"); |
115 |
> |
_monitorQueue.startMonitor(queueMonitorInterval*1000, _monitorQueue, NAME + " Monitor"); |
116 |
|
} catch (PropertyNotFoundException e) { |
117 |
|
_logger.write(toString(), Logger.WARNING, "failed to find queue monitor config, disabling. " + e); |
118 |
|
} |
147 |
|
alertMan.start(); |
148 |
|
|
149 |
|
_logger.write(toString(), Logger.SYSINIT, "started"); |
118 |
– |
|
150 |
|
} |
151 |
|
|
152 |
|
/** |
181 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
182 |
|
* method to provide clean logging (every class should have this). |
183 |
|
* |
184 |
< |
* This uses the uk.org.iscream.util.FormatName class |
184 |
> |
* This uses the uk.org.iscream.cms.server.util.FormatName class |
185 |
|
* to format the toString() |
186 |
|
* |
187 |
|
* @return the name of this class and its CVS revision |