} catch (ClassNotFoundException e) {
error("No such class: " + aclazz);
return;
}
EventListener lis = null;
// if extra params
// load class and find constructor that takes one String as parameter
try {
// create Listener
lis = (EventListener) liscls.newInstance();
//} catch (NoSuchMethodException e) {
// error("No constructor for extra parameters found: " + liscls);
// return;
} catch (InstantiationException e) {
error("Could not instantiate class: " + liscls);
return;
} catch (IllegalAccessException e) {
error("Not allowed to instantiate class: " + liscls);
return;
}
String origin = ec.produceOrigin(compName);
// register it with the pattern
ec.registerEventListener(origin, lis, patterns);
BufferObjectWriter boo = new BufferObjectWriter(getStdOut());
boo.writeObject(origin);
boo.flush();
}
break;
case LIST:
{
Iterator it = ec.listenersIterator();
while (it.hasNext()) {
Map.Entry ent = (Map.Entry) it.next();
Object key = ent.getKey();
Object val = ent.getValue();
err.println(key + " = " + val);
}
}
break;
case DELETE:
{
// find listener whose string representation equals
// then call unregister
Iterator it = ec.listenersIterator();
EventListener lis = null;
while (it.hasNext()) {
Map.Entry ent = (Map.Entry) it.next();
lis = (EventListener) ent.getKey();
if (String.valueOf(lis).equals(dlisStr)) break;