/** * Add the event and vector of listeners to the queue to be delivered. * * @param event the event * @param vector the vector of listeners */ protected void queueEvent(MailEvent event, Vector vector) { /* * Copy the vector in order to freeze the state of the set * of EventListeners the event should be delivered to prior * to delivery. This ensures that any changes made to the * Vector from a target listener's method during the delivery * of this event will not take effect until after the event is * delivered. */ Vector v = (Vector) vector.clone(); q.enqueue(event, v); }