[teiid-commits] teiid SVN: r967 - in trunk/client/src/main/java/com/metamatrix/admin: api/objects and 1 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Sun May 17 21:45:55 EDT 2009


Author: vhalbert at 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




More information about the teiid-commits mailing list