98
99 // package private; used by EventSupport; namingListener already synchronized
100 void removeNamingListener(NamingListener l) {
101 namingListeners.removeElement(l);
102 }
103
104 // package private; used by EventSupport; namingListener already synchronized
105 boolean hasNamingListeners() {
106 return namingListeners.size() > 0;
107 }
108
109 /**
110 * Execute "persistent search".
111 * For each result, create the appropriate NamingEvent and
112 * queue to be dispatched to listeners.
113 */
114 public void run() {
115 try {
116 Continuation cont = new Continuation();
117 cont.setError(this, info.name);
118 Name nm = (info.name == null || info.name.equals("")) ?
119 new CompositeName() : new CompositeName().add(info.name);
120
121 results = context.searchAux(nm, info.filter, info.controls,
122 true, false, cont);
123
124 // Change root of search results so that it will generate
125 // names relative to the event context instead of that
126 // named by nm
127 ((LdapSearchEnumeration)(NamingEnumeration)results)
128 .setStartName(context.currentParsedDN);
129
130 SearchResult si;
131 Control[] respctls;
132 EntryChangeResponseControl ec;
133 long changeNum;
134
135 while (results.hasMore()) {
136 si = results.next();
137 respctls = (si instanceof HasControls) ?
138 ((HasControls) si).getControls() : null;
|
98
99 // package private; used by EventSupport; namingListener already synchronized
100 void removeNamingListener(NamingListener l) {
101 namingListeners.removeElement(l);
102 }
103
104 // package private; used by EventSupport; namingListener already synchronized
105 boolean hasNamingListeners() {
106 return namingListeners.size() > 0;
107 }
108
109 /**
110 * Execute "persistent search".
111 * For each result, create the appropriate NamingEvent and
112 * queue to be dispatched to listeners.
113 */
114 public void run() {
115 try {
116 Continuation cont = new Continuation();
117 cont.setError(this, info.name);
118 Name nm = (info.name == null || info.name.isEmpty()) ?
119 new CompositeName() : new CompositeName().add(info.name);
120
121 results = context.searchAux(nm, info.filter, info.controls,
122 true, false, cont);
123
124 // Change root of search results so that it will generate
125 // names relative to the event context instead of that
126 // named by nm
127 ((LdapSearchEnumeration)(NamingEnumeration)results)
128 .setStartName(context.currentParsedDN);
129
130 SearchResult si;
131 Control[] respctls;
132 EntryChangeResponseControl ec;
133 long changeNum;
134
135 while (results.hasMore()) {
136 si = results.next();
137 respctls = (si instanceof HasControls) ?
138 ((HasControls) si).getControls() : null;
|