teiid SVN: r952 - in trunk/engine/src: test/java/org/teiid/dqp/internal/pooling/connector and 1 other directory.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-15 14:09:13 -0400 (Fri, 15 May 2009)
New Revision: 952
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/ConnectionPool.java
trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java
Log:
Teiid-580 - adding support for monitoring connector connection pools - this change adds the logic to track the following:
- totalConnections (already there)
- totalConnectionsCreated
- totalConnectionsDestroyed
- totalConnectionsInUse
- totalConnectionsWaiting
including updates to testcases
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-15 17:25:24 UTC (rev 951)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/pooling/connector/ConnectionPool.java 2009-05-15 18:09:13 UTC (rev 952)
@@ -123,7 +123,23 @@
private Semaphore poolSemaphore;
+ /**
+ * Total number of connections that are currently in the system (in use or waiting)
+ */
private volatile int totalConnectionCount;
+ /**
+ * Total number of connections that have been created since the inception of this pool
+ */
+ private volatile int totalCreatedConnections;
+ /**
+ * Total number of connections that have been destroyed since the inception of this pool
+ */
+ private volatile int totalDestroyedConnections;
+
+ /**
+ * The number of connections currently in use by a client
+ */
+ private volatile int totalConnectionsInUse;
private volatile boolean shuttingDownPool;
@@ -249,6 +265,7 @@
LogManager.logDetail(CTX_CONNECTOR, new Object[] {"Existing connection leased for", id}); //$NON-NLS-1$
connLists.used.addLast(conn);
success = true;
+ this.totalConnectionsInUse++;
return conn;
} catch (ConnectorException e) {
LogManager.logDetail(CTX_CONNECTOR, new Object[] {"Existing connection failed to have identity updated", id}); //$NON-NLS-1$
@@ -270,7 +287,7 @@
}
updateStateWithNewConnection(id, connection, idSize);
-
+ this.totalConnectionsInUse++;
success = true;
return connection;
} catch (InterruptedException err) {
@@ -295,6 +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());
@@ -357,6 +375,7 @@
}
synchronized (connLists) {
+ totalConnectionsInUse--;
//release it only if there is one.
//If the same connection is to be released twice, just ignore
if ( connLists.used.remove(connection)) {
@@ -428,6 +447,7 @@
private void closeSourceConnection(ConnectionWrapper connection, ConnectorIdentity id) {
synchronized (this.lock) {
this.totalConnectionCount--;
+ this.totalDestroyedConnections++;
this.reverseIdConnections.remove(connection);
}
try {
@@ -475,9 +495,25 @@
return Collections.emptyList();
}
- //for testing purpose
+
int getTotalConnectionCount() {
return this.totalConnectionCount;
}
+
+ int getTotalCreatedConnectionCount() {
+ return this.totalCreatedConnections;
+ }
+
+ int getTotalDestroyedConnectionCount() {
+ return this.totalDestroyedConnections;
+ }
+
+ int getNumberOfConnectionsInUse() {
+ return this.totalConnectionsInUse;
+ }
+
+ int getNumberOfConnectinsWaiting() {
+ return this.totalConnectionCount - this.totalConnectionsInUse;
+ }
}
\ No newline at end of file
Modified: trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java
===================================================================
--- trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java 2009-05-15 17:25:24 UTC (rev 951)
+++ trunk/engine/src/test/java/org/teiid/dqp/internal/pooling/connector/TestConnectionPool.java 2009-05-15 18:09:13 UTC (rev 952)
@@ -101,10 +101,28 @@
ConnectionWrapper conn1 = singleIDPool.obtain(context);
ConnectionWrapper conn2 = singleIDPool.obtain(context);
ConnectionWrapper conn3 = singleIDPool.obtain(context);
- ConnectionWrapper conn4 = singleIDPool.obtain(context);
+ ConnectionWrapper conn4 = singleIDPool.obtain(context);
+
+ assertEquals(4, singleIDPool.getTotalCreatedConnectionCount());
+ assertEquals(4, singleIDPool.getTotalConnectionCount());
+ assertEquals(4, singleIDPool.getNumberOfConnectionsInUse());
+ assertEquals(0, singleIDPool.getNumberOfConnectinsWaiting());
+ assertEquals(0, singleIDPool.getTotalDestroyedConnectionCount());
+
+
+
+
singleIDPool.release(conn2, false);
singleIDPool.release(conn4, true);
+ // only 1 has been closed/destroyed #4
+ assertEquals(3, singleIDPool.getTotalConnectionCount());
+ assertEquals(1, singleIDPool.getTotalDestroyedConnectionCount());
+ assertEquals(1, singleIDPool.getNumberOfConnectinsWaiting());
+ assertEquals(4, singleIDPool.getTotalCreatedConnectionCount());
+ assertEquals(2, singleIDPool.getNumberOfConnectionsInUse());
+
+
List unusedConns = singleIDPool.getUnusedConnections(conn1);
assertEquals(1, unusedConns.size());
assertTrue(unusedConns.contains(conn2));
@@ -112,7 +130,7 @@
assertEquals(2, usedConns.size());
assertTrue(usedConns.contains(conn1));
assertTrue(usedConns.contains(conn3));
- assertEquals(3, singleIDPool.getTotalConnectionCount());
+ assertEquals(3, singleIDPool.getTotalConnectionCount());
}
@Test public void testMaxConnectionTest() throws Exception {
@@ -223,10 +241,27 @@
userIDPool.obtain(context1);
ConnectionWrapper conn2 = userIDPool.obtain(context1);
ConnectionWrapper conn3 = userIDPool.obtain(context2);
- ConnectionWrapper conn4 = userIDPool.obtain(context2);
+ ConnectionWrapper conn4 = userIDPool.obtain(context2);
+
+ assertEquals(4, userIDPool.getTotalCreatedConnectionCount());
+ assertEquals(4, userIDPool.getTotalConnectionCount());
+ assertEquals(4, userIDPool.getNumberOfConnectionsInUse());
+ assertEquals(0, userIDPool.getNumberOfConnectinsWaiting());
+ assertEquals(0, userIDPool.getTotalDestroyedConnectionCount());
+
+
+
userIDPool.release(conn2, false);
userIDPool.release(conn4, true);
+ // only 1 has been closed/destroyed #4
+ assertEquals(3, userIDPool.getTotalConnectionCount());
+ assertEquals(1, userIDPool.getTotalDestroyedConnectionCount());
+ assertEquals(1, userIDPool.getNumberOfConnectinsWaiting());
+ assertEquals(4, userIDPool.getTotalCreatedConnectionCount());
+ assertEquals(2, userIDPool.getNumberOfConnectionsInUse());
+
+
List unusedConns = userIDPool.getUnusedConnections(conn2);
assertEquals(1, unusedConns.size());
assertTrue(unusedConns.contains(conn2));
15 years, 7 months
teiid SVN: r951 - trunk/engine/src/main/java/org/teiid/dqp/internal/transaction.
by teiid-commits@lists.jboss.org
Author: li.liang
Date: 2009-05-15 13:25:24 -0400 (Fri, 15 May 2009)
New Revision: 951
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java
Log:
TEIID-604 Changed not to throw exception when end is called with flag TMFAIL.
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java 2009-05-15 17:04:01 UTC (rev 950)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/transaction/TransactionServerImpl.java 2009-05-15 17:25:24 UTC (rev 951)
@@ -312,7 +312,7 @@
} catch (SystemException err) {
throw new XATransactionException(err, XAException.XAER_RMERR);
}
- throw new XATransactionException(new XAException(XAException.XA_RBROLLBACK));
+ break;
}
default:
throw new XATransactionException(XAException.XAER_INVAL, DQPPlugin.Util.getString("TransactionServer.unknown_flags")); //$NON-NLS-1$
@@ -329,7 +329,7 @@
TransactionContextImpl tc = transactions.getTransactionContext(xid);
if (transactionExpected && tc == null) {
- throw new XATransactionException(XAException.XAER_INVAL, DQPPlugin.Util.getString("TransactionServer.no_global_transaction", xid)); //$NON-NLS-1$
+ throw new XATransactionException(XAException.XAER_NOTA, DQPPlugin.Util.getString("TransactionServer.no_global_transaction", xid)); //$NON-NLS-1$
} else if (!transactionExpected) {
if (tc != null) {
throw new XATransactionException(XAException.XAER_DUPID, DQPPlugin.Util.getString("TransactionServer.existing_global_transaction", new Object[] {xid})); //$NON-NLS-1$
15 years, 7 months
teiid SVN: r950 - in trunk: console/src/main/java/com/metamatrix/console/ui/views/authorization and 1 other directory.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-15 13:04:01 -0400 (Fri, 15 May 2009)
New Revision: 950
Modified:
trunk/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigurationPropertyNames.java
trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/ProvidersMain.java
Log:
TEIID-603 console was not using the common property key. updated and used the old property key just to be safe.
Modified: trunk/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigurationPropertyNames.java
===================================================================
--- trunk/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigurationPropertyNames.java 2009-05-15 16:40:17 UTC (rev 949)
+++ trunk/common-internal/src/main/java/com/metamatrix/common/config/util/ConfigurationPropertyNames.java 2009-05-15 17:04:01 UTC (rev 950)
@@ -40,6 +40,6 @@
public static final String MEMBERSHIP_ADMIN_PASSWORD = "security.membership.admin.password"; //$NON-NLS-1$
public static final String MEMBERSHIP_ADMIN_USERNAME = "security.membership.admin.username"; //$NON-NLS-1$
public static final String MEMBERSHIP_SECURITY_ENABLED = "security.membership.security.enabled"; //$NON-NLS-1$
- public static final String MEMBERSHIP_DOMAIN_ORDER = "security.membership.security.DomainOrder"; //$NON-NLS-1$
+ public static final String MEMBERSHIP_DOMAIN_ORDER = "security.membership.DomainOrder"; //$NON-NLS-1$
}
Modified: trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/ProvidersMain.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/ProvidersMain.java 2009-05-15 16:40:17 UTC (rev 949)
+++ trunk/console/src/main/java/com/metamatrix/console/ui/views/authorization/ProvidersMain.java 2009-05-15 17:04:01 UTC (rev 950)
@@ -59,6 +59,7 @@
import com.metamatrix.common.config.api.AuthenticationProvider;
import com.metamatrix.common.config.api.Configuration;
import com.metamatrix.common.config.api.ServiceComponentDefn;
+import com.metamatrix.common.config.util.ConfigurationPropertyNames;
import com.metamatrix.common.log.LogManager;
import com.metamatrix.console.connections.ConnectionInfo;
import com.metamatrix.console.models.AuthenticationProviderManager;
@@ -415,7 +416,7 @@
ServiceComponentDefn serviceDefn = config.getServiceComponentDefn(ResourceNames.MEMBERSHIP_SERVICE);
Properties currentProps = serviceDefn.getProperties();
- currentProps.put("security.membership.DomainOrder",sb.toString()); //$NON-NLS-1$
+ currentProps.put(ConfigurationPropertyNames.MEMBERSHIP_DOMAIN_ORDER,sb.toString());
getConfigurationManager().modifyService(serviceDefn,currentProps);
}
15 years, 7 months
teiid SVN: r949 - in trunk: common-core/src/main/java/com/metamatrix/api/exception and 4 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-15 12:40:17 -0400 (Fri, 15 May 2009)
New Revision: 949
Modified:
trunk/client/src/main/java/com/metamatrix/client/ExceptionUtil.java
trunk/common-core/src/main/java/com/metamatrix/api/exception/ExceptionHolder.java
trunk/common-core/src/main/java/com/metamatrix/api/exception/MetaMatrixException.java
trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixRuntimeException.java
trunk/console/src/main/java/com/metamatrix/console/util/ExceptionUtility.java
trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java
Log:
TEIID-602 checks to prevent child exceptions from reporting their cause as themselves (which shouldn't be happening, but may be coming from an inappropriate override by a third-party). this doesn't prevent more exotic recursive scenarios, but those typically don't happen.
Modified: trunk/client/src/main/java/com/metamatrix/client/ExceptionUtil.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/client/ExceptionUtil.java 2009-05-15 15:37:25 UTC (rev 948)
+++ trunk/client/src/main/java/com/metamatrix/client/ExceptionUtil.java 2009-05-15 16:40:17 UTC (rev 949)
@@ -39,6 +39,9 @@
if (cls.isAssignableFrom(ex.getClass())) {
return (T)ex;
}
+ if (ex.getCause() == ex) {
+ break;
+ }
ex = ex.getCause();
}
return null;
Modified: trunk/common-core/src/main/java/com/metamatrix/api/exception/ExceptionHolder.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/api/exception/ExceptionHolder.java 2009-05-15 15:37:25 UTC (rev 948)
+++ trunk/common-core/src/main/java/com/metamatrix/api/exception/ExceptionHolder.java 2009-05-15 16:40:17 UTC (rev 949)
@@ -110,7 +110,7 @@
out.writeObject(exception.getStackTrace());
// specify that this cause is nested exception; not top level
- if (this.exception.getCause() != null) {
+ if (this.exception.getCause() != null && this.exception.getCause() != this.exception) {
out.writeObject(new ExceptionHolder(this.exception.getCause(), true));
}
else {
Modified: trunk/common-core/src/main/java/com/metamatrix/api/exception/MetaMatrixException.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/api/exception/MetaMatrixException.java 2009-05-15 15:37:25 UTC (rev 948)
+++ trunk/common-core/src/main/java/com/metamatrix/api/exception/MetaMatrixException.java 2009-05-15 16:40:17 UTC (rev 949)
@@ -22,9 +22,6 @@
package com.metamatrix.api.exception;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
import java.util.Iterator;
import com.metamatrix.core.MetaMatrixCoreException;
Modified: trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixRuntimeException.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixRuntimeException.java 2009-05-15 15:37:25 UTC (rev 948)
+++ trunk/common-core/src/main/java/com/metamatrix/core/MetaMatrixRuntimeException.java 2009-05-15 16:40:17 UTC (rev 949)
@@ -166,10 +166,7 @@
* @return The linked exception
*/
public Throwable getChild() {
- if (this.getCause() != this) {
- return this.getCause();
- }
- return null;
+ return this.getCause();
}
/**
Modified: trunk/console/src/main/java/com/metamatrix/console/util/ExceptionUtility.java
===================================================================
--- trunk/console/src/main/java/com/metamatrix/console/util/ExceptionUtility.java 2009-05-15 15:37:25 UTC (rev 948)
+++ trunk/console/src/main/java/com/metamatrix/console/util/ExceptionUtility.java 2009-05-15 16:40:17 UTC (rev 949)
@@ -134,7 +134,7 @@
}
}
- showMessage(text, comment, thr.getCause(), root);
+ showMessage(text, comment, thr.getCause() != thr?thr.getCause():null, root);
}
public static void showMessage(String text, Throwable t) {
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2009-05-15 15:37:25 UTC (rev 948)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/RequestWorkItem.java 2009-05-15 16:40:17 UTC (rev 949)
@@ -231,7 +231,7 @@
//log the processing errors as warnings only
if(e instanceof MetaMatrixProcessingException) {
Throwable cause = e;
- while (cause.getCause() != null) {
+ while (cause.getCause() != null && cause.getCause() != cause) {
cause = e.getCause();
}
StackTraceElement elem = cause.getStackTrace()[0];
Modified: trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java 2009-05-15 15:37:25 UTC (rev 948)
+++ trunk/server/src/main/java/com/metamatrix/common/comm/platform/socket/server/ServerWorkItem.java 2009-05-15 16:40:17 UTC (rev 949)
@@ -169,7 +169,7 @@
private void logProcessingException(Throwable e, String context) {
Throwable cause = e;
- while (cause.getCause() != null) {
+ while (cause.getCause() != null && cause != cause.getCause()) {
cause = e.getCause();
}
StackTraceElement elem = cause.getStackTrace()[0];
15 years, 7 months
teiid SVN: r948 - trunk/server/src/main/java/com/metamatrix/admin/server.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-15 11:37:25 -0400 (Fri, 15 May 2009)
New Revision: 948
Modified:
trunk/server/src/main/java/com/metamatrix/admin/server/ServerConfigAdminImpl.java
Log:
Teiid-570 - changes to support exposing services - adding Service to option to update the ServiceDefn
Modified: trunk/server/src/main/java/com/metamatrix/admin/server/ServerConfigAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/ServerConfigAdminImpl.java 2009-05-15 15:35:40 UTC (rev 947)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/ServerConfigAdminImpl.java 2009-05-15 15:37:25 UTC (rev 948)
@@ -1582,6 +1582,39 @@
}
break;
+ case MMAdminObject.OBJECT_TYPE_SERVICE:
+ String serviceName = adminObject.getName();
+ try {
+ ServiceComponentDefn serviceDefn = this.getServiceByName(serviceName);
+
+ Properties svcProperties = serviceDefn.getProperties();
+ svcProperties.putAll(properties);
+
+ ServiceComponentDefn updatedServiceDefn =
+ (ServiceComponentDefn)getConfigurationServiceProxy().modify(serviceDefn,
+ svcProperties,
+ getUserName());
+
+ if (updatedServiceDefn == null) {
+ throwProcessingException("ServerConfigAdminImpl.Service_was_null_when_updating_properties", new Object[] {serviceName}); //$NON-NLS-1$
+ }
+ } catch (ConfigurationException e) {
+ throw new AdminComponentException(e);
+ } catch (ServiceException e) {
+ throw new AdminComponentException(e);
+ } catch (InvalidSessionException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (AuthorizationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (MetaMatrixComponentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ break;
+
+
default:
throwProcessingException("ServerConfigAdminImpl.Unsupported_Admin_Object", new Object[] {className}); //$NON-NLS-1$
}
15 years, 7 months
teiid SVN: r947 - trunk/server/src/main/java/com/metamatrix/admin/server.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-15 11:35:40 -0400 (Fri, 15 May 2009)
New Revision: 947
Modified:
trunk/server/src/main/java/com/metamatrix/admin/server/AbstractAdminImpl.java
Log:
Teiid-570 - changes to support exposing services - adding Service to option to return for getAdminObjects
Modified: trunk/server/src/main/java/com/metamatrix/admin/server/AbstractAdminImpl.java
===================================================================
--- trunk/server/src/main/java/com/metamatrix/admin/server/AbstractAdminImpl.java 2009-05-15 14:37:19 UTC (rev 946)
+++ trunk/server/src/main/java/com/metamatrix/admin/server/AbstractAdminImpl.java 2009-05-15 15:35:40 UTC (rev 947)
@@ -517,7 +517,9 @@
case MMAdminObject.OBJECT_TYPE_QUEUE_WORKER_POOL:
return parent.getQueueWorkerPools(identifier);
case MMAdminObject.OBJECT_TYPE_REQUEST:
- return parent.getRequests(identifier);
+ return parent.getRequests(identifier);
+ case MMAdminObject.OBJECT_TYPE_SERVICE:
+ return parent.getServices(identifier);
case MMAdminObject.OBJECT_TYPE_RESOURCE:
return parent.getResources(identifier);
case MMAdminObject.OBJECT_TYPE_SESSION:
15 years, 7 months
teiid SVN: r946 - in trunk: common-core/src/main/java/com/metamatrix/common/classloader and 6 other directories.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-15 10:37:19 -0400 (Fri, 15 May 2009)
New Revision: 946
Added:
trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java
Removed:
trunk/common-core/src/main/java/com/metamatrix/common/classloader/NonDelegatingClassLoader.java
Modified:
trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java
trunk/common-core/src/main/java/com/metamatrix/common/classloader/URLFilteringClassLoader.java
trunk/common-core/src/test/java/com/metamatrix/api/exception/TestExceptionHolder.java
trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestNonDelegatingClassLoader.java
trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestURLFilteringClassLoader.java
trunk/common-core/src/test/java/com/metamatrix/common/protocol/TestClasspathURLHandler.java
trunk/common-internal/src/test/java/com/metamatrix/common/config/model/TestPropertyValidation.java
trunk/engine/src/main/java/com/metamatrix/query/function/UDFSource.java
trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java
Log:
TEIID-600 renaming non to post delegating and changing common extension to be a delegating classloader.
Modified: trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java
===================================================================
--- trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java 2009-05-15 14:34:39 UTC (rev 945)
+++ trunk/client-jdbc/src/main/java/com/metamatrix/jdbc/EmbeddedDriver.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -44,7 +44,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
+import com.metamatrix.common.classloader.PostDelegatingClassLoader;
import com.metamatrix.common.protocol.MMURLConnection;
import com.metamatrix.common.protocol.MetaMatrixURLStreamHandlerFactory;
import com.metamatrix.common.protocol.URLHelper;
@@ -390,7 +390,7 @@
if (postDelegationClasspathList != null && !postDelegationClasspathList.isEmpty()) {
URL[] path = postDelegationClasspathList.toArray(new URL[postDelegationClasspathList.size()]);
- this.classLoader = new NonDelegatingClassLoader(path, this.classLoader, new MetaMatrixURLStreamHandlerFactory());
+ this.classLoader = new PostDelegatingClassLoader(path, this.classLoader, new MetaMatrixURLStreamHandlerFactory());
}
String logMsg = BaseDataSource.getResourceMessage("EmbeddedDriver.use_classpath"); //$NON-NLS-1$
Deleted: trunk/common-core/src/main/java/com/metamatrix/common/classloader/NonDelegatingClassLoader.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/classloader/NonDelegatingClassLoader.java 2009-05-15 14:34:39 UTC (rev 945)
+++ trunk/common-core/src/main/java/com/metamatrix/common/classloader/NonDelegatingClassLoader.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -1,113 +0,0 @@
-/*
- * 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.common.classloader;
-
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.net.URLStreamHandlerFactory;
-
-/**
- * This Class circumvents the
- * java ClassLoader delegation model. This ClassLoader
- * will first look in it's own store of classes, and only
- * then check it's parent ClassLoader, which is the reverse
- * of the delegation model.
- */
-public class NonDelegatingClassLoader extends URLClassLoader {
-
- public NonDelegatingClassLoader(URL[] urls, ClassLoader parent) {
- super(urls, parent);
- }
-
- public NonDelegatingClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory) {
- super(urls, parent, factory);
- }
-
-
- public NonDelegatingClassLoader(URL[] urls) {
- super(urls);
- }
-
-
- /**
- * By overriding this method, this Class circumvents the
- * java ClassLoader delegation model. This ClassLoader
- * will first look in it's own store of classes, and only
- * then check it's parent ClassLoader, which is the reverse
- * of the delegation model.
- * <p>
- * @param name The name of the class to load
- * @return Class loaded Class object
- * @see java.lang.ClassLoader#loadClass(java.lang.String)
- */
- public synchronized Class loadClass(String name) throws ClassNotFoundException {
-
- Class loadedClass = this.findLoadedClass(name);
- if (loadedClass != null) {
- return loadedClass;
- }
-
-
- // class not in cache
- try {
- loadedClass = super.findClass(name);
- } catch (ClassNotFoundException e) {
- // ignore, check parent ClassLoader
- } catch (SecurityException e) {
- // ignore, check parent ClassLoader
- /*
- * ClassLoader.defineClass throws a SecurityException if this
- * ClassLoader attempts to load a class under the "java."
- * package hierarchy.
- */
- }
-
- // if class not found, delegate to parent
- if(loadedClass == null) {
- // Will throw ClassNotFoundException if not found in parent
- loadedClass = this.getParent().loadClass(name);
- }
-
-
- return loadedClass;
- }
-
-
- /**
- * By overriding this method, this Class circumvents the
- * java ClassLoader delegation model. This ClassLoader
- * will first look in it's own store of resources, and only
- * then check it's parent ClassLoader, which is the reverse
- * of the delegation model.
- * @param name The name of the resource to load
- * @return URL of resource
- * @see java.lang.ClassLoader#getResource(java.lang.String)
- */
- public URL getResource(String name) {
- URL url = super.findResource(name);
- if (url == null){
- url = this.getParent().getResource(name);
- }
- return url;
- }
-}
Copied: trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java (from rev 941, trunk/common-core/src/main/java/com/metamatrix/common/classloader/NonDelegatingClassLoader.java)
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java (rev 0)
+++ trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -0,0 +1,113 @@
+/*
+ * 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.common.classloader;
+
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLStreamHandlerFactory;
+
+/**
+ * This Class circumvents the
+ * java ClassLoader delegation model. This ClassLoader
+ * will first look in it's own store of classes, and only
+ * then check it's parent ClassLoader, which is the reverse
+ * of the delegation model.
+ */
+public class PostDelegatingClassLoader extends URLClassLoader {
+
+ public PostDelegatingClassLoader(URL[] urls, ClassLoader parent) {
+ super(urls, parent);
+ }
+
+ public PostDelegatingClassLoader(URL[] urls, ClassLoader parent, URLStreamHandlerFactory factory) {
+ super(urls, parent, factory);
+ }
+
+
+ public PostDelegatingClassLoader(URL[] urls) {
+ super(urls);
+ }
+
+
+ /**
+ * By overriding this method, this Class circumvents the
+ * java ClassLoader delegation model. This ClassLoader
+ * will first look in it's own store of classes, and only
+ * then check it's parent ClassLoader, which is the reverse
+ * of the delegation model.
+ * <p>
+ * @param name The name of the class to load
+ * @return Class loaded Class object
+ * @see java.lang.ClassLoader#loadClass(java.lang.String)
+ */
+ public synchronized Class loadClass(String name) throws ClassNotFoundException {
+
+ Class loadedClass = this.findLoadedClass(name);
+ if (loadedClass != null) {
+ return loadedClass;
+ }
+
+
+ // class not in cache
+ try {
+ loadedClass = super.findClass(name);
+ } catch (ClassNotFoundException e) {
+ // ignore, check parent ClassLoader
+ } catch (SecurityException e) {
+ // ignore, check parent ClassLoader
+ /*
+ * ClassLoader.defineClass throws a SecurityException if this
+ * ClassLoader attempts to load a class under the "java."
+ * package hierarchy.
+ */
+ }
+
+ // if class not found, delegate to parent
+ if(loadedClass == null) {
+ // Will throw ClassNotFoundException if not found in parent
+ loadedClass = this.getParent().loadClass(name);
+ }
+
+
+ return loadedClass;
+ }
+
+
+ /**
+ * By overriding this method, this Class circumvents the
+ * java ClassLoader delegation model. This ClassLoader
+ * will first look in it's own store of resources, and only
+ * then check it's parent ClassLoader, which is the reverse
+ * of the delegation model.
+ * @param name The name of the resource to load
+ * @return URL of resource
+ * @see java.lang.ClassLoader#getResource(java.lang.String)
+ */
+ public URL getResource(String name) {
+ URL url = super.findResource(name);
+ if (url == null){
+ url = this.getParent().getResource(name);
+ }
+ return url;
+ }
+}
Property changes on: trunk/common-core/src/main/java/com/metamatrix/common/classloader/PostDelegatingClassLoader.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/common-core/src/main/java/com/metamatrix/common/classloader/URLFilteringClassLoader.java
===================================================================
--- trunk/common-core/src/main/java/com/metamatrix/common/classloader/URLFilteringClassLoader.java 2009-05-15 14:34:39 UTC (rev 945)
+++ trunk/common-core/src/main/java/com/metamatrix/common/classloader/URLFilteringClassLoader.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -23,6 +23,7 @@
package com.metamatrix.common.classloader;
import java.net.URL;
+import java.net.URLClassLoader;
import java.net.URLStreamHandlerFactory;
import java.util.ArrayList;
import java.util.HashSet;
@@ -35,12 +36,12 @@
/**
* @since 4.3
*/
-public class URLFilteringClassLoader extends NonDelegatingClassLoader {
+public class URLFilteringClassLoader extends URLClassLoader {
- private static HashSet excludeProtocols = null;
+ private static HashSet<String> excludeProtocols = null;
static {
- excludeProtocols = new HashSet();
+ excludeProtocols = new HashSet<String>();
excludeProtocols.add("extensionjar"); //$NON-NLS-1$
excludeProtocols.add(ClasspathURLConnection.PROTOCOL);
excludeProtocols.add(MMFileURLConnection.PROTOCOL);
@@ -80,7 +81,7 @@
* JBOSS is using to filter out our extensionjar URLs. Interestingly, WebLogic does not use this
* function, so I think JBOSS may be doing something wrong here.
*/
- ArrayList temp = new ArrayList();
+ ArrayList<URL> temp = new ArrayList<URL>();
URL[] all = super.getURLs();
for (int i = 0; i < all.length; i++) {
String protocol = all[i].getProtocol();
@@ -88,7 +89,7 @@
temp.add(all[i]);
}
}
- return (URL[])temp.toArray(new URL[temp.size()]);
+ return temp.toArray(new URL[temp.size()]);
}
}
Modified: trunk/common-core/src/test/java/com/metamatrix/api/exception/TestExceptionHolder.java
===================================================================
--- trunk/common-core/src/test/java/com/metamatrix/api/exception/TestExceptionHolder.java 2009-05-15 14:34:39 UTC (rev 945)
+++ trunk/common-core/src/test/java/com/metamatrix/api/exception/TestExceptionHolder.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -1,7 +1,5 @@
package com.metamatrix.api.exception;
-import static org.junit.Assert.*;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
@@ -14,9 +12,7 @@
import org.junit.Test;
-import com.metamatrix.api.exception.ExceptionHolder;
-import com.metamatrix.api.exception.MetaMatrixProcessingException;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
+import com.metamatrix.common.classloader.PostDelegatingClassLoader;
import com.metamatrix.core.MetaMatrixRuntimeException;
import com.metamatrix.core.util.ReflectionHelper;
import com.metamatrix.core.util.UnitTestUtil;
@@ -34,7 +30,7 @@
}
@Test public void testDeserializationUnknownException() throws Exception {
- ClassLoader cl = new NonDelegatingClassLoader(new URL[] {UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
+ ClassLoader cl = new PostDelegatingClassLoader(new URL[] {UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
Object obj = ReflectionHelper.create("test.Test", null, cl); //$NON-NLS-1$
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -60,7 +56,7 @@
}
@Test public void testDeserializationUnknownChildException() throws Exception {
- ClassLoader cl = new NonDelegatingClassLoader(new URL[] {UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
+ ClassLoader cl = new PostDelegatingClassLoader(new URL[] {UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
Exception obj = (Exception)ReflectionHelper.create("test.UnknownException", null, cl); //$NON-NLS-1$
obj.initCause(new SQLException("something bad happended")); //$NON-NLS-1$
@@ -82,7 +78,7 @@
}
@Test public void testDeserializationUnknownChildException2() throws Exception {
- ClassLoader cl = new NonDelegatingClassLoader(new URL[] {UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
+ ClassLoader cl = new PostDelegatingClassLoader(new URL[] {UnitTestUtil.getTestDataFile("test.jar").toURI().toURL()}); //$NON-NLS-1$
ArrayList<String> args = new ArrayList<String>();
args.add("Unknown Exception"); //$NON-NLS-1$
Exception obj = (Exception)ReflectionHelper.create("test.UnknownException", args, cl); //$NON-NLS-1$
Modified: trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestNonDelegatingClassLoader.java
===================================================================
--- trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestNonDelegatingClassLoader.java 2009-05-15 14:34:39 UTC (rev 945)
+++ trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestNonDelegatingClassLoader.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -36,7 +36,7 @@
import com.metamatrix.core.util.UnitTestUtil;
/**
- * Test {@link NonDelegatingClassLoader}
+ * Test {@link PostDelegatingClassLoader}
*/
public class TestNonDelegatingClassLoader extends TestCase {
@@ -52,8 +52,8 @@
private URL[] getURLs() throws Exception {
URL[] result = new URL[2];
- result[0] = UnitTestUtil.getTestDataFile("extensionmodule/testjar.jar").toURL(); //$NON-NLS-1$
- result[1] = UnitTestUtil.getTestDataFile("extensionmodule/testjar2.jar").toURL(); //$NON-NLS-1$
+ result[0] = UnitTestUtil.getTestDataFile("extensionmodule/testjar.jar").toURI().toURL(); //$NON-NLS-1$
+ result[1] = UnitTestUtil.getTestDataFile("extensionmodule/testjar2.jar").toURI().toURL(); //$NON-NLS-1$
return result;
}
@@ -63,16 +63,16 @@
String classname = "com.test.TestClass"; //$NON-NLS-1$
String expectedToString = "This is a test class"; //$NON-NLS-1$
- NonDelegatingClassLoader loader = new NonDelegatingClassLoader(getURLs());
+ PostDelegatingClassLoader loader = new PostDelegatingClassLoader(getURLs());
- Class clazz = loader.loadClass(classname);
+ Class<?> clazz = loader.loadClass(classname);
Object obj = clazz.newInstance();
assertEquals(expectedToString, obj.toString());
}
public void testLoadResource() throws Exception {
String resourcename = "com/test/TestDoc.txt"; //$NON-NLS-1$
- NonDelegatingClassLoader loader = new NonDelegatingClassLoader(getURLs());
+ PostDelegatingClassLoader loader = new PostDelegatingClassLoader(getURLs());
InputStream stream = loader.getResourceAsStream(resourcename);
assertNotNull(stream);
@@ -90,7 +90,7 @@
public void testLoadResourceFileProtocol() throws Exception {
String resourcename = "nonModelFile.txt"; //$NON-NLS-1$
URL url = new URL("file", "localhost", UnitTestUtil.getTestDataPath()); //$NON-NLS-1$ //$NON-NLS-2$
- NonDelegatingClassLoader loader = new NonDelegatingClassLoader(new URL[] {
+ PostDelegatingClassLoader loader = new PostDelegatingClassLoader(new URL[] {
url
});
@@ -102,13 +102,13 @@
}
public void testGetURLs() throws Exception {
- URL url1 = new URL("extensionjar", "localhost", -1, "testjar.jar", new URLStreamHandler() {
+ URL url1 = new URL("extensionjar", "localhost", -1, "testjar.jar", new URLStreamHandler() { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@Override
protected URLConnection openConnection(URL u) throws IOException {
return null;
- }}); //$NON-NLS-1$
- URL url2 = UnitTestUtil.getTestDataFile("Books.xsd").toURL(); //$NON-NLS-1$
- NonDelegatingClassLoader loader = new URLFilteringClassLoader(new URL[] {
+ }});
+ URL url2 = UnitTestUtil.getTestDataFile("Books.xsd").toURI().toURL(); //$NON-NLS-1$
+ PostDelegatingClassLoader loader = new PostDelegatingClassLoader(new URL[] {
url1, url2
}, this.getClass().getClassLoader(), new MetaMatrixURLStreamHandlerFactory());
URL[] urls = loader.getURLs();
Modified: trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestURLFilteringClassLoader.java
===================================================================
--- trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestURLFilteringClassLoader.java 2009-05-15 14:34:39 UTC (rev 945)
+++ trunk/common-core/src/test/java/com/metamatrix/common/classloader/TestURLFilteringClassLoader.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -22,11 +22,16 @@
package com.metamatrix.common.classloader;
+import static org.junit.Assert.*;
+
+import java.lang.reflect.Proxy;
import java.net.URL;
import java.util.HashSet;
-import junit.framework.TestCase;
+import javax.sql.DataSource;
+import org.junit.Test;
+
import com.metamatrix.common.protocol.MetaMatrixURLStreamHandlerFactory;
import com.metamatrix.common.protocol.URLHelper;
@@ -34,12 +39,12 @@
/**
* @since 4.3
*/
-public class TestURLFilteringClassLoader extends TestCase {
+public class TestURLFilteringClassLoader {
/*
* Test method for 'com.metamatrix.common.classloader.URLFilteringClassLoader.getURLs()'
*/
- public void testGetURLs() throws Exception{
+ @Test public void testGetURLs() throws Exception{
URL http = URLHelper.buildURL("http://foo.com/foo.jar"); //$NON-NLS-1$
URL ftp = URLHelper.buildURL("ftp://foo.com/foo.jar"); //$NON-NLS-1$
URL mmfile = URLHelper.buildURL("mmfile:foo.jar"); //$NON-NLS-1$
@@ -66,4 +71,5 @@
assertTrue(!filteredURLSet.contains(mmrofile));
assertTrue(!filteredURLSet.contains(classpath));
}
+
}
Modified: trunk/common-core/src/test/java/com/metamatrix/common/protocol/TestClasspathURLHandler.java
===================================================================
--- trunk/common-core/src/test/java/com/metamatrix/common/protocol/TestClasspathURLHandler.java 2009-05-15 14:34:39 UTC (rev 945)
+++ trunk/common-core/src/test/java/com/metamatrix/common/protocol/TestClasspathURLHandler.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -37,7 +37,7 @@
import junit.framework.TestCase;
import junit.framework.TestSuite;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
+import com.metamatrix.common.classloader.PostDelegatingClassLoader;
import com.metamatrix.core.util.UnitTestUtil;
@@ -157,7 +157,7 @@
URL patchurl = new URL(patchpath);
URL url = new URL(path);
- ClassLoader jarClassPath = new NonDelegatingClassLoader(new URL[] {patchurl, url}, previousClsLoader);
+ ClassLoader jarClassPath = new PostDelegatingClassLoader(new URL[] {patchurl, url}, previousClsLoader);
Thread.currentThread().setContextClassLoader(jarClassPath);
URL fooURL = URLHelper.buildURL("classpath:pathtest/foo.txt"); //$NON-NLS-1$
@@ -183,7 +183,7 @@
// Right now there is an error with issuing patches with "classpath"
// protocol (defect 21557), there is no fix just workaround, that is
// to reverse the url path to the class loader.
- ClassLoader jarClassLoader = new NonDelegatingClassLoader(new URL[] {url, patchurl}, previousClsLoader, new MetaMatrixURLStreamHandlerFactory());
+ ClassLoader jarClassLoader = new PostDelegatingClassLoader(new URL[] {url, patchurl}, previousClsLoader, new MetaMatrixURLStreamHandlerFactory());
// this is how it is supposed to work!
ClassLoader urlClassLoader = new URLClassLoader(new URL[] {patchurl, url}, previousClsLoader, new MetaMatrixURLStreamHandlerFactory());
Modified: trunk/common-internal/src/test/java/com/metamatrix/common/config/model/TestPropertyValidation.java
===================================================================
--- trunk/common-internal/src/test/java/com/metamatrix/common/config/model/TestPropertyValidation.java 2009-05-15 14:34:39 UTC (rev 945)
+++ trunk/common-internal/src/test/java/com/metamatrix/common/config/model/TestPropertyValidation.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -24,12 +24,8 @@
import junit.framework.TestCase;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
import com.metamatrix.common.config.api.exceptions.ConfigurationException;
-/**
- * Test {@link NonDelegatingClassLoader}
- */
public class TestPropertyValidation extends TestCase {
/**
Modified: trunk/engine/src/main/java/com/metamatrix/query/function/UDFSource.java
===================================================================
--- trunk/engine/src/main/java/com/metamatrix/query/function/UDFSource.java 2009-05-15 14:34:39 UTC (rev 945)
+++ trunk/engine/src/main/java/com/metamatrix/query/function/UDFSource.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -27,7 +27,7 @@
import java.net.URL;
import java.util.Collection;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
+import com.metamatrix.common.classloader.PostDelegatingClassLoader;
import com.metamatrix.common.protocol.MetaMatrixURLStreamHandlerFactory;
import com.metamatrix.query.function.metadata.FunctionMetadataReader;
import com.metamatrix.query.function.metadata.FunctionMethod;
@@ -72,7 +72,7 @@
// If the class loader is not created for the UDF functions then create
// one and cache it.
if (classLoader == null) {
- classLoader = new NonDelegatingClassLoader(this.classpath, Thread.currentThread().getContextClassLoader(), new MetaMatrixURLStreamHandlerFactory());
+ classLoader = new PostDelegatingClassLoader(this.classpath, Thread.currentThread().getContextClassLoader(), new MetaMatrixURLStreamHandlerFactory());
}
return classLoader.loadClass(className);
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-15 14:34:39 UTC (rev 945)
+++ trunk/server/src/main/java/com/metamatrix/server/connector/service/ConnectorService.java 2009-05-15 14:37:19 UTC (rev 946)
@@ -52,8 +52,7 @@
import com.metamatrix.common.application.ApplicationService;
import com.metamatrix.common.application.exception.ApplicationInitializationException;
import com.metamatrix.common.application.exception.ApplicationLifecycleException;
-import com.metamatrix.common.classloader.NonDelegatingClassLoader;
-import com.metamatrix.common.classloader.URLFilteringClassLoader;
+import com.metamatrix.common.classloader.PostDelegatingClassLoader;
import com.metamatrix.common.comm.ClientServiceRegistry;
import com.metamatrix.common.comm.api.ResultsReceiver;
import com.metamatrix.common.config.CurrentConfiguration;
@@ -114,7 +113,7 @@
* This is based on the assumption that two classloaders
* with the same URLs should be identical.
*/
- private static Map<String, WeakReference<NonDelegatingClassLoader>> classLoaderCache = new HashMap<String, WeakReference<NonDelegatingClassLoader>> ();
+ private static Map<String, WeakReference<PostDelegatingClassLoader>> classLoaderCache = new HashMap<String, WeakReference<PostDelegatingClassLoader>> ();
static {
//read value of cacheClassLoaders
@@ -204,9 +203,9 @@
}
synchronized (ConnectorService.class) {
- NonDelegatingClassLoader result = null;
+ PostDelegatingClassLoader result = null;
if (cacheClassLoaders) {
- WeakReference<NonDelegatingClassLoader> ref = classLoaderCache.get(urls);
+ WeakReference<PostDelegatingClassLoader> ref = classLoaderCache.get(urls);
if (ref != null) {
result = ref.get();
if (result != null) {
@@ -216,9 +215,9 @@
}
try {
- result = new URLFilteringClassLoader(URLFactory.parseURLs(urls, ";"), Thread.currentThread().getContextClassLoader()); //$NON-NLS-1$
+ result = new PostDelegatingClassLoader(URLFactory.parseURLs(urls, ";"), Thread.currentThread().getContextClassLoader()); //$NON-NLS-1$
if (cacheClassLoaders) {
- classLoaderCache.put(urls, new WeakReference<NonDelegatingClassLoader>(result));
+ classLoaderCache.put(urls, new WeakReference<PostDelegatingClassLoader>(result));
}
return result;
} catch (MalformedURLException e1) {
15 years, 7 months
teiid SVN: r945 - trunk/engine/src/main/java/org/teiid/dqp/internal/process.
by teiid-commits@lists.jboss.org
Author: shawkins
Date: 2009-05-15 10:34:39 -0400 (Fri, 15 May 2009)
New Revision: 945
Modified:
trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlanCache.java
Log:
TEIID-81 changing default based upon better memory usage
Modified: trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlanCache.java
===================================================================
--- trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlanCache.java 2009-05-15 13:21:47 UTC (rev 944)
+++ trunk/engine/src/main/java/org/teiid/dqp/internal/process/PreparedPlanCache.java 2009-05-15 14:34:39 UTC (rev 945)
@@ -36,10 +36,10 @@
import com.metamatrix.vdb.runtime.VDBKey;
/**
- * This class is used to cahce plan and related objects for prepared statement
+ * This class is used to cache plan and related objects for prepared statement
*/
public class PreparedPlanCache {
- public static final int DEFAULT_MAX_SIZE_TOTAL = 100;
+ public static final int DEFAULT_MAX_SIZE_TOTAL = 250;
private Map<CacheID, PreparedPlan> cache;
private int maxSize;
15 years, 7 months
teiid SVN: r944 - trunk/client/src/main/resources/com/metamatrix/admin.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-15 09:21:47 -0400 (Fri, 15 May 2009)
New Revision: 944
Modified:
trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties
Log:
Teiid-570 - changes to support exposing services - i18n changes
Modified: trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties
===================================================================
--- trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties 2009-05-15 13:20:50 UTC (rev 943)
+++ trunk/client/src/main/resources/com/metamatrix/admin/i18n.properties 2009-05-15 13:21:47 UTC (rev 944)
@@ -66,7 +66,29 @@
MMConnectorBinding.Properties=\n Properties:\
+MMService.unknown=Unknown
+MMService.open=Open
+MMService.closed=Closed
+MMService.failed=Failed
+MMService.initializationFailed=Initialization Failed
+MMService.notInitialized=Not Initialized
+MMService.notRegistered=Not Registered
+MMService.dataSourceUnavailable=DataSourceUnavailable
+MMService.MMService=MMService: \n Identifier:\
+MMService.Description=\n Description:\
+MMService.Created=\n Created:\
+MMService.Created_By=\n Created By:\
+MMService.Updated=\n Updated:\
+MMService.Updated_By=\n Updated By:\
+MMService.State=\n State:\
+MMService.State_Changed=\n State Changed:\
+MMService.IsDeployed=\n Is Deployed:\
+MMService.IsRegistered=\n Is Running:\
+MMService.Properties=\n Properties:\
+
+
+
MMConnectorType.MMConnectorType=MMConnectorType: \n Identifier:\
MMConnectorType.Created=\n Created:\
MMConnectorType.Created_By=\n Created By:\
15 years, 7 months
teiid SVN: r943 - trunk/client/src/main/java/com/metamatrix/admin/objects.
by teiid-commits@lists.jboss.org
Author: vhalbert(a)redhat.com
Date: 2009-05-15 09:20:50 -0400 (Fri, 15 May 2009)
New Revision: 943
Modified:
trunk/client/src/main/java/com/metamatrix/admin/objects/MMAdminObject.java
Log:
Teiid-570 - changes to support exposing services
Modified: trunk/client/src/main/java/com/metamatrix/admin/objects/MMAdminObject.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/admin/objects/MMAdminObject.java 2009-05-15 02:55:01 UTC (rev 942)
+++ trunk/client/src/main/java/com/metamatrix/admin/objects/MMAdminObject.java 2009-05-15 13:20:50 UTC (rev 943)
@@ -50,7 +50,9 @@
/**Object type code for Cache*/
- public static final int OBJECT_TYPE_CACHE = 0;
+ public static final int OBJECT_TYPE_CACHE = 0;
+ /** Object Type code for Service */
+ public static final int OBJECT_TYPE_SERVICE = 1;
/**Object type code for ConnectorBinding*/
public static final int OBJECT_TYPE_CONNECTOR_BINDING = 2;
/**Object type code for ConnectorType*/
@@ -99,7 +101,8 @@
static {
- objectTypeMap.put(com.metamatrix.admin.api.objects.Cache.class.getName(), new Integer(OBJECT_TYPE_CACHE));
+ objectTypeMap.put(com.metamatrix.admin.api.objects.Cache.class.getName(), new Integer(OBJECT_TYPE_CACHE));
+ objectTypeMap.put(com.metamatrix.admin.api.objects.Service.class.getName(), new Integer(OBJECT_TYPE_SERVICE));
objectTypeMap.put(com.metamatrix.admin.api.objects.ConnectorBinding.class.getName(), new Integer(OBJECT_TYPE_CONNECTOR_BINDING));
objectTypeMap.put(com.metamatrix.admin.api.objects.ConnectorType.class.getName(), new Integer(OBJECT_TYPE_CONNECTOR_TYPE));
objectTypeMap.put(com.metamatrix.admin.api.objects.DQP.class.getName(), new Integer(OBJECT_TYPE_DQP));
15 years, 7 months