01: package com.ibm.emb.meb.listener;
02:
03: import javax.emb.ListenerVetoException;
04: import javax.emb.MediaEntityLocal;
05: import javax.emb.MediaException;
06: import javax.emb.MediaListener;
07:
08: /**
09: * This generic implementation of the MediaListener interface is only used for
10: * testing purposes.
11: */
12: public final class RemoveListener implements MediaListener {
13:
14: /**
15: *
16: */
17: private static final long serialVersionUID = 3977298806821959991L;
18:
19: public RemoveListener() {
20: super ();
21: }
22:
23: public void handleAboutToChangeMediaEntity(MediaEntityLocal meb,
24: String propertyName) throws MediaException {
25: if (propertyName == null) {
26: throw new NullPointerException("property name was null");
27: }
28: if (meb == null) {
29: throw new NullPointerException("meb was null");
30: }
31: }
32:
33: public void handleMediaEntityChanged(MediaEntityLocal meb,
34: String propertyName) throws MediaException {
35: if (propertyName == null) {
36: throw new NullPointerException("property name was null");
37: }
38: if (meb == null) {
39: throw new NullPointerException("meb was null");
40: }
41: }
42:
43: public void handleAboutToRemoveMediaEntity(
44: MediaEntityLocal mediaEntity) throws MediaException {
45: if (mediaEntity == null)
46: throw new NullPointerException("media entity is null");
47: throw new ListenerVetoException("will not allow this remove");
48: }
49:
50: public boolean equals(Object obj) {
51: if (obj instanceof RemoveListener)
52: return true;
53: return false;
54: }
55:
56: public int hashCode() {
57: return 1;
58: }
59:
60: }
|