teiid SVN: r972 - in trunk/embedded/src/main/java/com/metamatrix/dqp/embedded: services and 1 other directory.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-18 14:31:12 -0400 (Mon, 18 May 2009)
New Revision: 972
Modified:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedDataService.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - exposing the stats in embedded
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java 2009-05-18 18:30:50 UTC (rev 971)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java 2009-05-18 18:31:12 UTC (rev 972)
@@ -370,7 +370,13 @@
@Override
public Collection getConnectionPoolStats(String identifier)
throws AdminException {
- return Collections.EMPTY_LIST;
+
+ try {
+ return this.getDataService().getConnectionPoolStatistics(identifier);
+ } catch (MetaMatrixComponentException e) {
+ throw new AdminComponentException(e);
+ }
+
}
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedDataService.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedDataService.java 2009-05-18 18:30:50 UTC (rev 971)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/services/EmbeddedDataService.java 2009-05-18 18:31:12 UTC (rev 972)
@@ -198,9 +198,24 @@
}
}
throw new ComponentNotFoundException(DQPEmbeddedPlugin.Util.getString("DataService.Unable_to_find_connector_manager_for_{0}_1", new Object[] { connectorBindingName })); //$NON-NLS-1$
- }
+ }
/**
+ * @see com.metamatrix.dqp.service.DataService#getConnectionPoolStatistics(java.lang.String)
+ * @since 6.1
+ */
+ public Collection getConnectionPoolStatistics(String connectorBindingName) throws MetaMatrixComponentException {
+ ConnectorBinding binding = getConnectorBinding(connectorBindingName);
+ if (binding != null) {
+ ConnectorManager mgr = getConnectorManager(binding);
+ if (mgr != null ) {
+ return mgr.getConnectionPoolStats();
+ }
+ }
+ throw new ComponentNotFoundException(DQPEmbeddedPlugin.Util.getString("DataService.Unable_to_find_connector_manager_for_{0}_1", new Object[] { connectorBindingName })); //$NON-NLS-1$
+ }
+
+ /**
* @see com.metamatrix.dqp.service.DataService#clearConnectorBindingCache(java.lang.String)
* @since 4.3
*/
15 years, 7 months
teiid SVN: r971 - trunk/client/src/main/java/com/metamatrix/admin/api/core.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-18 14:30:50 -0400 (Mon, 18 May 2009)
New Revision: 971
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java
Log:
Teiid-580 - adding support for monitoring connector connection pools
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java 2009-05-18 02:33:55 UTC (rev 970)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java 2009-05-18 18:30:50 UTC (rev 971)
@@ -163,6 +163,8 @@
/**
* Get the Connection Pool Stats that correspond to the specified identifier pattern.
+ * If the {@link ConnectionPool ConnectionPool} represents an XA connection, there
+ * will be 2 {@link ConnectionPool ConnectionPool}s.
*
* @param identifier - an identfier that corresponds to the ConnectorBinding that is
* running in a process {@link ConnectionPool}
15 years, 7 months
teiid SVN: r970 - in trunk: connectors/connector-loopback/src/main/resources and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-17 22:33:55 -0400 (Sun, 17 May 2009)
New Revision: 970
Modified:
trunk/connector-api/src/main/resources/connector-base.xml
trunk/connectors/connector-loopback/src/main/resources/connector-loopback.xml
Log:
minor corrections to config properties ISExpert -> IsExpert
Modified: trunk/connector-api/src/main/resources/connector-base.xml
===================================================================
--- trunk/connector-api/src/main/resources/connector-base.xml 2009-05-18 02:15:58 UTC (rev 969)
+++ trunk/connector-api/src/main/resources/connector-base.xml 2009-05-18 02:33:55 UTC (rev 970)
@@ -4,7 +4,7 @@
<PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system)" Multiplicity="0..1" IsExpert="true" IsHidden="true" />
<PropertyDefinition Name="ExceptionOnMaxRows" DisplayName="Exception on Exceeding Max Rows" ShortDescription="Indicates if an Exception should be thrown if the specified value for Maximum Result Rows is exceeded; else no exception and no more than the maximum will be returned" DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
<PropertyDefinition Name="metamatrix.service.essentialservice" DisplayName="Essential Service" ShortDescription="Indicates if the service is essential to operation of the Integration Server" DefaultValue="false" Multiplicity="1" PropertyType="Boolean" IsExpert="true" IsHidden="true" />
- <PropertyDefinition Name="ServiceMonitoringEnabled" DisplayName="Data Source Monitoring Enabled" ShortDescription="Whether to monitor the underlying data source to see if it is available." DefaultValue="true" Multiplicity="1" PropertyType="Boolean" ISExpert="true" />
+ <PropertyDefinition Name="ServiceMonitoringEnabled" DisplayName="Data Source Monitoring Enabled" ShortDescription="Whether to monitor the underlying data source to see if it is available." DefaultValue="true" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
<PropertyDefinition Name="Immutable" DisplayName="Is Immutable" ShortDescription="True if the source never changes." DefaultValue="false" Multiplicity="1" PropertyType="Boolean" IsExpert="true" />
<PropertyDefinition Name="ConnectorMaxConnections" DisplayName="Maximum Concurrent Connections" ShortDescription="" DefaultValue="20" Multiplicity="1" PropertyType="Integer" IsExpert="true" />
<PropertyDefinition Name="ConnectorClass" DisplayName="Connector Class" ShortDescription="" Multiplicity="1" IsExpert="true" IsHidden="true" />
Modified: trunk/connectors/connector-loopback/src/main/resources/connector-loopback.xml
===================================================================
--- trunk/connectors/connector-loopback/src/main/resources/connector-loopback.xml 2009-05-18 02:15:58 UTC (rev 969)
+++ trunk/connectors/connector-loopback/src/main/resources/connector-loopback.xml 2009-05-18 02:33:55 UTC (rev 970)
@@ -1,5 +1,4 @@
<ComponentType Name="Loopback Connector" ComponentTypeCode="2" Deployable="true" Deprecated="false" Monitorable="false" SuperComponentType="Connector" ParentComponentType="Connectors" LastChangedBy="ConfigurationStartup" LastChangedDate="2008-10-31T10:26:19.945-06:00" CreatedBy="ConfigurationStartup" CreationDate="2008-10-31T10:26:19.945-06:00">
- <PropertyDefinition Name="ConnectorClassPath" DisplayName="Class Path" ShortDescription="" Multiplicity="0..1" IsPreferred="true"/>
<PropertyDefinition Name="ConnectorTypeClassPath" DisplayName="Connector Type Class Path" ShortDescription="Connector Type classpath (defined by system, do not modify)" DefaultValue="${classpath}" Multiplicity="0..1" IsExpert="true" IsModifiable="false" IsHidden="true" />
<PropertyDefinition Name="CapabilitiesClass" DisplayName="Capabilities Class" ShortDescription="" DefaultValue="com.metamatrix.connector.loopback.LoopbackCapabilities" Multiplicity="1" IsExpert="true" />
<PropertyDefinition Name="WaitTime" DisplayName="Max Random Wait Time" ShortDescription="" DefaultValue="0" Multiplicity="1" IsExpert="true" />
15 years, 7 months
teiid SVN: r969 - in trunk/console/src/main/java/com/metamatrix: toolbox/ui/widget and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-17 22:15:58 -0400 (Sun, 17 May 2009)
New Revision: 969
Modified:
trunk/console/src/main/java/com/metamatrix/console/ui/views/connectorbinding/NewBindingWizardController.java
trunk/console/src/main/java/com/metamatrix/toolbox/ui/widget/WizardPanel.java
Log:
TEIID-609 fix of timing issue with wizard logic.
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/connectorbinding/NewBindingWizardController.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/connectorbinding/NewBindingWizardController.java 2009-05-18 01:49:29 UTC (rev 968)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/connectorbinding/NewBindingWizardController.java 2009-05-18 02:15:58 UTC (rev 969)
@@ -128,7 +128,7 @@
currentPage = CONNECTOR_SELECT_PAGE_NUM;
setLocationOn(dialog);
- dialog.show();
+ dialog.setVisible(true);
}
return scdNewConnectorBinding;
}
Modified: trunk/console/src/main/java/com/metamatrix/toolbox/ui/widget/WizardPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/toolbox/ui/widget/WizardPanel.java 2009-05-18 01:49:29 UTC (rev 968)
+++ trunk/console/src/main/java/com/metamatrix/toolbox/ui/widget/WizardPanel.java 2009-05-18 02:15:58 UTC (rev 969)
@@ -458,6 +458,7 @@
nextButton.setMaximumSize(size);
*/
addNavigationButton(nextButton, removeNavigationButton(finishButton));
+ this.validate();
}
} else if (nextButton.getParent() != null) {
addAcceptButton(finishButton, removeNavigationButton(nextButton));
15 years, 7 months
teiid SVN: r968 - trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-17 21:49:29 -0400 (Sun, 17 May 2009)
New Revision: 968
Modified:
trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - this initial checkin is to support the interface method.
Modified: trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java
===================================================================
--- trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java 2009-05-18 01:45:55 UTC (rev 967)
+++ trunk/embedded/src/main/java/com/metamatrix/dqp/embedded/admin/DQPMonitoringAdminImpl.java 2009-05-18 01:49:29 UTC (rev 968)
@@ -366,5 +366,13 @@
}
return ts.getTransactions();
}
+
+ @Override
+ public Collection getConnectionPoolStats(String identifier)
+ throws AdminException {
+ return Collections.EMPTY_LIST;
+ }
+
+
}
15 years, 7 months
teiid SVN: r967 - in trunk/client/src/main/java/com/metamatrix/admin: api/objects and 1 other directories.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-17 21:45:55 -0400 (Sun, 17 May 2009)
New Revision: 967
Added:
trunk/client/src/main/java/com/metamatrix/admin/api/objects/ConnectionPool.java
trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectionPool.java
Modified:
trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - exposing the stats out adminapi
Modified: trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java 2009-05-18 01:44:34 UTC (rev 966)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/core/CoreMonitoringAdmin.java 2009-05-18 01:45:55 UTC (rev 967)
@@ -159,8 +159,25 @@
* @since 4.3
*/
Collection getQueueWorkerPools(String identifier) throws AdminException;
+
+
+ /**
+ * Get the Connection Pool Stats that correspond to the specified identifier pattern.
+ *
+ * @param identifier - an identfier that corresponds to the ConnectorBinding that is
+ * running in a process {@link ConnectionPool}
+ * <ul>
+ * <li> <code>"*"</code> - for all Connection Pools in the system
+ * <li> <code>"name*"</code> - for all the Connection Pools that begin with given name
+ * <li><code>"name"</code> - for a single Connection Pool in the system
+ * </ul>
+ * @return Collection of {@link ConnectionPool}
+ * @throws AdminException if there's a system error.
+ * @since 6.1
+ */
+ Collection getConnectionPoolStats(String identifier) throws AdminException;
+
-
/**
* Get the Caches that correspond to the specified identifier pattern
* @param identifier - an identifier for the cache in {@link Cache}
Added: trunk/client/src/main/java/com/metamatrix/admin/api/objects/ConnectionPool.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/api/objects/ConnectionPool.java (rev 0)
+++ trunk/client/src/main/java/com/metamatrix/admin/api/objects/ConnectionPool.java 2009-05-18 01:45:55 UTC (rev 967)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership. Some portions may be licensed
+ * to Red Hat, Inc. under one or more contributor license agreements.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ */
+
+package com.metamatrix.admin.api.objects;
+
+
+/**
+ * This object holds the statisics for a ConnectionPool that is being utilized by a Connector.
+ * As per how many available connections
+ * processed etc.
+ * <p>An identifier for QueueWorkerPool, is nothing but the modules it self, like "DQP",
+ * "QueryService" or Connector Binding names etc.</p>
+ *
+ * @since 4.3
+ */
+public interface ConnectionPool extends AdminObject {
+ /**
+ * @return Returns total number of current connections in the Connection Pool
+ * @since 6.1
+ */
+ public int getTotalConnections();
+
+ /**
+ * @return Returns the number of connections waiting for use in the connection pool.
+ * @since 6.1
+ */
+ public int getConnectionsWaiting();
+
+ /**
+ * @return Returns the number of Connections currently in use by clients.
+ *
+ * @since 6.1
+ */
+ public int getConnectionsInuse();
+
+ /**
+ * @return Returns the number of Connections created since the Connection Pool was created.
+ * @since 6.1
+ */
+ long getConnectionsCreated();
+
+
+ /**
+ * @return The number of Connections destroyed since the Connection Pool was created.
+ */
+ long getConnectionsDestroyed();
+
+
+
+}
Property changes on: trunk/client/src/main/java/com/metamatrix/admin/api/objects/ConnectionPool.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectionPool.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectionPool.java (rev 0)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectionPool.java 2009-05-18 01:45:55 UTC (rev 967)
@@ -0,0 +1,148 @@
+package com.metamatrix.admin.objects;
+
+import com.metamatrix.admin.api.objects.ConnectionPool;
+
+public class MMConnectionPool extends MMAdminObject implements ConnectionPool {
+
+ /**
+ * @since 6.1
+ */
+ private static final long serialVersionUID = -2341549955193216875L;
+
+ /**
+ * This will the name of the connector binding
+ */
+ private String connectorBindingName;
+
+
+ /**
+ * This will be identifier used in the registry to identify the connector
+ * binding and in which host and process that it's running in
+ */
+ private String connectorBindingIdentifier;
+
+
+ private int poolType;
+
+
+ // current state
+ /**
+ * Number of connections currently in use by a client
+ */
+ private int connectionInUse;
+ /**
+ * Number of connections waiting for use by a client
+ */
+ private int connectionsWaiting;
+ /**
+ * Total number of connections currently in the pool
+ */
+ private int totalConnections;
+
+
+ // total counts never reset
+ /**
+ * Total number of connections that have been destroyed since the inception of the pool
+ */
+ private long connectionsDestroyed;
+ /**
+ * Total number of connections that have been created since the inception of the pool
+ */
+ private long connectionsCreated;
+
+
+ public MMConnectionPool() {
+ }
+
+ public boolean isXAPoolType() {
+ return (this.poolType==1?true:false);
+ }
+
+ public int getPoolType() {
+ return this.poolType;
+ }
+
+ public void setPoolType(int type) {
+ this.poolType = type;
+ }
+
+ public String getConnectorBindingName() {
+ return connectorBindingName;
+ }
+
+ public void setConnectorBindingName(String bindingName) {
+ this.connectorBindingName = bindingName;
+ }
+
+
+ public String getConnectorBindingIdentifier() {
+ return connectorBindingIdentifier;
+ }
+
+ public void setConnectorBindingIdentifier(String identifier) {
+ this.connectorBindingIdentifier = identifier;
+ }
+
+
+ public int getConnectionsInuse() {
+ return this.connectionInUse;
+ }
+
+ public int getConnectionsWaiting() {
+ return this.connectionsWaiting;
+ }
+
+ public long getConnectionsCreated() {
+ return this.connectionsCreated;
+ }
+
+ public long getConnectionsDestroyed() {
+ return this.connectionsDestroyed;
+ }
+
+ public int getTotalConnections() {
+ return this.totalConnections;
+ }
+
+ public void setConnectionsInUse(int inUseConnections) {
+ this.connectionInUse = inUseConnections;
+ }
+
+ public void setConnectionsWaiting(int waitingConnections) {
+ this.connectionsWaiting = waitingConnections;
+ }
+
+ public void setTotalConnections(int totalConnections) {
+ this.totalConnections = totalConnections;
+ }
+
+ public void setConnectionsDestroyed(long connectionsDestroyed) {
+ this.connectionsDestroyed = connectionsDestroyed;
+ }
+
+ public void setConnectionsCreated(long connectionsCreated) {
+ this.connectionsCreated = connectionsCreated;
+ }
+
+
+ @Override
+ /**
+ * Get string for display purposes
+ * @see java.lang.Object#toString()
+ * @since 6.1
+ */
+ public String toString() {
+ StringBuffer str = new StringBuffer();
+
+ str.append(this.getIdentifier() + " ConnectionPoolStats:\n"); //$NON-NLS-1$
+ str.append("\tisXAPoolType = " + isXAPoolType()); //$NON-NLS-1$
+ str.append("\ttotalConnections = " + this.totalConnections); //$NON-NLS-1$
+ str.append("\tinUseConnections = " + this.connectionInUse); //$NON-NLS-1$
+ str.append("\twaitingConnections = " + connectionsWaiting); //$NON-NLS-1$
+ str.append("\tconnectionsCreated = " + connectionsCreated); //$NON-NLS-1$
+ str.append("\tconnectionsDestroyed = " + connectionsDestroyed); //$NON-NLS-1$
+ return str.toString();
+ }
+
+
+}
Property changes on: trunk/client/src/main/java/com/metamatrix/admin/objects/MMConnectionPool.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 7 months
teiid SVN: r966 - trunk/common-internal/src/main/java/com/metamatrix/common/stats.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-17 21:44:34 -0400 (Sun, 17 May 2009)
New Revision: 966
Modified:
trunk/common-internal/src/main/java/com/metamatrix/common/stats/ConnectionPoolStats.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - added attribute to distinquish between an XA connection pool and a non-xa, because there will be 2 pools when the XA pool is being used.
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/stats/ConnectionPoolStats.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/stats/ConnectionPoolStats.java 2009-05-18 01:43:02 UTC (rev 965)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/stats/ConnectionPoolStats.java 2009-05-18 01:44:34 UTC (rev 966)
@@ -48,11 +48,11 @@
/**
* Total number of connections that have been destroyed since the inception of the pool
*/
- private int connectionsDestroyed;
+ private long connectionsDestroyed;
/**
* Total number of connections that have been created since the inception of the pool
*/
- private int connectionsCreated;
+ private long connectionsCreated;
/**
* Constructor for ConnectionPoolStats
@@ -63,8 +63,12 @@
}
public boolean isXAPoolType() {
- return (this.poolType==1?true:false);
+ return (this.poolType==XA_POOL_TYPE?true:false);
}
+
+ public int getPoolType() {
+ return this.poolType;
+ }
public String getConnectorBindingName() {
return connectorBindingName;
@@ -115,11 +119,11 @@
this.totalConnections = totalConnections;
}
- public void setConnectionsDestroyed(int connectionsDestroyed) {
+ public void setConnectionsDestroyed(long connectionsDestroyed) {
this.connectionsDestroyed = connectionsDestroyed;
}
- public void setConnectionsCreated(int connectionsCreated) {
+ public void setConnectionsCreated(long connectionsCreated) {
this.connectionsCreated = connectionsCreated;
}
15 years, 7 months
teiid SVN: r965 - in trunk/server/src: main/java/com/metamatrix/platform/admin/apiimpl and 6 other directories.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-17 21:43:02 -0400 (Sun, 17 May 2009)
New Revision: 965
Modified:
trunk/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java
trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java
trunk/server/src/main/java/com/metamatrix/platform/service/api/ServiceInterface.java
trunk/server/src/main/java/com/metamatrix/platform/service/controller/AbstractService.java
trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java
trunk/server/src/main/resources/com/metamatrix/admin/server/i18n.properties
trunk/server/src/test/java/com/metamatrix/admin/server/FakeCacheAdmin.java
trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java
trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java
trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java
trunk/server/src/test/java/com/metamatrix/platform/service/controller/FakeService.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - exposing the stats out the server
Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerAdminImpl.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -1009,6 +1009,12 @@
// TODO Auto-generated method stub
return getMonitoringAdmin().getServices(identifier);
}
+
+ @Override
+ public Collection getConnectionPoolStats(String identifier)
+ throws AdminException {
+ return getMonitoringAdmin().getConnectionPoolStats(identifier);
+ }
Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerMonitoringAdminImpl.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -54,6 +54,7 @@
import com.metamatrix.admin.api.objects.VDB;
import com.metamatrix.admin.api.server.ServerMonitoringAdmin;
import com.metamatrix.admin.objects.MMAdminObject;
+import com.metamatrix.admin.objects.MMConnectionPool;
import com.metamatrix.admin.objects.MMConnectorBinding;
import com.metamatrix.admin.objects.MMConnectorType;
import com.metamatrix.admin.objects.MMDQP;
@@ -82,6 +83,7 @@
import com.metamatrix.common.extensionmodule.ExtensionModuleDescriptor;
import com.metamatrix.common.extensionmodule.exception.ExtensionModuleNotFoundException;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.stats.ConnectionPoolStats;
import com.metamatrix.core.util.DateUtil;
import com.metamatrix.core.util.FileUtil;
import com.metamatrix.core.util.FileUtils;
@@ -884,6 +886,71 @@
return results;
}
+
+ /**
+ * Get monitoring information about connection pool stats for the connector bindings.
+ * @see com.metamatrix.admin.api.server.ServerMonitoringAdmin#getConnectionPoolStats(java.lang.String)
+ * @param identifier Identifier of a host, process, or connector binding to get information for.
+ * For example "hostname", or "hostname.processname", or "hostname.processname.bindingname"
+ * <p>If identifier is "*", this method returns information about all connection pools in the system.
+ * @return a <code>Collection</code> of <code>com.metamatrix.admin.api.ConnectionPool</code>
+ * @since 6.1
+ */
+ public Collection getConnectionPoolStats(String identifier) throws AdminException {
+
+ if (identifier == null) {
+ throwProcessingException("AdminImpl.requiredparameter", new Object[] {}); //$NON-NLS-1$
+ }
+
+ ArrayList results = null;
+ try {
+ //get pools from RuntimeStateAdminAPIHelper
+ Collection serviceBindings = this.registry.getServiceBindings(null, null);
+
+ //convert runtime data into MMQueueStatistics objects
+ results = new ArrayList(serviceBindings.size());
+ for (Iterator iter = serviceBindings.iterator(); iter.hasNext();) {
+ ServiceRegistryBinding binding = (ServiceRegistryBinding) iter.next();
+ DeployedComponent component = binding.getDeployedComponent();
+
+ if (component.isDeployedConnector()) {
+ String[] identifierParts = new String[] {binding.getHostName(),
+ component.getVMComponentDefnID().getName(),
+ component.getServiceComponentDefnID().getFullName()};
+ if (identifierMatches(identifier, identifierParts)) {
+
+ Collection statsCollection = getRuntimeStateAdminAPIHelper().getConnectionPoolStats(binding);
+ if (statsCollection != null) {
+ for (Iterator iter2 = statsCollection.iterator(); iter2.hasNext();) {
+ ConnectionPoolStats stats = (ConnectionPoolStats) iter2.next();
+
+ MMConnectionPool mmstats = new MMConnectionPool();
+
+ mmstats.setConnectorBindingName(component.getServiceComponentDefnID().getFullName());
+ mmstats.setConnectorBindingIdentifier(component.getFullName());
+
+ mmstats.setConnectionsInUse(stats.getConnectionsInuse());
+ mmstats.setConnectionsCreated(stats.getConnectionsCreated());
+ mmstats.setConnectionsDestroyed(stats.getConnectionsDestroyed());
+ mmstats.setConnectionsWaiting(stats.getConnectionsWaiting());
+ mmstats.setTotalConnections(stats.getTotalConnections());
+
+ results.add(mmstats);
+ }
+ }
+
+ }
+
+
+ }
+ }
+ } catch (MetaMatrixComponentException e) {
+ throw new AdminComponentException(e);
+ } catch (ServiceException e) {
+ throw new AdminComponentException(e);
+ }
+ return results;
+ }
/**
@@ -1181,10 +1248,19 @@
config = getConfigurationServiceProxy().getCurrentConfiguration();
ConnectorBinding configBinding = config.getConnectorBinding(MMAdminObject.getNameFromIdentifier(objectIdentifier));
- component = getConnectorBindingComponent(objectIdentifier);
+ component = getDeployedComponent(objectIdentifier);
return convertPropertyDefinitions(component, configBinding.getProperties());
+ case MMAdminObject.OBJECT_TYPE_SERVICE:
+ config = getConfigurationServiceProxy().getCurrentConfiguration();
+ ServiceComponentDefn svc = config.getServiceComponentDefn(MMAdminObject.getNameFromIdentifier(objectIdentifier));
+
+ component = this.getDeployedComponent(objectIdentifier);
+
+ return convertPropertyDefinitions(component, svc.getProperties());
+
+
case MMAdminObject.OBJECT_TYPE_CONNECTOR_TYPE:
ComponentType componentType = getConnectorTypeComponentType(objectIdentifier);
return convertPropertyDefinitions(componentType, new Properties());
@@ -1305,22 +1381,23 @@
}
- private ComponentObject getConnectorBindingComponent(String identifier) throws ConfigurationException {
+ private ComponentObject getDeployedComponent(String identifier) throws ConfigurationException {
Configuration config = getConfigurationServiceProxy().getCurrentConfiguration();
Collection components = config.getDeployedComponents();
for (Iterator iter = components.iterator(); iter.hasNext(); ) {
BasicDeployedComponent bdc = (BasicDeployedComponent)iter.next();
-
String[] identifierParts = new String[] {
bdc.getHostID().getName(), bdc.getVMComponentDefnID().getName(), bdc.getName()
};
if (identifierMatches(identifier, identifierParts)) {
return bdc;
}
+
}
return null;
}
+
private ComponentType getConnectorTypeComponentType(String identifier) throws ConfigurationException {
Collection types = getConfigurationServiceProxy().getAllComponentTypes(false);
for (Iterator iter = types.iterator(); iter.hasNext();) {
Modified: trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/main/java/com/metamatrix/platform/admin/apiimpl/RuntimeStateAdminAPIHelper.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -189,15 +189,9 @@
/**
* Return Collection of QueueStats for service.
*
- * @param callerSessionID
- * ID of the caller's current session.
- * @param serviceID
- * ID of the service.
+ * @param binding
+ * The {@link ServiceRegistryBinding} for the connector
* @return Collection of QueueStats objects.
- * @throws AuthorizationException
- * if caller is not authorized to perform this method.
- * @throws InvalidSessionException
- * if the <code>callerSessionID</code> is not valid or is expired.
* @throws MetaMatrixComponentException
* if an error occurred in communicating with a component.
*/
@@ -207,7 +201,24 @@
return service.getQueueStatistics();
}
return Collections.EMPTY_LIST;
- }
+ }
+
+ /**
+ * Return Collection of ConnectionPoolStats for a service.
+ *
+ * @param binding
+ * The {@link ServiceRegistryBinding} for the connector
+ * @return Collection of ConnectionPoolStat objects.
+ * @throws MetaMatrixComponentException
+ * if an error occurred in communicating with a component.
+ */
+ public Collection getConnectionPoolStats(ServiceRegistryBinding binding) throws MetaMatrixComponentException {
+ ServiceInterface service = binding.getService();
+ if (service != null) {
+ return service.getConnectionPoolStats();
+ }
+ return Collections.EMPTY_LIST;
+ }
/**
* Return ServiceRegistryBinding for the given serviceID
Modified: trunk/server/src/main/java/com/metamatrix/platform/service/api/ServiceInterface.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/service/api/ServiceInterface.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/main/java/com/metamatrix/platform/service/api/ServiceInterface.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -29,6 +29,7 @@
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.config.api.DeployedComponentID;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.stats.ConnectionPoolStats;
import com.metamatrix.platform.service.controller.ServiceData;
public interface ServiceInterface {
@@ -119,7 +120,16 @@
*/
WorkerPoolStats getQueueStatistics(String name);
+
/**
+ * Returns a list of ConnectionPoolStat objects for the specific
+ * ConnectorBinding service
+ * If there are no ConnectionPoolStats, null is returned.
+ */
+ Collection<ConnectionPoolStats> getConnectionPoolStats();
+
+
+ /**
* There are reflective based calls on this
*/
void setInitException(Throwable t);
Modified: trunk/server/src/main/java/com/metamatrix/platform/service/controller/AbstractService.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/platform/service/controller/AbstractService.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/main/java/com/metamatrix/platform/service/controller/AbstractService.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -37,6 +37,7 @@
import com.metamatrix.common.config.api.DeployedComponentID;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.stats.ConnectionPoolStats;
import com.metamatrix.common.util.LogCommonConstants;
import com.metamatrix.common.util.PasswordMaskUtil;
import com.metamatrix.core.event.EventObjectListener;
@@ -559,4 +560,10 @@
return data;
}
+
+ public Collection<ConnectionPoolStats> getConnectionPoolStats() {
+ return Collections.EMPTY_LIST;
+ }
+
+
}
Modified: trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -71,6 +71,7 @@
import com.metamatrix.common.messaging.MessagingException;
import com.metamatrix.common.object.PropertyDefinition;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.stats.ConnectionPoolStats;
import com.metamatrix.common.util.LogCommonConstants;
import com.metamatrix.common.util.PropertiesUtils;
import com.metamatrix.common.util.crypto.CryptoException;
@@ -530,4 +531,10 @@
LogManager.logInfo(LogCommonConstants.CTX_CONFIG, ServerPlugin.Util.getString(messageProperty, value));
}
+ public Collection<ConnectionPoolStats> getConnectionPoolStats() {
+// return Collections.EMPTY_LIST;
+
+ return this.connectorMgr.getConnectionPoolStats();
+ }
+
}
\ No newline at end of file
Modified: trunk/server/src/main/resources/com/metamatrix/admin/server/i18n.properties
===================================================================
--- trunk/server/src/main/resources/com/metamatrix/admin/server/i18n.properties 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/main/resources/com/metamatrix/admin/server/i18n.properties 2009-05-18 01:43:02 UTC (rev 965)
@@ -68,6 +68,8 @@
ServerConfigAdminImpl.No_Objects_Found=No AdminObjects found for identifier {0} and class {1}.
ServerConfigAdminImpl.Multiple_Objects_Found=Multiple AdminObjects found for identifier {0} and class {1}.
+ServerConfigAdminImpl.Service_was_null_when_updating_properties=Problem updating properties for Service {0}
+
ServerRuntimeStateAdminImpl.clearing_cache=Clearing cache for cache identifier {0}.
ServerSecurityAdminImpl.User_name_too_long=The user name may not be null and cannot be longer than {0} charachters
ServerSecurityAdminImpl.neither_User_nor_Group=Parameter memberType is neither a User nor a Group.
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeCacheAdmin.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeCacheAdmin.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeCacheAdmin.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -37,6 +37,7 @@
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.config.api.DeployedComponentID;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.stats.ConnectionPoolStats;
import com.metamatrix.platform.service.api.CacheAdmin;
import com.metamatrix.platform.service.api.ServiceID;
import com.metamatrix.platform.service.api.ServiceInterface;
@@ -160,4 +161,11 @@
return null;
}
+ @Override
+ public Collection<ConnectionPoolStats> getConnectionPoolStats() {
+ return null;
+ }
+
+
+
}
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeConfigurationService.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -69,6 +69,7 @@
import com.metamatrix.common.config.model.ConfigurationModelContainerImpl;
import com.metamatrix.common.config.xml.XMLConfigurationImportExportUtility;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.stats.ConnectionPoolStats;
import com.metamatrix.common.util.PropertiesUtils;
import com.metamatrix.core.util.UnitTestUtil;
import com.metamatrix.platform.PlatformPlugin;
@@ -793,4 +794,18 @@
return null;
}
+
+
+
+
+
+
+
+ @Override
+ public Collection<ConnectionPoolStats> getConnectionPoolStats() {
+ return null;
+ }
+
+
+
}
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeQueryService.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -44,6 +44,7 @@
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.config.api.DeployedComponentID;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.stats.ConnectionPoolStats;
import com.metamatrix.dqp.message.AtomicRequestID;
import com.metamatrix.dqp.message.RequestID;
import com.metamatrix.platform.security.api.MetaMatrixSessionID;
@@ -296,4 +297,11 @@
return null;
}
+ @Override
+ public Collection<ConnectionPoolStats> getConnectionPoolStats() {
+ return null;
+ }
+
+
+
}
Modified: trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/test/java/com/metamatrix/admin/server/FakeServerSessionService.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -38,6 +38,7 @@
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.config.api.DeployedComponentID;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.stats.ConnectionPoolStats;
import com.metamatrix.platform.security.api.Credentials;
import com.metamatrix.platform.security.api.MetaMatrixPrincipal;
import com.metamatrix.platform.security.api.MetaMatrixSessionID;
@@ -271,4 +272,11 @@
return null;
}
+ @Override
+ public Collection<ConnectionPoolStats> getConnectionPoolStats() {
+ return null;
+ }
+
+
+
}
Modified: trunk/server/src/test/java/com/metamatrix/platform/service/controller/FakeService.java
===================================================================
--- trunk/server/src/test/java/com/metamatrix/platform/service/controller/FakeService.java 2009-05-18 01:36:17 UTC (rev 964)
+++ trunk/server/src/test/java/com/metamatrix/platform/service/controller/FakeService.java 2009-05-18 01:43:02 UTC (rev 965)
@@ -31,6 +31,7 @@
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.config.api.DeployedComponentID;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.stats.ConnectionPoolStats;
import com.metamatrix.platform.service.api.ServiceID;
public class FakeService implements FakeServiceInterface {
@@ -115,4 +116,11 @@
public ServiceData getServiceData() {
return null;
}
+ @Override
+ public Collection<ConnectionPoolStats> getConnectionPoolStats() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
}
15 years, 7 months
teiid SVN: r964 - in trunk/engine/src: main/java/org/teiid/dqp/internal/pooling/connector and 1 other directories.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-17 21:36:17 -0400 (Sun, 17 May 2009)
New Revision: 964
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/ConnectionPool.java
trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java
trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestPooledConnector.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - expose the stats out the ConnectionMgr
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-05-18 00:46:55 UTC (rev 963)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/datamgr/impl/ConnectorManager.java 2009-05-18 01:36:17 UTC (rev 964)
@@ -66,6 +66,7 @@
import com.metamatrix.common.queue.WorkerPool;
import com.metamatrix.common.queue.WorkerPoolFactory;
import com.metamatrix.common.queue.WorkerPoolStats;
+import com.metamatrix.common.stats.ConnectionPoolStats;
import com.metamatrix.common.util.PropertiesUtils;
import com.metamatrix.core.MetaMatrixCoreException;
import com.metamatrix.core.util.Assertion;
@@ -678,4 +679,15 @@
return StringUtil.valueOf(value, method.getReturnType());
}
}
+
+ public Collection<ConnectionPoolStats> getConnectionPoolStats() {
+ if (connector.getActualConnector() instanceof PooledConnector) {
+ PooledConnector pc = (PooledConnector) connector;
+
+ return pc.getConnectionPoolStats();
+
+ }
+ return Collections.EMPTY_LIST;
+
+ }
}
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/ConnectionPool.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/ConnectionPool.java 2009-05-18 00:46:55 UTC (rev 963)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/ConnectionPool.java 2009-05-18 01:36:17 UTC (rev 964)
@@ -312,8 +312,7 @@
synchronized (this.lock) {
this.reverseIdConnections.put(connection, id);
this.totalConnectionCount++;
- this.totalCreatedConnections++;
-
+
if (this.totalConnectionCount > this.maxConnections) {
ids = new ArrayList(this.idConnections.values());
}
@@ -355,6 +354,8 @@
connection = this.connectionFactory.getActualConnector().getConnection(id);
}
sourceConnection = new ConnectionWrapper(connection, this, testConnectInterval);
+ this.totalCreatedConnections++;
+
LogManager.logTrace(CTX_CONNECTOR, new Object[] {"Connection pool created a connection for", id}); //$NON-NLS-1$
} catch (ConnectorException e) {
throw new ConnectionPoolException(e);
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java 2009-05-18 00:46:55 UTC (rev 963)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/PooledConnector.java 2009-05-18 01:36:17 UTC (rev 964)
@@ -22,6 +22,8 @@
package org.teiid.dqp.internal.pooling.connector;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -40,7 +42,9 @@
import org.teiid.connector.xa.api.XAConnector;
import org.teiid.dqp.internal.datamgr.impl.ConnectorWrapper;
+import com.metamatrix.common.stats.ConnectionPoolStats;
+
/**
* Implements Pooling around a Connector or XAConnector.
*
@@ -85,15 +89,21 @@
private ConnectionPool pool;
private ConnectionPool xaPool;
+
+ private ConnectionPoolStats poolStats=null;
+ private ConnectionPoolStats xaPoolStats=null;
+
private Map<String, ConnectionWrapper> idToConnections = Collections.synchronizedMap(new HashMap<String, ConnectionWrapper>());
private ConnectorEnvironment environment;
public PooledConnector(Connector actualConnector) {
super(actualConnector);
pool = new ConnectionPool(this);
+ poolStats = new ConnectionPoolStats(ConnectionPoolStats.NON_XA_POOL_TYPE);
if (actualConnector instanceof XAConnector) {
xaPool = new ConnectionPool(this);
+ xaPoolStats = new ConnectionPoolStats(ConnectionPoolStats.XA_POOL_TYPE);
}
}
@@ -165,4 +175,29 @@
return conn;
}
+ public Collection <ConnectionPoolStats>getConnectionPoolStats() {
+ Collection<ConnectionPoolStats> pools = new ArrayList<ConnectionPoolStats>(2);
+
+ setStats(pool, poolStats);
+ pools.add(poolStats);
+
+ if (xaPool != null) {
+ setStats(xaPool, xaPoolStats);
+ pools.add(xaPoolStats);
+ }
+
+ return pools;
+ }
+
+ private void setStats(ConnectionPool connpool, ConnectionPoolStats stats) {
+
+ stats.setConnectionsWaiting(connpool.getNumberOfConnectinsWaiting());
+ stats.setConnectionsCreated(connpool.getTotalCreatedConnectionCount());
+ stats.setConnectionsDestroyed(connpool.getTotalDestroyedConnectionCount());
+ stats.setConnectionsInUse(connpool.getNumberOfConnectionsInUse());
+ stats.setTotalConnections(connpool.getTotalConnectionCount());
+
+
+ }
+
}
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestPooledConnector.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestPooledConnector.java 2009-05-18 00:46:55 UTC (rev 963)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestPooledConnector.java 2009-05-18 01:36:17 UTC (rev 964)
@@ -22,6 +22,7 @@
package org.teiid.dqp.internal.pooling.connector;
+import java.util.Collection;
import java.util.Properties;
import javax.transaction.Transaction;
@@ -52,6 +53,9 @@
conn.close();
XAConnection conn1 = pc.getXAConnection(Mockito.mock(ExecutionContext.class), tc);
assertSame(conn, conn1);
+
+ Collection stats = pc.getConnectionPoolStats();
+ assertEquals(2, stats.size());
pc.stop();
}
15 years, 7 months
teiid SVN: r963 - trunk/console/src/main/java/com/metamatrix/console/ui/views/vdb.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-17 20:46:55 -0400 (Sun, 17 May 2009)
New Revision: 963
Modified:
trunk/console/src/main/java/com/metamatrix/console/ui/views/vdb/VdbMainPanel.java
Log:
TEIID-420 disable vdbimport for all but system admins
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/vdb/VdbMainPanel.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/vdb/VdbMainPanel.java 2009-05-17 21:44:36 UTC (rev 962)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/vdb/VdbMainPanel.java 2009-05-18 00:46:55 UTC (rev 963)
@@ -253,7 +253,7 @@
javax.swing.JPanel pnlOps = new javax.swing.JPanel();
btnImportVDB = new ButtonWidget();
setup(MenuEntry.ACTION_MENUITEM, btnImportVDB, actionImportVDB);
- actionImportVDB.setEnabled(bCanModify);
+ actionImportVDB.setEnabled(UserCapabilities.getInstance().isSystemAdmin(connection));
btnExportVDB = new ButtonWidget();
setup(MenuEntry.ACTION_MENUITEM, btnExportVDB, actionExportVDB);
actionExportVDB.setEnabled(false);
15 years, 7 months