4 |
|
//---IMPORTS--- |
5 |
|
import uk.ac.ukc.iscream.util.*; |
6 |
|
import uk.ac.ukc.iscream.core.*; |
7 |
+ |
import uk.ac.ukc.iscream.componentmanager.*; |
8 |
|
|
9 |
|
/** |
10 |
|
* The FilterManager handles initialisation |
15 |
|
* @author $Author$ |
16 |
|
* @version $Id$ |
17 |
|
*/ |
18 |
< |
public class FilterManager implements uk.ac.ukc.iscream.util.Component { |
18 |
> |
public class FilterManager implements Component { |
19 |
|
|
20 |
|
//---FINAL ATTRIBUTES--- |
21 |
|
|
45 |
|
|
46 |
|
// configuration variable we require |
47 |
|
int listenPort = 0; |
48 |
< |
|
48 |
> |
|
49 |
|
Configuration config = _refman.getCM().getConfiguration("FilterManager"); |
50 |
|
if (config == null) { |
51 |
< |
System.err.println("CRITICAL:Unable to obtain configuration" + |
52 |
< |
"\n Advise you check the i-scream log for more information."); |
53 |
< |
_logger.write(toString(), Logger.FATAL, "ERROR - unable to obtain configuration"); |
53 |
< |
System.exit(1); |
54 |
< |
} else { |
51 |
> |
throw new ComponentStartException("Unable to obtain configuration for component"); |
52 |
> |
} |
53 |
> |
else { |
54 |
|
try { |
55 |
+ |
// get the configuration properties we need |
56 |
|
listenPort = Integer.parseInt(config.getProperty("FilterManager.listenPort")); |
57 |
|
} catch (org.omg.CORBA.MARSHAL e) { |
58 |
< |
System.err.println ("CRITICAL:Unable to obtain required configuration property" + |
59 |
< |
"\n Advise you check the i-scream log for more information."); |
60 |
< |
_logger.write(toString(), Logger.FATAL, "ERROR - required configuration property not present"); |
61 |
< |
System.exit(1); |
58 |
> |
throw new ComponentStartException("Unable to obtain requried configuration property for component"); |
59 |
|
} |
60 |
|
} |
61 |
< |
|
61 |
> |
|
62 |
|
_logger.write(toString(), Logger.SYSMSG, "configured"); |
63 |
|
|
64 |
+ |
// startup a thread to listen for hosts |
65 |
|
HostListener hostListener = new HostListener(listenPort); |
66 |
|
hostListener.start(); |
67 |
|
|