javax.emb
Interface MediaListener

All Superinterfaces:
java.io.Serializable

public interface MediaListener
extends java.io.Serializable

This interface defines the common behavior of media listener. Such observers are implemented by application programmers to be persisted with and extend the semantics of media entity EJBs in a way that does not depend on the implementation of the latter. Listeners are notified of specific events in media entity EJBs once they are registered with said. As they have to be persisted with media entity EJBs, all listeners must be serializable.

The persistent observer design differs from the standard Java listener practice by passing the name of properties affected instead of passing the property value to distinct callback methods. The reason for this is that the large size of media content makes it practically impossible to pass it to observers. Therefore, observers are forced to retrieve property values from entity beans when there is a need. Please note that Entity Beans must be deployed as reentrant in order for the latter to work.


Method Summary
 boolean equals(java.lang.Object object)
          This method overwrites the matching method in java.lang.Object.
 void handleAboutToChangeMediaEntity(MediaEntityLocal (src)  mediaEntity, java.lang.String propertyName)
          This method handles the fact that the given media entity is about to change the value of its property named propertyName.
 void handleAboutToRemoveMediaEntity(MediaEntityLocal (src)  mediaEntity)
          This method handles the fact that the given media entity is about to be removed.
 void handleMediaEntityChanged(MediaEntityLocal (src)  mediaEntity, java.lang.String propertyName)
          This method handles the fact that the given media entity has changed the value of its property named propertyName.
 int hashCode()
          This method overwrites the matching method in java.lang.Object.
 

Method Detail

handleAboutToChangeMediaEntity

public void handleAboutToChangeMediaEntity(MediaEntityLocal (src)  mediaEntity,
                                           java.lang.String propertyName)
                                    throws MediaException (src) 
This method handles the fact that the given media entity is about to change the value of its property named propertyName. Valid property names are "content", "location", "mimeType", "name" and "description".

Parameters:
mediaEntity - media entity.
propertyName - prppoerty name.
Throws:
ListenerVetoException (src) - if the listener does not agree to the intended change.
MediaException (src) - if there's an application specific problem.
java.lang.NullPointerException - is thrown if one of the values passed is null.

handleAboutToRemoveMediaEntity

public void handleAboutToRemoveMediaEntity(MediaEntityLocal (src)  mediaEntity)
                                    throws MediaException (src) 
This method handles the fact that the given media entity is about to be removed.

Parameters:
mediaEntity - media entity.
Throws:
ListenerVetoException (src) - if the listener does not agree to the intended removal.
MediaException (src) - if there's an application specific problem.
java.lang.NullPointerException - if the value passed is null.

handleMediaEntityChanged

public void handleMediaEntityChanged(MediaEntityLocal (src)  mediaEntity,
                                     java.lang.String propertyName)
                              throws MediaException (src) 
This method handles the fact that the given media entity has changed the value of its property named propertyName. Valid property names are "content", "location", "mimeType", "name" and "description".

Parameters:
mediaEntity - media entity.
propertyName - property name.
Throws:
ListenerVetoException (src) - if the listener does not agree to the change performed.
MediaException (src) - if there's an application specific problem.
java.lang.NullPointerException - if one of the values passed is null.

equals

public boolean equals(java.lang.Object object)
This method overwrites the matching method in java.lang.Object. The result is true if the given object is a MediaListener and it is content equal to the receiver, otherwise false. Note that this behavior is required as listeners are stored and loaded as part of EJB operations and therefore frequently change their object identity.

Parameters:
object - object.

hashCode

public int hashCode()
This method overwrites the matching method in java.lang.Object. The resulting hash code is calculated based on the receiver's content. Note that this behavior is required as listeners are stored and loaded as part of EJB operations and therefore frequently change their object identity.

Returns:
hashcode.