[teiid-commits] teiid SVN: r1611 - in trunk: client/src/main/java/com/metamatrix/common/comm/platform/socket/client and 3 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Tue Dec 1 13:51:26 EST 2009


Author: shawkins
Date: 2009-12-01 13:51:26 -0500 (Tue, 01 Dec 2009)
New Revision: 1611

Modified:
   trunk/client/src/main/java/com/metamatrix/client/ExceptionUtil.java
   trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java
   trunk/client/src/main/java/com/metamatrix/platform/security/api/ILogon.java
   trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties
   trunk/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
Log:
TEIID-876 initial fix for error seen from a socket client

Modified: trunk/client/src/main/java/com/metamatrix/client/ExceptionUtil.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/client/ExceptionUtil.java	2009-12-01 17:58:08 UTC (rev 1610)
+++ trunk/client/src/main/java/com/metamatrix/client/ExceptionUtil.java	2009-12-01 18:51:26 UTC (rev 1611)
@@ -35,7 +35,8 @@
 
 public class ExceptionUtil {
 	
-    public static <T extends Throwable> T getExceptionOfType(Throwable ex, Class<T> cls) {
+    @SuppressWarnings("unchecked")
+	public static <T extends Throwable> T getExceptionOfType(Throwable ex, Class<T> cls) {
         while (ex != null) {
             if (cls.isAssignableFrom(ex.getClass())) {
                 return (T)ex;
@@ -50,21 +51,25 @@
 	
 	public static Throwable convertException(Method method, Throwable exception) {
 		boolean canThrowXATransactionException = false;
+		boolean canThrowComponentException = false;
+		boolean canThrowAdminException = false;
         Class<?>[] exceptionClasses = method.getExceptionTypes();
         for (int i = 0; i < exceptionClasses.length; i++) {
 			if (exception.getClass().isAssignableFrom(exceptionClasses[i])) {
 				return exception;
 			}
-			if (MetaMatrixComponentException.class.isAssignableFrom(exceptionClasses[i])) {
-				return new MetaMatrixComponentException(exception);	
+			canThrowComponentException |= MetaMatrixComponentException.class.isAssignableFrom(exceptionClasses[i]);
+			canThrowAdminException |= AdminException.class.isAssignableFrom(exceptionClasses[i]);
+			canThrowXATransactionException |= XATransactionException.class.isAssignableFrom(exceptionClasses[i]);
+        }
+        if (canThrowComponentException) {
+        	return new MetaMatrixComponentException(exception);
+        }
+        if (canThrowAdminException) {
+			if (exception instanceof MetaMatrixProcessingException) {
+				return new AdminProcessingException(exception);
 			}
-			if (AdminException.class.isAssignableFrom(exceptionClasses[i])) {
-				if (exception instanceof MetaMatrixProcessingException) {
-					return new AdminProcessingException(exception);
-				}
-	        	return new AdminComponentException(exception);
-			}
-			canThrowXATransactionException |= XATransactionException.class.isAssignableFrom(exceptionClasses[i]);
+        	return new AdminComponentException(exception);
 		}
         if (canThrowXATransactionException) {
         	return new XATransactionException(exception);

Modified: trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java	2009-12-01 17:58:08 UTC (rev 1610)
+++ trunk/client/src/main/java/com/metamatrix/common/comm/platform/socket/client/SocketServerConnection.java	2009-12-01 18:51:26 UTC (rev 1611)
@@ -265,6 +265,8 @@
 				//ignore
 			} catch (TimeoutException e) {
 				//ignore
+			} catch (MetaMatrixComponentException e) {
+				//ignore
 			}
 		}
 		

Modified: trunk/client/src/main/java/com/metamatrix/platform/security/api/ILogon.java
===================================================================
--- trunk/client/src/main/java/com/metamatrix/platform/security/api/ILogon.java	2009-12-01 17:58:08 UTC (rev 1610)
+++ trunk/client/src/main/java/com/metamatrix/platform/security/api/ILogon.java	2009-12-01 18:51:26 UTC (rev 1611)
@@ -50,7 +50,7 @@
     * @throws InvalidSessionException If session has expired or doesn't exist
     * @throws ComponentNotFoundException If couldn't find needed service component
     */
-   ResultsFuture<?> logoff() throws InvalidSessionException;
+   ResultsFuture<?> logoff() throws InvalidSessionException, MetaMatrixComponentException;
    
    void assertIdentity(SessionToken sessionId) throws InvalidSessionException, MetaMatrixComponentException;
 

Modified: trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties
===================================================================
--- trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties	2009-12-01 17:58:08 UTC (rev 1610)
+++ trunk/engine/src/main/resources/com/metamatrix/dqp/i18n.properties	2009-12-01 18:51:26 UTC (rev 1611)
@@ -74,8 +74,8 @@
 ConnectorWorker.MaxResultRowsExceed=The number of result rows has exceeded the maximum result rows "{0}"
 ConnectorWorker.invalidAtomicType=Invalid atomic request message type: {0}.
 ConnectorWorker.zero_size_non_last_batch=Connector returned a 0 row non-last batch: {0}.
-ConnectorWorker.requestID_does_not_exist=RequestID {0} does not exist or has been cancelled. The request will not be processed.
-ConnectorWorker.could_not_retrieve_execution=Could not retrieve the execution for atomic requestID {0}. The request may have been cancelled.
+ConnectorWorker.requestID_does_not_exist=RequestID {0} does not exist or has been canceled. The request will not be processed.
+ConnectorWorker.could_not_retrieve_execution=Could not retrieve the execution for atomic requestID {0}. The request may have been canceled.
 ConnectorWorker.process_failed=Connector worker process failed for atomic-request={0}
 ConnectorWorker.ConnectorWorker_result_set_unexpected_columns=Could not process stored procedure results for {0}.  Expected {1} result set columns, but was {2}.  Please update your models to allow for stored procedure results batching.
 ConnectorWorker.error_occurred=Error occurred on connector {0} - {1}
@@ -298,8 +298,8 @@
 ERR.018.005.0037 = The type of the value does not match that of parameter {0}
 ERR.018.005.0038 = Error executing conversion function to convert value.
 ERR.018.005.0039 = Problem getting cursor batch for {0}
-ERR.018.005.0040 = The request {0} has been cancelled by the administrator.
-ERR.018.005.0041 = The request {0} has been cancelled.
+ERR.018.005.0040 = The request {0} has been canceled by the administrator.
+ERR.018.005.0041 = The request {0} has been canceled.
 ERR.018.005.0042 = Failed to deliver cancellation error response for {0} as it does not have a response receiver.
 ERR.018.005.0043 = Error loading configuration while trying to load metadata for system queries.
 ERR.018.005.0044 = Error trying to access metadata for loading metadata for elements/keys of the group :{0}

Modified: trunk/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java
===================================================================
--- trunk/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java	2009-12-01 17:58:08 UTC (rev 1610)
+++ trunk/runtime/src/main/java/org/teiid/transport/LocalServerConnection.java	2009-12-01 18:51:26 UTC (rev 1611)
@@ -146,6 +146,8 @@
 				//ignore
 			} catch (TimeoutException e) {
 				//ignore
+			} catch (MetaMatrixComponentException e) {
+				//ignore
 			}
 		}
 		this.shutdown = true;



More information about the teiid-commits mailing list