/
PoolManagerImpl.java
654 lines (556 loc) · 24.6 KB
/
PoolManagerImpl.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
/*
* Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package com.sun.enterprise.resource.pool;
import static java.util.logging.Level.FINE;
import static java.util.logging.Level.INFO;
import static java.util.logging.Level.SEVERE;
import static java.util.logging.Level.WARNING;
import static javax.transaction.xa.XAResource.TMSUCCESS;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.glassfish.api.invocation.ComponentInvocation;
import org.glassfish.api.invocation.ComponentInvocationHandler;
import org.glassfish.api.invocation.InvocationException;
import org.glassfish.api.naming.SimpleJndiName;
import org.glassfish.resourcebase.resources.api.PoolInfo;
import org.jvnet.hk2.annotations.Service;
import com.sun.appserv.connectors.internal.api.ConnectorConstants.PoolType;
import com.sun.appserv.connectors.internal.api.ConnectorRuntime;
import com.sun.appserv.connectors.internal.api.PoolingException;
import com.sun.appserv.connectors.internal.spi.MCFLifecycleListener;
import com.sun.enterprise.connectors.ConnectorConnectionPool;
import com.sun.enterprise.connectors.ConnectorRegistry;
import com.sun.enterprise.deployment.ResourceReferenceDescriptor;
import com.sun.enterprise.resource.ClientSecurityInfo;
import com.sun.enterprise.resource.ResourceHandle;
import com.sun.enterprise.resource.ResourceSpec;
import com.sun.enterprise.resource.allocator.ResourceAllocator;
import com.sun.enterprise.resource.listener.PoolLifeCycle;
import com.sun.enterprise.resource.rm.LazyEnlistableResourceManagerImpl;
import com.sun.enterprise.resource.rm.NoTxResourceManagerImpl;
import com.sun.enterprise.resource.rm.ResourceManager;
import com.sun.enterprise.resource.rm.ResourceManagerImpl;
import com.sun.enterprise.resource.rm.SystemResourceManagerImpl;
import com.sun.enterprise.transaction.api.JavaEETransaction;
import com.sun.enterprise.transaction.api.JavaEETransactionManager;
import com.sun.logging.LogDomains;
import jakarta.inject.Inject;
import jakarta.inject.Provider;
import jakarta.resource.ResourceException;
import jakarta.resource.spi.DissociatableManagedConnection;
import jakarta.resource.spi.ManagedConnection;
import jakarta.resource.spi.ManagedConnectionFactory;
import jakarta.resource.spi.RetryableUnavailableException;
import jakarta.transaction.Synchronization;
import jakarta.transaction.Transaction;
/**
* @author Tony Ng, Aditya Gore
*/
@Service
public class PoolManagerImpl extends AbstractPoolManager implements ComponentInvocationHandler {
private static final Logger LOG = LogDomains.getLogger(PoolManagerImpl.class, LogDomains.RSR_LOGGER);
private final ConcurrentHashMap<PoolInfo, ResourcePool> poolTable;
private final ResourceManager resourceManager;
private final ResourceManager sysResourceManager;
private final ResourceManager noTxResourceManager;
private final LazyEnlistableResourceManagerImpl lazyEnlistableResourceManager;
@Inject
private Provider<ConnectorRuntime> connectorRuntimeProvider;
private ConnectorRuntime runtime;
private PoolLifeCycle listener;
public PoolManagerImpl() {
this.poolTable = new ConcurrentHashMap<>();
resourceManager = new ResourceManagerImpl();
sysResourceManager = new SystemResourceManagerImpl();
noTxResourceManager = new NoTxResourceManagerImpl();
lazyEnlistableResourceManager = new LazyEnlistableResourceManagerImpl();
}
@Override
public void createEmptyConnectionPool(PoolInfo poolInfo, PoolType pooltype, Hashtable env) throws PoolingException {
// Create and initialise the connection pool
createAndInitPool(poolInfo, pooltype, env);
// notify mcf-create
ManagedConnectionFactory managedConnectionFactory = ConnectorRegistry.getInstance().getManagedConnectionFactory(poolInfo);
if (managedConnectionFactory != null) {
if (managedConnectionFactory instanceof MCFLifecycleListener) {
((MCFLifecycleListener) managedConnectionFactory).mcfCreated();
}
}
if (listener != null) {
try {
listener.poolCreated(poolInfo);
} catch (RuntimeException ex) {
LOG.log(SEVERE, "Listener " + listener + " failed for " + poolInfo, ex);
}
}
}
/**
* Create and initialize pool if not created already.
*
* @param poolInfo Name of the pool to be created
* @param poolType - PoolType
* @return ResourcePool - newly created pool
* @throws PoolingException when unable to create/initialize pool
*/
private ResourcePool createAndInitPool(final PoolInfo poolInfo, PoolType poolType, Hashtable env) throws PoolingException {
ResourcePool pool = getPool(poolInfo);
if (pool == null) {
pool = ResourcePoolFactoryImpl.newInstance(poolInfo, poolType, env);
addPool(pool);
LOG.log(INFO, "Created connection pool and added it to PoolManager: {0}", pool);
}
return pool;
}
// invoked by DataSource objects to obtain a connection
@Override
public Object getResource(ResourceSpec resourceSpec, ResourceAllocator resourceAllocator, ClientSecurityInfo clientSecurityInfo) throws PoolingException, RetryableUnavailableException {
Transaction transaction = null;
boolean transactional = resourceAllocator.isTransactional();
if (transactional) {
transaction = getResourceManager(resourceSpec).getTransaction();
}
ResourceHandle resourceHandle = getResourceFromPool(resourceSpec, resourceAllocator, clientSecurityInfo, transaction);
if (!resourceHandle.supportsLazyAssociation()) {
resourceSpec.setLazyAssociatable(false);
}
if (resourceSpec.isLazyAssociatable() && resourceSpec.getConnectionToAssociate() != null) {
// If getConnectionToAssociate returns a connection that means
// we need to associate a new connection with it
try {
Object connection = resourceSpec.getConnectionToAssociate();
ManagedConnection managedConnection = (ManagedConnection) resourceHandle.getResource();
managedConnection.associateConnection(connection);
} catch (ResourceException e) {
putbackDirectToPool(resourceHandle, resourceSpec.getPoolInfo());
throw new PoolingException(e.getMessage(), e);
}
}
// If the ResourceAdapter does not support lazy enlistment we cannot either
if (!resourceHandle.supportsLazyEnlistment()) {
resourceSpec.setLazyEnlistable(false);
}
resourceHandle.setResourceSpec(resourceSpec);
try {
if (resourceHandle.getResourceState().isUnenlisted()) {
// The spec being used here is the spec with the updated lazy enlistment info.
// Here's the real place where we care about the correct resource manager
// (which in turn depends upon the ResourceSpec)
// and that's because if lazy enlistment needs to be done we need to get the
// LazyEnlistableResourceManager
getResourceManager(resourceSpec).enlistResource(resourceHandle);
}
} catch (Exception e) {
// In the rare cases where enlistResource throws exception, we should return the resource to the pool
putbackDirectToPool(resourceHandle, resourceSpec.getPoolInfo());
LOG.log(WARNING, "poolmgr.err_enlisting_res_in_getconn", resourceSpec.getPoolInfo());
LOG.fine("rm.enlistResource threw Exception. Returning resource to pool");
// and rethrow the exception
throw new PoolingException(e);
}
return resourceHandle.getUserConnection();
}
@Override
public void putbackDirectToPool(ResourceHandle resourceHandle, PoolInfo poolInfo) {
// Notify pool
if (poolInfo != null) {
ResourcePool pool = poolTable.get(poolInfo);
if (pool != null) {
pool.resourceClosed(resourceHandle);
}
}
}
@Override
public ResourceHandle getResourceFromPool(ResourceSpec resourceSpec, ResourceAllocator resourceAllocator, ClientSecurityInfo info, Transaction transaction) throws PoolingException, RetryableUnavailableException {
// pool.getResource() has been modified to:
// - be able to create new resource if needed
// - block the caller until a resource is acquired or
// the max-wait-time expires
return getPool(resourceSpec.getPoolInfo()).getResource(resourceSpec, resourceAllocator, transaction);
}
/**
* Switch on matching in the pool.
*
* @param poolInfo Name of the pool
*/
@Override
public boolean switchOnMatching(PoolInfo poolInfo) {
ResourcePool pool = getPool(poolInfo);
if (pool == null) {
return false;
}
pool.switchOnMatching();
return true;
}
private void addPool(ResourcePool pool) {
LOG.log(FINE, "Adding pool {0} to pooltable", pool.getPoolInfo());
poolTable.put(pool.getPoolInfo(), pool);
}
private ResourceManager getResourceManager(ResourceSpec resourceSpec) {
if (resourceSpec.isNonTx()) {
LOG.fine("Returning noTxResourceManager");
return noTxResourceManager;
}
if (resourceSpec.isPM()) {
LOG.fine("Returning sysResourceManager");
return sysResourceManager;
}
if (resourceSpec.isLazyEnlistable()) {
LOG.fine("Returning LazyEnlistableResourceManager");
return lazyEnlistableResourceManager;
}
LOG.fine("Returning resourceManager");
return resourceManager;
}
private void addSyncListener(Transaction transaction) {
try {
transaction.registerSynchronization(new SynchronizationListener(transaction));
} catch (Exception ex) {
LOG.log(FINE, () -> "Error adding syncListener : " + (ex.getMessage() != null ? ex.getMessage() : " "));
}
}
// called by EJB Transaction Manager
@Override
public void transactionCompleted(Transaction transaction, int status) throws IllegalStateException {
Set<PoolInfo> pools = ((JavaEETransaction) transaction).getAllParticipatingPools();
for (PoolInfo poolInfo : pools) {
ResourcePool pool = getPool(poolInfo);
if (LOG.isLoggable(FINE)) {
LOG.fine("calling transactionCompleted on " + pool.getPoolInfo());
}
pool.transactionCompleted(transaction, status);
}
}
@Override
public void resourceEnlisted(Transaction transaction, com.sun.appserv.connectors.internal.api.ResourceHandle internalHandle) throws IllegalStateException {
ResourceHandle resourceHandle = (ResourceHandle) internalHandle;
PoolInfo poolInfo = resourceHandle.getResourceSpec().getPoolInfo();
try {
JavaEETransaction javaEETransaction = (JavaEETransaction) transaction;
if (poolInfo != null && javaEETransaction.getResources(poolInfo) == null) {
addSyncListener(transaction);
}
} catch (ClassCastException e) {
addSyncListener(transaction);
}
if (poolInfo != null) {
ResourcePool pool = getPool(poolInfo);
if (pool != null) {
pool.resourceEnlisted(transaction, resourceHandle);
}
}
}
/**
* This method gets called by the LazyEnlistableConnectionManagerImpl when a connection needs enlistment, i.e on use of
* a Statement etc.
*/
@Override
public void lazyEnlist(ManagedConnection mc) throws ResourceException {
lazyEnlistableResourceManager.lazyEnlist(mc);
}
private ConnectorRuntime getConnectorRuntime() {
if (runtime == null) {
runtime = connectorRuntimeProvider.get();
}
return runtime;
}
@Override
public void registerResource(com.sun.appserv.connectors.internal.api.ResourceHandle internalHandle) throws PoolingException {
ResourceHandle resourceHandle = (ResourceHandle) internalHandle;
getResourceManager(resourceHandle.getResourceSpec()).registerResource(resourceHandle);
}
@Override
public void registerPoolLifeCycleListener(PoolLifeCycle poolListener) {
listener = poolListener;
}
@Override
public void unregisterPoolLifeCycleListener() {
listener = null;
}
@Override
public void unregisterResource(com.sun.appserv.connectors.internal.api.ResourceHandle internalResource, int xaresFlag) {
ResourceHandle resourceHandle = (ResourceHandle) internalResource;
getResourceManager(resourceHandle.getResourceSpec()).unregisterResource(resourceHandle, xaresFlag);
}
@Override
public void resourceClosed(ResourceHandle resource) {
getResourceManager(resource.getResourceSpec()).delistResource(resource, TMSUCCESS);
putbackResourceToPool(resource, false);
}
@Override
public void badResourceClosed(ResourceHandle resource) {
getResourceManager(resource.getResourceSpec()).delistResource(resource, TMSUCCESS);
putbackBadResourceToPool(resource);
}
@Override
public void resourceErrorOccurred(ResourceHandle resource) {
putbackResourceToPool(resource, true);
}
@Override
public void resourceAbortOccurred(ResourceHandle resource) {
getResourceManager(resource.getResourceSpec()).delistResource(resource, TMSUCCESS);
putbackResourceToPool(resource, true);
}
@Override
public void putbackBadResourceToPool(ResourceHandle resourceHandle) {
// Notify pool
PoolInfo poolInfo = resourceHandle.getResourceSpec().getPoolInfo();
if (poolInfo != null) {
ResourcePool pool = poolTable.get(poolInfo);
if (pool != null) {
synchronized (pool) {
pool.resourceClosed(resourceHandle);
resourceHandle.setConnectionErrorOccurred();
pool.resourceErrorOccurred(resourceHandle);
}
}
}
}
@Override
public void putbackResourceToPool(ResourceHandle resourceHandle, boolean errorOccurred) {
// Notify pool
PoolInfo poolInfo = resourceHandle.getResourceSpec().getPoolInfo();
if (poolInfo != null) {
ResourcePool pool = poolTable.get(poolInfo);
if (pool != null) {
if (errorOccurred) {
pool.resourceErrorOccurred(resourceHandle);
} else {
pool.resourceClosed(resourceHandle);
}
}
}
}
@Override
public ResourcePool getPool(PoolInfo poolInfo) {
if (poolInfo == null) {
return null;
}
return poolTable.get(poolInfo);
}
/**
* Kill the pool with the specified pool name
*
* @param poolInfo - The name of the pool to kill
*/
@Override
public void killPool(PoolInfo poolInfo) {
LOG.log(Level.FINEST, "killPool(poolInfo={0})", poolInfo);
// Empty the pool and remove from poolTable
ResourcePool pool = poolTable.get(poolInfo);
if (pool != null) {
pool.cancelResizerTask();
pool.emptyPool();
LOG.log(Level.CONFIG, "Removing pool {0} from pooltable", pool);
poolTable.remove(poolInfo);
if (listener != null) {
listener.poolDestroyed(poolInfo);
}
// Notify mcf-destroy
ManagedConnectionFactory managedConnectionFactory = ConnectorRegistry.getInstance().getManagedConnectionFactory(poolInfo);
if (managedConnectionFactory != null) {
if (managedConnectionFactory instanceof MCFLifecycleListener) {
((MCFLifecycleListener) managedConnectionFactory).mcfDestroyed();
}
}
}
}
@Override
public void killFreeConnectionsInPools() {
LOG.fine("Killing all free connections in pools");
for (ResourcePool pool : poolTable.values()) {
PoolInfo poolInfo = pool.getPoolStatus().getPoolInfo();
try {
if (poolInfo != null) {
ResourcePool poolToKill = poolTable.get(poolInfo);
if (poolToKill != null) {
pool.emptyFreeConnectionsInPool();
}
if (LOG.isLoggable(FINE)) {
LOG.fine("Now killing free connections in pool : " + poolInfo);
}
}
} catch (Exception e) {
if (LOG.isLoggable(FINE)) {
LOG.fine("Error killing pool : " + poolInfo + " :: " + (e.getMessage() == null ? " " : e.getMessage()));
}
}
}
}
@Override
public ResourceReferenceDescriptor getResourceReference(SimpleJndiName jndiName, SimpleJndiName logicalName) {
Set<ResourceReferenceDescriptor> descriptors = getConnectorRuntime().getResourceReferenceDescriptor();
List<ResourceReferenceDescriptor> matchingRefs = new ArrayList<>();
if (descriptors != null) {
for (ResourceReferenceDescriptor descriptor : descriptors) {
SimpleJndiName name = descriptor.getJndiName();
if (jndiName.equals(name)) {
matchingRefs.add(descriptor);
}
}
}
if (matchingRefs.size() == 1) {
return matchingRefs.get(0);
}
if (matchingRefs.size() > 1) {
for (ResourceReferenceDescriptor resourceReferenceDescriptor : matchingRefs) {
String refName = resourceReferenceDescriptor.getName();
if (refName != null && logicalName != null) {
if (getJavaName(new SimpleJndiName(refName)).equals(getJavaName(logicalName))) {
return resourceReferenceDescriptor;
}
}
}
}
return null;
}
private static SimpleJndiName getJavaName(SimpleJndiName name) {
if (name == null || name.hasJavaPrefix()) {
return name;
}
// by default, scope is "comp"
return new SimpleJndiName(SimpleJndiName.JNDI_CTX_JAVA_COMPONENT_ENV + name);
}
@Override
public void beforePreInvoke(ComponentInvocation.ComponentInvocationType invType, ComponentInvocation prevInv, ComponentInvocation newInv) throws InvocationException {
// no-op
}
@Override
public void afterPreInvoke(ComponentInvocation.ComponentInvocationType invType, ComponentInvocation prevInv, ComponentInvocation curInv) throws InvocationException {
// no-op
}
@Override
public void beforePostInvoke(ComponentInvocation.ComponentInvocationType invType, ComponentInvocation prevInv, ComponentInvocation curInv) throws InvocationException {
// no-op
}
/*
* Called by the InvocationManager at methodEnd. This method will disassociate ManagedConnection instances from
* Connection handles if the ResourceAdapter supports that.
*/
@Override
public void afterPostInvoke(ComponentInvocation.ComponentInvocationType invType, ComponentInvocation prevInv, ComponentInvocation curInv) throws InvocationException {
postInvoke(curInv);
}
private void postInvoke(ComponentInvocation curInv) {
ComponentInvocation invToUse = curInv;
if (invToUse == null) {
return;
}
Object comp = invToUse.getInstance();
if (comp == null) {
return;
}
handleLazilyAssociatedConnectionPools(comp, invToUse);
}
/**
* If the connections associated with the component are lazily-associatable, dissociate them.
*
* @param comp Component that acquired connections
* @param invToUse component invocation
*/
private void handleLazilyAssociatedConnectionPools(Object comp, ComponentInvocation invToUse) {
JavaEETransactionManager jJavaEETransactionManager = getConnectorRuntime().getTransactionManager();
List<ResourceHandle> list = jJavaEETransactionManager.getExistingResourceList(comp, invToUse);
if ((list == null) || list.isEmpty()) {
return;
}
ResourceHandle[] handles = list.toArray(ResourceHandle[]::new);
for (ResourceHandle resourceHandle : handles) {
if (resourceHandle == null) {
LOG.log(WARNING, "lazy_association.lazy_association_resource_handle");
} else {
ResourceSpec spec = resourceHandle.getResourceSpec();
if (spec == null) {
LOG.log(WARNING, "lazy_association.lazy_association_resource_spec");
} else if (spec.isLazyAssociatable()) {
// In this case we are assured that the managedConnection is
// of type DissociatableManagedConnection
if (resourceHandle.getResource() != null) {
DissociatableManagedConnection managedConnection = (DissociatableManagedConnection)
resourceHandle.getResource();
if (resourceHandle.isEnlisted()) {
getResourceManager(spec).delistResource(resourceHandle, TMSUCCESS);
}
try {
managedConnection.dissociateConnections();
} catch (ResourceException re) {
throw new InvocationException(re.getMessage(), re);
} finally {
if (resourceHandle.getResourceState().isBusy()) {
putbackDirectToPool(resourceHandle, spec.getPoolInfo());
}
}
} else {
LOG.log(WARNING, "lazy_association.lazy_association_resource");
}
}
}
}
}
class SynchronizationListener implements Synchronization {
private final Transaction transaction;
SynchronizationListener(Transaction transaction) {
this.transaction = transaction;
}
@Override
public void afterCompletion(int status) {
try {
transactionCompleted(transaction, status);
} catch (Exception ex) {
LOG.log(FINE, () -> "Exception in afterCompletion : " + (ex.getMessage() == null ? " " : ex.getMessage()));
}
}
@Override
public void beforeCompletion() {
// do nothing
}
}
@Override
public void reconfigPoolProperties(ConnectorConnectionPool connectorConnectionPool) throws PoolingException {
ResourcePool pool = getPool(connectorConnectionPool.getPoolInfo());
if (pool != null) {
pool.reconfigurePool(connectorConnectionPool);
}
}
/**
* Flush Connection pool by reinitializing the connections established in the pool.
*
* @param poolInfo
* @throws com.sun.appserv.connectors.internal.api.PoolingException
*/
@Override
public boolean flushConnectionPool(PoolInfo poolInfo) throws PoolingException {
ResourcePool pool = getPool(poolInfo);
if (pool == null) {
throw new PoolingException(
"Flush Connection Pool did not happen as pool " + poolInfo + " is not initialized");
}
return pool.flushConnectionPool();
}
@Override
public PoolStatus getPoolStatus(PoolInfo poolInfo) {
ResourcePool pool = poolTable.get(poolInfo);
if (pool != null) {
return pool.getPoolStatus();
}
return null;
}
}