1 30 31 34 package com.nightlabs.notification; 35 36 import java.lang.ref.WeakReference ; 37 38 41 public class NotificationListenerMeta 42 { 43 private String zone; 44 private Class subjectClass; 45 private WeakReference notificationListenerRef; 46 private String notificationMode; 47 private int counter; 48 49 public NotificationListenerMeta(String zone, Class subjectClass, NotificationListener listener, String notificationMode) 56 { 57 this.zone = zone; 58 this.subjectClass = subjectClass; 59 this.notificationListenerRef = new WeakReference (listener); 60 this.notificationMode = notificationMode; 61 } 62 65 public String getZone() 66 { 67 return zone; 68 } 69 72 public Class getSubjectClass() 73 { 74 return subjectClass; 75 } 76 79 public String getNotificationMode() 80 { 81 return notificationMode; 82 } 83 86 public NotificationListener getNotificationListener() 87 { 88 return (NotificationListener) notificationListenerRef.get(); 89 } 90 93 public int getCounter() 94 { 95 return counter; 96 } 97 98 public int incCounter() 99 { 100 return ++counter; 101 } 102 103 public int decCounter() 104 { 105 return --counter; 106 } 107 108 } 109 | Popular Tags |