ListenerRegistration registration = null;
synchronized(listeners)
{
ArrayList registrations = (ArrayList) listeners.get(listener);
if (registrations == null)
throw new ListenerNotFoundException("No registristrations for listener not listener=" + listener +
" filter=" + filter + " handback=" + handback);
registration = new DefaultListenerRegistration(listener, filter, handback);
int index = registrations.indexOf(registration);
if (index == -1)
throw new ListenerNotFoundException("Listener not found listener=" + listener +
" filter=" + filter + " handback=" + handback);
HashMap newListeners = (HashMap) listeners.clone();
registrations = (ArrayList) registrations.clone();