42 |
|
* Starts the Filter component |
43 |
|
*/ |
44 |
|
public void start() throws ComponentStartException { |
45 |
< |
|
45 |
> |
// get references to key objects |
46 |
> |
_refman = ReferenceManager.getInstance(); |
47 |
> |
_logger = ReferenceManager.getInstance().getLogger(); |
48 |
> |
|
49 |
|
_logger.write(toString(), Logger.SYSINIT, "coming up"); |
50 |
|
|
51 |
|
// configuration variables we require |
52 |
|
int UDPListenPort = 0; |
53 |
|
int TCPListenPort = 0; |
54 |
|
String parentFilterName = null; |
55 |
+ |
int queueMonitorInterval = 0; |
56 |
|
|
57 |
|
Configuration config = _refman.getCM().getConfiguration(FilterMain.NAME); |
58 |
|
if (config == null) { |
64 |
|
UDPListenPort = Integer.parseInt(config.getProperty("Filter.UDPListenPort")); |
65 |
|
TCPListenPort = Integer.parseInt(config.getProperty("Filter.TCPListenPort")); |
66 |
|
parentFilterName = config.getProperty("Filter.parentFilter"); |
67 |
+ |
queueMonitorInterval = Integer.parseInt(config.getProperty("Queue.MonitorInterval")); |
68 |
|
} catch (org.omg.CORBA.MARSHAL e) { |
69 |
|
throw new ComponentStartException("Unable to obtain requried configuration property for component"); |
70 |
|
} |
77 |
|
|
78 |
|
// setup a queue |
79 |
|
Queue queue = new Queue(); |
80 |
+ |
// startup a monitor on this queue, every minute |
81 |
+ |
String queueName = NAME + " Filter"; |
82 |
+ |
queue.startMonitor(queueMonitorInterval*1000, queueName); |
83 |
|
|
84 |
|
// Start a filter thread |
85 |
|
_logger.write(toString(), Logger.SYSINIT, "starting Filter Thread / Queue consumer"); |
130 |
|
* This holds a reference to the |
131 |
|
* system logger that is being used. |
132 |
|
*/ |
133 |
< |
private Logger _logger = ReferenceManager.getInstance().getLogger(); |
133 |
> |
private Logger _logger; |
134 |
|
|
135 |
|
/** |
136 |
|
* A reference to the reference manager in use |
137 |
|
*/ |
138 |
< |
private ReferenceManager _refman = ReferenceManager.getInstance(); |
138 |
> |
private ReferenceManager _refman; |
139 |
|
|
140 |
|
//---STATIC ATTRIBUTES--- |
141 |
|
|
146 |
|
*/ |
147 |
|
public static String NAME; |
148 |
|
|
149 |
< |
} |
149 |
> |
} |