1 |
+ |
/* |
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 |
|
//---PACKAGE DECLARATION--- |
21 |
< |
package uk.ac.ukc.iscream.core; |
21 |
> |
package uk.org.iscream.cms.server.core; |
22 |
|
|
23 |
|
//---IMPORTS--- |
24 |
< |
import uk.ac.ukc.iscream.util.*; |
24 |
> |
import uk.org.iscream.cms.server.util.*; |
25 |
> |
import uk.org.iscream.cms.server.componentmanager.*; |
26 |
|
|
27 |
|
/** |
28 |
|
* The main class for the CORE of the I-Scream system. |
35 |
|
* @author $Author$ |
36 |
|
* @version $Id$ |
37 |
|
*/ |
38 |
< |
public class Core implements uk.ac.ukc.iscream.util.Component { |
38 |
> |
public class Core implements Component { |
39 |
|
|
40 |
|
//---FINAL ATTRIBUTES--- |
41 |
|
|
45 |
|
public static final String REVISION = "$Revision$"; |
46 |
|
|
47 |
|
/** |
48 |
< |
* The friendly name for the Core, used by |
48 |
> |
* The friendly name for this component, used by |
49 |
|
* all related classes. |
50 |
|
*/ |
51 |
< |
public static final String NAME = "CORE"; |
51 |
> |
public static final String NAME = "Core"; |
52 |
|
|
53 |
|
//---STATIC METHODS--- |
54 |
|
|
61 |
|
* Currently the args are passed direct to the ORB, |
62 |
|
* so any ORB paramaters could go there. |
63 |
|
* |
44 |
– |
* @param args the command line arguments |
64 |
|
*/ |
65 |
|
public void start() throws ComponentStartException { |
66 |
|
// start and bind each server in turn |
67 |
|
|
68 |
|
// work out which logger to use |
69 |
< |
String whichLogger = System.getProperty("uk.ac.ukc.iscream.LoggerClass"); |
70 |
< |
String loggerPackage = System.getProperty("uk.ac.ukc.iscream.LoggerPackage"); |
69 |
> |
String whichLogger = System.getProperty("uk.org.iscream.cms.server.LoggerClass"); |
70 |
> |
String loggerPackage = System.getProperty("uk.org.iscream.cms.server.LoggerPackage"); |
71 |
|
|
72 |
|
// construct the relevant LoggerImpl |
73 |
|
LoggerImpl loggerImplRef = null; |
77 |
|
// if anything goes wrong we throw a failed start exception |
78 |
|
throw new ComponentStartException("unable to load logging class"); |
79 |
|
} |
80 |
< |
|
80 |
> |
|
81 |
|
// setup and bind the LoggerServant |
82 |
|
LoggerServant loggerRef = new LoggerServant(loggerImplRef); |
83 |
|
_refman.bindToOrb(loggerRef, "iscream.Logger"); |
95 |
|
} |
96 |
|
|
97 |
|
/** |
98 |
+ |
* Does a dependency check. Used mainly at startup to |
99 |
+ |
* see if the required dependencies (components) are up |
100 |
+ |
* and running. |
101 |
+ |
* |
102 |
+ |
* @return a boolean value, true if the depdencies are satisfied |
103 |
+ |
*/ |
104 |
+ |
public boolean depCheck() { |
105 |
+ |
// the core has no depedencies |
106 |
+ |
return true; |
107 |
+ |
} |
108 |
+ |
|
109 |
+ |
/** |
110 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
111 |
|
* method to provide clean logging (every class should have this). |
112 |
|
* |
113 |
< |
* This uses the uk.ac.ukc.iscream.util.NameFormat class |
113 |
> |
* This uses the uk.org.iscream.cms.server.util.NameFormat class |
114 |
|
* to format the toString() |
115 |
|
* |
116 |
|
* @return the name of this class and its CVS revision |
118 |
|
public String toString() { |
119 |
|
return FormatName.getName( |
120 |
|
_name, |
121 |
< |
this.getClass().getName(), |
121 |
> |
getClass().getName(), |
122 |
|
REVISION); |
123 |
|
} |
124 |
|
|