Adds .service.neomedia.AbstractMediaStream to take on the base functionality of MediaStream which is likely to be common for most implementations.

cusax-fix
Lyubomir Marinov 17 years ago
parent ea47d25602
commit e2395586e4

@ -0,0 +1,67 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.service.neomedia;
import net.java.sip.communicator.util.*;
/**
* Abstract base implementation of <tt>MediaStream</tt> to ease the
* implementation of the interface.
*
* @author Lubomir Marinov
*/
public abstract class AbstractMediaStream
implements MediaStream
{
/**
* The delegate of this instance which implements support for property
* change notifications for its
* {@link #addPropertyChangeListener(PropertyChangeListener)} and
* {@link #removePropertyChangeListener(PropertyChangeListener)}.
*/
private final PropertyChangeSupport propertyChangeSupport
= new PropertyChangeSupport(this);
/*
* Implements MediaStream#addPropertyChangeListener(PropertyChangeListener).
*/
public void addPropertyChangeListener(PropertyChangeListener listener)
{
propertyChangeSupport.addPropertyChangeListener(listener);
}
/**
* Fires a new <tt>PropertyChangeEvent</tt> to the
* <tt>PropertyChangeListener</tt>s registered with this instance in order
* to notify about a change in the value of a specific property which had
* its old value modified to a specific new value.
*
* @param property the name of the property of this instance which had its
* value changed
* @param oldValue the value of the property with the specified name before
* the change
* @param newValue the value of the property with the specified name after
* the change
*/
protected void firePropertyChange(
String property,
Object oldValue,
Object newValue)
{
propertyChangeSupport.firePropertyChange(property, oldValue, newValue);
}
/*
* Implements
* MediaStream#removePropertyChangeListener(PropertyChangeListener).
*/
public void removePropertyChangeListener(PropertyChangeListener listener)
{
propertyChangeSupport.removePropertyChangeListener(listener);
}
}
Loading…
Cancel
Save