AbstractAimSession.java :  » Messenger » joscar » net » kano » joustsim » oscar » Java Open Source

Java Open Source » Messenger » joscar 
joscar » net » kano » joustsim » oscar » AbstractAimSession.java
package net.kano.joustsim.oscar;

import net.kano.joscar.CopyOnWriteArrayList;

public abstract class AbstractAimSession implements AimSession {
  private CopyOnWriteArrayList<AimSessionListener> listeners
      = new CopyOnWriteArrayList<AimSessionListener>();

  protected void fireOpenedConnection(AimConnection conn) {
    for (AimSessionListener l : listeners) {
      l.handleOpenedConnection(this, conn);
    }
  }

  public void addSessionListener(AimSessionListener listener) {
    listeners.addIfAbsent(listener);
  }

  public void removeSessionListener(AimSessionListener listener) {
    listeners.remove(listener);
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.