1 |
|
|
2 |
|
//---PACKAGE DECLARATION--- |
3 |
< |
package uk.ac.ukc.iscream.rootfilter; |
3 |
> |
package uk.org.iscream.rootfilter; |
4 |
|
|
5 |
|
//---IMPORTS--- |
6 |
< |
import uk.ac.ukc.iscream.util.*; |
7 |
< |
import uk.ac.ukc.iscream.core.*; |
8 |
< |
import uk.ac.ukc.iscream.componentmanager.*; |
9 |
< |
import uk.ac.ukc.iscream.clientinterface.*; |
6 |
> |
import uk.org.iscream.util.*; |
7 |
> |
import uk.org.iscream.core.*; |
8 |
> |
import uk.org.iscream.componentmanager.*; |
9 |
> |
import uk.org.iscream.clientinterface.*; |
10 |
|
|
11 |
|
/** |
12 |
|
* The root filter is what all filters talk to |
74 |
|
if (dbInterface != null) { |
75 |
|
ciDB = ClientInterfaceHelper.narrow(_refman.getCORBARef("iscream.ClientInterface." + dbInterface)); |
76 |
|
} |
77 |
< |
|
77 |
> |
|
78 |
|
// setup a queue |
79 |
< |
Queue queue = new Queue(); |
79 |
> |
Queue queue; |
80 |
> |
// see if this Queue needs a size limit |
81 |
> |
try { |
82 |
> |
int queueSizeLimit = Integer.parseInt(cp.getProperty(configName, "Queue.SizeLimit")); |
83 |
> |
String queueRemoveAlgorithm = cp.getProperty(configName, "Queue.RemoveAlgorithm"); |
84 |
> |
int algorithm = StringUtils.getStringPos(queueRemoveAlgorithm, Queue.algorithms); |
85 |
> |
if(algorithm != -1) { |
86 |
> |
_logger.write(toString(), Logger.DEBUG, "Starting Queue with size limit of "+queueSizeLimit+", using remove algorithm "+queueRemoveAlgorithm); |
87 |
> |
// we have valid values, so lets start it. |
88 |
> |
queue = new Queue(queueSizeLimit, algorithm); |
89 |
> |
} |
90 |
> |
else { |
91 |
> |
_logger.write(toString(), Logger.WARNING, "Bad Queue Algorithm configuration, not known: "+queueRemoveAlgorithm); |
92 |
> |
// just don't activate a limit |
93 |
> |
queue = new Queue(); |
94 |
> |
} |
95 |
> |
|
96 |
> |
} catch (PropertyNotFoundException e) { |
97 |
> |
_logger.write(toString(), Logger.DEBUG, "Optional config not set: "+e); |
98 |
> |
// just don't activate a limit |
99 |
> |
queue = new Queue(); |
100 |
> |
} catch (NumberFormatException e) { |
101 |
> |
_logger.write(toString(), Logger.WARNING, "Bad Queue SizeLimit configuration: "+e); |
102 |
> |
// just don't activate a limit |
103 |
> |
queue = new Queue(); |
104 |
> |
} |
105 |
|
|
106 |
|
// startup a monitor on this queue |
107 |
|
try { |
159 |
|
obj = _refman.getCORBARef("iscream.ClientInterface." + cli); |
160 |
|
obj = _refman.getCORBARef("iscream.ClientInterface." + dbi); |
161 |
|
} catch(ComponentCORBAException e) { |
162 |
< |
_logger.write(toString(), Logger.WARNING, "Dependency Failure: "+e); |
162 |
> |
System.err.println(toString() + ": Dependency Failure: "+e); |
163 |
|
return false; |
164 |
|
} catch(PropertyNotFoundException e) { |
165 |
< |
_logger.write(toString(), Logger.WARNING, "Unable to obtain configuration: "+e); |
165 |
> |
System.err.println(toString() + ": Unable to obtain configuration: "+e); |
166 |
|
return false; |
167 |
|
} |
168 |
|
// dependency check suceeded |
173 |
|
* Overrides the {@link java.lang.Object#toString() Object.toString()} |
174 |
|
* method to provide clean logging (every class should have this). |
175 |
|
* |
176 |
< |
* This uses the uk.ac.ukc.iscream.util.NameFormat class |
176 |
> |
* This uses the uk.org.iscream.util.NameFormat class |
177 |
|
* to format the toString() |
178 |
|
* |
179 |
|
* @return the name of this class and its CVS revision |