31
31
32
32
import org .apache .geode .CancelException ;
33
33
import org .apache .geode .SystemFailure ;
34
- import org .apache .geode .cache .CacheFactory ;
35
34
import org .apache .geode .cache .client .PoolManager ;
36
35
import org .apache .geode .cache .client .internal .PoolImpl ;
37
36
import org .apache .geode .cache .server .CacheServer ;
@@ -217,14 +216,14 @@ public static void unregisterAllListeners() {
217
216
*
218
217
*
219
218
*/
220
- public static Map getConnectedClients (boolean onlyClientsNotifiedByThisServer ) {
219
+ public static Map getConnectedClients (boolean onlyClientsNotifiedByThisServer ,
220
+ InternalCache cache ) {
221
221
ClientHealthMonitor chMon = ClientHealthMonitor .getInstance ();
222
222
Set filterProxyIDs = null ;
223
223
if (onlyClientsNotifiedByThisServer ) {
224
224
// Note it is not necessary to synchronize on the list of Client servers here,
225
225
// since this is only a status (snapshot) of the system.
226
- for (Iterator bsii = CacheFactory .getAnyInstance ().getCacheServers ().iterator (); bsii
227
- .hasNext ();) {
226
+ for (Iterator bsii = cache .getCacheServers ().iterator (); bsii .hasNext ();) {
228
227
CacheServerImpl bsi = (CacheServerImpl ) bsii .next ();
229
228
AcceptorImpl ai = bsi .getAcceptor ();
230
229
if (ai != null && ai .getCacheClientNotifier () != null ) {
@@ -269,12 +268,11 @@ public static Map getStatusForAllClientsIgnoreSubscriptionStatus() {
269
268
*
270
269
* @return all the clients
271
270
*/
272
- public static Map getConnectedClients () {
271
+ public static Map getConnectedClients (InternalCache cache ) {
273
272
274
273
// Get all clients
275
274
Map allClients = new HashMap ();
276
- for (Iterator bsii = CacheFactory .getAnyInstance ().getCacheServers ().iterator (); bsii
277
- .hasNext ();) {
275
+ for (Iterator bsii = cache .getCacheServers ().iterator (); bsii .hasNext ();) {
278
276
CacheServerImpl bsi = (CacheServerImpl ) bsii .next ();
279
277
AcceptorImpl ai = bsi .getAcceptor ();
280
278
if (ai != null && ai .getCacheClientNotifier () != null ) {
@@ -289,10 +287,6 @@ public static Map getConnectedClients() {
289
287
return allClients ;
290
288
}
291
289
292
- public static Map getClientQueueSizes () {
293
- return getClientQueueSizes ((InternalCache ) CacheFactory .getAnyInstance ());
294
- }
295
-
296
290
public static Map getClientQueueSizes (final InternalCache cache ) {
297
291
if (cache == null ) {
298
292
return Collections .emptyMap ();
0 commit comments