ConnectionFactoryManager.java
1.91 KB
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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.jmx.statistics.BoundedRangeStatistic
* org.slf4j.Logger
* org.slf4j.LoggerFactory
*/
package com.adobe.service;
import com.adobe.service.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class ConnectionFactoryManager
implements ResourceFactoryManager {
static final Logger logger = LoggerFactory.getLogger(ConnectionFactoryManager.class);
final ServiceAPI service;
private final ConnectionFactoryManagerPeer peer;
private ConnectionResourceFactory connectionResourceFactory;
ConnectionFactoryManager(ConnectionResourceFactory connectionResourceFactory, ServiceAPI service) {
this.connectionResourceFactory = connectionResourceFactory;
this.service = service;
this.peer = ConnectionFactoryManagerPeer.PEER_FACTORY.create(this);
}
public ConnectionFactoryManager(Class connectionResourceClass, ServiceAPI service) {
this(new ClassConnectionFactory(connectionResourceClass, new Object[]{service}), service);
}
protected ConnectionFactoryManager(ServiceAPI service) {
this((ConnectionResourceFactory)null, service);
}
ConnectionResource createConnectionResource() {
return this.connectionResourceFactory.create();
}
public void setPoolMax(int inPoolMax) {
this.peer.pooler.poolSize.setUpperBound((long)inPoolMax);
}
public int getPoolMax() {
return (int)this.peer.pooler.poolSize.getUpperBound();
}
public void setPoolMin(int inPoolMin) {
this.peer.pooler.poolSize.setLowerBound((long)inPoolMin);
}
public int getPoolMin() {
return (int)this.peer.pooler.poolSize.getLowerBound();
}
public void onShutdown() {
this.peer.pooler.onShutdown();
}
public ConnectionFactory getConnectionFactory() {
return this.peer.getConnectionFactory();
}
}