* @exception RuntimeException if an error occurs
*/
private Object get(int op, String name, String attr, Map objectModel) throws RuntimeException {
Object value = null;
InputModule input = null;
Configuration conf = null;
if (this.inputModules == null)
this.inputModules = new HashMap();
else
if (this.inputModules.containsKey(name))
input = (InputModule) this.inputModules.get(name);
try {
if (this.inputSelector == null)
this.inputSelector = (ComponentSelector) this.manager.lookup(INPUT_MODULE_SELECTOR);
if (input == null) {
if (this.inputSelector.hasComponent(name)) {
input = (InputModule) this.inputSelector.select(name);
this.inputModules.put(name, input);
} else {
throw new RuntimeException("No such InputModule: "+name);
}
}
switch (op) {
case OP_GET:
value = input.getAttribute(attr, conf, objectModel);
break;
case OP_VALUES:
value = input.getAttributeValues(attr, conf, objectModel);
break;
case OP_NAMES:
value = input.getAttributeNames(conf, objectModel);
break;
};
} catch (Exception e) {
throw new CascadingRuntimeException("A problem obtaining a value from "+name+" occurred",e);