1 23 24 package com.sun.enterprise.admin.jmx.remote.notification; 25 26 import javax.management.*; 27 28 34 public class ListenerInfo { 35 public Object proxy = null; 36 public NotificationListener listener = null; 37 public NotificationFilter filter = null; 38 public Object handback = null; 39 public String id = null; 40 41 public ListenerInfo() { 42 } 43 44 public ListenerInfo(NotificationListener listener, NotificationFilter filter, Object handback) { 45 this.listener = listener; 46 this.filter = filter; 47 this.handback = handback; 48 id = computeId(); 49 } 50 51 56 public String computeId() { 57 String listenerCode = "null"; 58 if (listener != null) 59 listenerCode = Integer.toString(listener.hashCode()); 60 String filterCode = "null"; 61 if (filter != null) 62 filterCode = Integer.toString(filter.hashCode()); 63 String handbackCode = "null"; 64 if (handback != null) 65 handbackCode = Integer.toString(handback.hashCode()); 66 return ( listenerCode + ":" + filterCode + ":" + handbackCode ); 67 } 68 } 69 70 | Popular Tags |