-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from SanojPunchihewa/1.x.x
[1.x.x] Adding JMX functionalities to the AS400 PCML Connector
- Loading branch information
Showing
6 changed files
with
162 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
src/main/java/org/wso2/carbon/connector/pcml/PCMLPool.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.connector.pcml; | ||
|
||
import com.ibm.as400.access.AS400ConnectionPool; | ||
import com.ibm.as400.access.AS400; | ||
|
||
public class PCMLPool implements PCMLPoolMBean { | ||
|
||
AS400ConnectionPool as400ConnectionPool; | ||
AS400 as400; | ||
int maxConnections; | ||
long maxInactivity; | ||
int maxLifetime; | ||
int maxUseCount; | ||
int maxUseTime; | ||
boolean isRunMaintenance; | ||
boolean isThreadUsed; | ||
int cleanupInterval; | ||
boolean pretestConnections; | ||
int activeConnectionCount; | ||
|
||
public PCMLPool(AS400ConnectionPool connectionPool, AS400 as400) { | ||
this.as400ConnectionPool = connectionPool; | ||
this.as400 = as400; | ||
} | ||
|
||
@Override | ||
public int getMaxConnections() { | ||
return this.as400ConnectionPool.getMaxConnections(); | ||
} | ||
|
||
public long getMaxInactivity() { | ||
return this.as400ConnectionPool.getMaxInactivity(); | ||
} | ||
|
||
public long getMaxLifetime() { | ||
return this.as400ConnectionPool.getMaxLifetime(); | ||
} | ||
|
||
public int getMaxUseCount() { | ||
return this.as400ConnectionPool.getMaxUseCount(); | ||
} | ||
|
||
public long getMaxUseTime() { | ||
return this.as400ConnectionPool.getMaxUseTime(); | ||
} | ||
|
||
public boolean isRunMaintenance() { | ||
return this.as400ConnectionPool.isRunMaintenance(); | ||
} | ||
|
||
public boolean isThreadUsed() { | ||
return this.as400ConnectionPool.isThreadUsed(); | ||
} | ||
|
||
public long getCleanupInterval() { | ||
return this.as400ConnectionPool.getCleanupInterval(); | ||
} | ||
|
||
public boolean isPretestConnections() { | ||
return this.as400ConnectionPool.isPretestConnections(); | ||
} | ||
|
||
@Override | ||
public int getActiveConnectionCount() { | ||
return this.as400ConnectionPool.getActiveConnectionCount(as400.getSystemName(), as400.getUserId()); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/org/wso2/carbon/connector/pcml/PCMLPoolMBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright (c) 2024, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. | ||
* | ||
* WSO2 LLC. licenses this file to you under the Apache License, | ||
* Version 2.0 (the "License"); you may not use this file except | ||
* in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
package org.wso2.carbon.connector.pcml; | ||
|
||
public interface PCMLPoolMBean { | ||
|
||
int getMaxConnections(); | ||
|
||
long getMaxInactivity(); | ||
|
||
long getMaxLifetime(); | ||
|
||
int getMaxUseCount(); | ||
|
||
long getMaxUseTime(); | ||
|
||
boolean isRunMaintenance(); | ||
|
||
boolean isThreadUsed(); | ||
|
||
long getCleanupInterval(); | ||
|
||
boolean isPretestConnections(); | ||
|
||
int getActiveConnectionCount(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters