mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
HA
This commit is contained in:
@@ -55,9 +55,28 @@ public class MockConnection implements Connection {
|
||||
|
||||
private final long createdTimeMillis = System.currentTimeMillis();
|
||||
private long lastActiveTimeMillis = System.currentTimeMillis();
|
||||
private String url;
|
||||
|
||||
public MockConnection(){
|
||||
this(null);
|
||||
this(null, null, null);
|
||||
}
|
||||
|
||||
public MockConnection(MockDriver driver, String url, Properties connectProperties){
|
||||
this.driver = driver;
|
||||
this.connectProperties = connectProperties;
|
||||
this.url = url;
|
||||
|
||||
if (driver != null) {
|
||||
this.id = driver.generateConnectionId();
|
||||
}
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public long getLastActiveTimeMillis() {
|
||||
@@ -72,19 +91,6 @@ public class MockConnection implements Connection {
|
||||
return createdTimeMillis;
|
||||
}
|
||||
|
||||
public MockConnection(MockDriver driver){
|
||||
this(driver, new Properties());
|
||||
}
|
||||
|
||||
public MockConnection(MockDriver driver, Properties connectProperties){
|
||||
this.driver = driver;
|
||||
this.connectProperties = connectProperties;
|
||||
|
||||
if (driver != null) {
|
||||
this.id = driver.generateConnectionId();
|
||||
}
|
||||
}
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public class MockDriver implements Driver {
|
||||
}
|
||||
}
|
||||
|
||||
MockConnection conn = new MockConnection(this, info);
|
||||
MockConnection conn = new MockConnection(this, url, info);
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("connect, url " + url + ", id " + conn.getId());
|
||||
|
||||
Reference in New Issue
Block a user