1 26 27 package com.opensugar.cube; 28 29 import com.opensugar.cube.ldap.LDAPFilter; 30 31 import org.osgi.framework.Bundle; 32 33 import java.util.Hashtable ; 34 import java.util.Vector ; 35 36 public class ServiceListeners extends ListenerSet { 37 38 private Hashtable filters; 40 41 public ServiceListeners() { 42 super(); 43 filters = new Hashtable (); 44 } 45 46 public synchronized void addListener( Bundle bundle, Object listener, LDAPFilter filter ) { 48 addListener( bundle, listener ); 49 if ( filter == null ) { 50 filters.remove( listener ); 51 } 52 else { 53 filters.put( listener, filter ); 54 } 55 } 56 57 protected synchronized LDAPFilter getFilter( Object listener ) { 58 return (LDAPFilter)filters.get( listener ); 59 } 60 61 } | Popular Tags |