FileDocCategorySizeDatePackage
BasicDataSink.javaAPI DocJMF 2.1.1e1268Mon May 12 12:21:00 BST 2003com.sun.media.datasink

BasicDataSink

public abstract class BasicDataSink extends Object implements DataSink

Fields Summary
protected Vector
listeners
Constructors Summary
Methods Summary
public voidaddDataSinkListener(javax.media.datasink.DataSinkListener dsl)

    
        
	if (dsl != null)
	    if (!listeners.contains(dsl))
		listeners.addElement(dsl);
    
protected voidremoveAllListeners()

	listeners.removeAllElements();
    
public voidremoveDataSinkListener(javax.media.datasink.DataSinkListener dsl)

	if (dsl != null)
	    listeners.removeElement(dsl);
    
protected final voidsendDataSinkErrorEvent(java.lang.String reason)

	sendEvent(new DataSinkErrorEvent(this, reason));
    
protected final voidsendEndofStreamEvent()

	sendEvent(new EndOfStreamEvent(this));
    
protected voidsendEvent(javax.media.datasink.DataSinkEvent event)

	if (!listeners.isEmpty()) {
	    synchronized (listeners) {
		Enumeration list = listeners.elements();
		while (list.hasMoreElements()) {
		    DataSinkListener listener = (DataSinkListener)list.nextElement();
		    listener.dataSinkUpdate(event);
		}
	    }
	}