40 |
|
* This method starts the FilterManager |
41 |
|
*/ |
42 |
|
public void start() throws ComponentStartException { |
43 |
< |
|
43 |
> |
// get references to key objects |
44 |
> |
_refman = ReferenceManager.getInstance(); |
45 |
> |
_logger = ReferenceManager.getInstance().getLogger(); |
46 |
> |
|
47 |
|
_logger.write(toString(), Logger.SYSINIT, "coming up"); |
48 |
|
|
49 |
|
// configuration variable we require |
50 |
|
int listenPort = 0; |
51 |
< |
|
51 |
> |
|
52 |
|
Configuration config = _refman.getCM().getConfiguration("FilterManager"); |
53 |
|
if (config == null) { |
54 |
< |
System.err.println("CRITICAL:Unable to obtain configuration" + |
55 |
< |
"\n Advise you check the i-scream log for more information."); |
56 |
< |
_logger.write(toString(), Logger.FATAL, "ERROR - unable to obtain configuration"); |
54 |
< |
System.exit(1); |
55 |
< |
} else { |
54 |
> |
throw new ComponentStartException("Unable to obtain configuration for component"); |
55 |
> |
} |
56 |
> |
else { |
57 |
|
try { |
58 |
+ |
// get the configuration properties we need |
59 |
|
listenPort = Integer.parseInt(config.getProperty("FilterManager.listenPort")); |
60 |
|
} catch (org.omg.CORBA.MARSHAL e) { |
61 |
< |
System.err.println ("CRITICAL:Unable to obtain required configuration property" + |
60 |
< |
"\n Advise you check the i-scream log for more information."); |
61 |
< |
_logger.write(toString(), Logger.FATAL, "ERROR - required configuration property not present"); |
62 |
< |
System.exit(1); |
61 |
> |
throw new ComponentStartException("Unable to obtain requried configuration property for component"); |
62 |
|
} |
63 |
|
} |
64 |
< |
|
64 |
> |
|
65 |
|
_logger.write(toString(), Logger.SYSMSG, "configured"); |
66 |
|
|
67 |
|
// startup a thread to listen for hosts |
108 |
|
* This holds a reference to the |
109 |
|
* system logger that is being used. |
110 |
|
*/ |
111 |
< |
private Logger _logger = ReferenceManager.getInstance().getLogger(); |
111 |
> |
private Logger _logger; |
112 |
|
|
113 |
|
/** |
114 |
|
* A reference to the reference manager in use |
115 |
|
*/ |
116 |
< |
private ReferenceManager _refman = ReferenceManager.getInstance(); |
116 |
> |
private ReferenceManager _refman; |
117 |
|
|
118 |
|
//---STATIC ATTRIBUTES--- |
119 |
|
|