Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 91658 Details for
Bug 162605
Test execution should support parallel execution of tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch for hyades.execution
hyades.execution.patch.txt (text/plain), 11.10 KB, created by
DuWayne Morris
on 2008-03-05 11:12:49 EST
(
hide
)
Description:
patch for hyades.execution
Filename:
MIME Type:
Creator:
DuWayne Morris
Created:
2008-03-05 11:12:49 EST
Size:
11.10 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.execution >Index: src-local/org/eclipse/hyades/execution/local/ExecutionComponentFactoryImpl.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.execution/src-local/org/eclipse/hyades/execution/local/ExecutionComponentFactoryImpl.java,v >retrieving revision 1.6 >diff -u -r1.6 ExecutionComponentFactoryImpl.java >--- src-local/org/eclipse/hyades/execution/local/ExecutionComponentFactoryImpl.java 30 Oct 2006 18:25:54 -0000 1.6 >+++ src-local/org/eclipse/hyades/execution/local/ExecutionComponentFactoryImpl.java 5 Mar 2008 15:39:49 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2006 IBM Corporation and others. >+ * Copyright (c) 2006, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -298,21 +298,15 @@ > // Wait for notification that the remote call has returned, unmarshal > // the return data, return the result of the remote call. > ReturnData returnData = null; >- while (true) { >- // bugzilla_143346 >- // We need to distinguish between return data being received and the >- // waitForReturnData call timing out >- try { >- Marshaller.waitForReturnDataWithTimeout(); >- } catch (InterruptedException e) { >- // Timed out waiting for response from remote call. >- throw new RemoteInvocationException(e); >- } >- ReturnData tmp = Marshaller.peekReturnValue(); >- if ( callData.isForSameCallAs(tmp) ) { >- returnData = Marshaller.unqueueReturnValue(); >- break; >- } >+ >+ try { >+ // bugzilla 162605, added new method for proper >+ // synchronization and delivery of ReturnData >+ returnData = Marshaller.waitForReturnDataWithTimeout(callData); >+ >+ } catch (InterruptedException e) { >+ // Timed out waiting for response from remote call. >+ throw new RemoteInvocationException(e); > } > > return returnData; >Index: src-local/org/eclipse/hyades/execution/local/RemoteObjectStub.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.execution/src-local/org/eclipse/hyades/execution/local/RemoteObjectStub.java,v >retrieving revision 1.4 >diff -u -r1.4 RemoteObjectStub.java >--- src-local/org/eclipse/hyades/execution/local/RemoteObjectStub.java 30 Oct 2006 18:25:51 -0000 1.4 >+++ src-local/org/eclipse/hyades/execution/local/RemoteObjectStub.java 5 Mar 2008 15:39:49 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >-Copyright (c) 2006 IBM Corporation and others. >+Copyright (c) 2006, 2008 IBM Corporation and others. > All rights reserved. This program and the accompanying materials > are made available under the terms of the Eclipse Public License v1.0 > which accompanies this distribution, and is available at >@@ -90,26 +90,23 @@ > catch(ClassCastException e) { > throw new RemoteInvocationException("Class is not a child of a ISession instance"); > } >- >+ > // Wait for notification that the remote call has returned, unmarshal > // the return data, return the result of the remote call. > ReturnData returnData = null; >- while (true) { >- // bugzilla_143346 >- // We need to distinguish between return data being received and the >- // waitForReturnData call timing out >- try { >- Marshaller.waitForReturnDataWithTimeout(); >- } catch (InterruptedException e) { >- // Timed out waiting for response from remote call. >- throw new RemoteInvocationException(e); >- } >- ReturnData tmp = Marshaller.peekReturnValue(); >- if ( callData.isForSameCallAs(tmp) ) { >- returnData = Marshaller.unqueueReturnValue(); >- break; >- } >+ >+ >+ try { >+ // bugzilla 162605, added new method for proper >+ // synchronization and delivery of ReturnData >+ returnData = Marshaller.waitForReturnDataWithTimeout(callData); >+ >+ } catch (InterruptedException e) { >+ // Timed out waiting for response from remote call. >+ throw new RemoteInvocationException(e); > } >+ >+ > > return returnData; > } >Index: src-core/org/eclipse/hyades/execution/invocation/Marshaller.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.execution/src-core/org/eclipse/hyades/execution/invocation/Marshaller.java,v >retrieving revision 1.11 >diff -u -r1.11 Marshaller.java >--- src-core/org/eclipse/hyades/execution/invocation/Marshaller.java 8 May 2007 14:44:35 -0000 1.11 >+++ src-core/org/eclipse/hyades/execution/invocation/Marshaller.java 5 Mar 2008 15:39:49 -0000 >@@ -1,5 +1,5 @@ > /********************************************************************** >- * Copyright (c) 2005, 2007 IBM Corporation and others. >+ * Copyright (c) 2005, 2008 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -54,6 +54,23 @@ > * invocations. > */ > private static ArrayList returnValueQueue = new ArrayList(); >+ >+ /** >+ * this list is used to keep a list of threads waiting for >+ * return data. This way, we can wake up the proper thread >+ * when the RMI return data becomes available >+ * >+ */ >+ private static ArrayList callDataQueue = new ArrayList(); >+ >+ >+ /* >+ * The following is used to preserve proper operation if the deprecated >+ * return data methods are called. The boolean will stay false >+ */ >+ private static boolean depracatedReturnMethodUsed = false; >+ >+ > > // There should be no instances of this class. > private Marshaller() throws IOException { >@@ -218,6 +235,10 @@ > * @return > */ > public static byte[] marshalMethodCall(CallData callData) throws IOException { >+ >+ synchronized (callDataQueue){ >+ callDataQueue.add(callData); >+ } > > // Use a custom output stream that provides pass-by-ref for remote > // objects. >@@ -372,17 +393,44 @@ > return new ReturnData(new Integer(targetId), argTypes, call, rtnVal); > } > >+ >+ > /** > * Add the result of a method invocation to the return data queue. > * > * @param value > */ >- public static void queueReturnValue(ReturnData value) { >+ >+ public static void queueReturnValue(ReturnData returnData) { > synchronized (returnValueQueue) { >- returnValueQueue.add(value); >- returnValueQueue.notifyAll(); >+ returnValueQueue.add(returnData); >+ if (depracatedReturnMethodUsed){ >+ returnValueQueue.notifyAll(); >+ } >+ synchronized (callDataQueue){ >+ int i, size = callDataQueue.size(); >+ >+ for (i = 0; i < size; i++){ >+ CallData callData = (CallData)callDataQueue.get(i); >+ if (callData.isForSameCallAs((ReturnData) returnData)){ >+ // notify all threads (should only be one) >+ // that are waiting for the return data. >+ // callers are synchronized on the CallData object >+ synchronized (callData){ >+ callData.notifyAll(); >+ } >+ callDataQueue.remove(i); >+ break; >+ } >+ } >+ >+ } >+ > } > } >+ >+ >+ > > /** > * Pull the result of a method invocation off of the return data queue. >@@ -432,10 +480,11 @@ > * Wait until there is data in the return queue. This method blocks the > * calling thread until return data is present in the queue or the timeout > * occurs. >- * @deprecated use waitForReturnDataWithTimeout so you can distinguish >+ * @deprecated use waitForReturnDataWithTimeout(CallData) so you can distinguish > * between return data received and timeout exceeded condition > */ > public static void waitForReturnData() { >+ depracatedReturnMethodUsed = true; > while (!isReturnDataAvailable()) { > try { > synchronized (returnValueQueue) { >@@ -453,9 +502,11 @@ > * (to allow callers to distinguish between return data received and > * timeout exceeded.) > * @throws InterruptedException if the return data timeout is exceeded >- * @provisional >+ * @deprecated use waitForReturnDataWithTimeout(CallData) >+ * > */ > public static void waitForReturnDataWithTimeout() throws InterruptedException { >+ depracatedReturnMethodUsed = true; > if (!isReturnDataAvailable()) { > synchronized (returnValueQueue) { > returnValueQueue.wait(Marshaller.WAIT_FOR_RETURN_DATA_TIMEOUT); >@@ -465,5 +516,58 @@ > } > } > >+ /** >+ * Wait until there is data in the return queue. This method blocks the >+ * calling thread until return data is present in the queue or the timeout >+ * occurs. If the timeout occurs, an InterruptedException is thrown >+ * (to allow callers to distinguish between return data received and >+ * timeout exceeded.) >+ * >+ * The difference is that this method does NOT return until the data for >+ * the passed in CallData is actually found in the returnQueuue. The deprecated >+ * version of this method would return even though no data was found for the caller. >+ * >+ * @throws InterruptedException if the return data timeout is exceeded >+ * @provisional >+ */ >+ public static ReturnData waitForReturnDataWithTimeout(CallData callData) throws InterruptedException { >+ ReturnData returnData = getReturnData(callData); >+ if (returnData == null){ >+ >+ synchronized (callData){ >+ callData.wait(Marshaller.WAIT_FOR_RETURN_DATA_TIMEOUT); >+ } >+ returnData = getReturnData(callData); >+ // if we did not get notified, that means we reached the timeout >+ // therefore, if returnData is null, throw an exception >+ if (returnData == null) >+ throw new InterruptedException("Remote Method Invocation Timeout Error"); >+ // filed bugzilla 221150 to externalize the above error string and >+ // other hard-coded strings in hyades.execution >+ >+ >+ } >+ return returnData; >+ } >+ >+ private static ReturnData getReturnData(CallData callData){ >+ ReturnData returnData = null; >+ synchronized (returnValueQueue){ >+ if (isReturnDataAvailable()){ >+ int i, size = returnValueQueue.size(); >+ >+ for (i = 0; i < size; i++){ >+ if (callData.isForSameCallAs((ReturnData) returnValueQueue.get(i))){ >+ break; >+ } >+ } >+ >+ if (i < size) >+ returnData = (ReturnData)returnValueQueue.remove(i); >+ } >+ } >+ return returnData; >+ >+ } > > } >\ No newline at end of file >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.execution/META-INF/MANIFEST.MF,v >retrieving revision 1.15 >diff -u -r1.15 MANIFEST.MF >--- META-INF/MANIFEST.MF 24 Jul 2007 20:56:31 -0000 1.15 >+++ META-INF/MANIFEST.MF 5 Mar 2008 15:39:49 -0000 >@@ -2,7 +2,7 @@ > Bundle-ManifestVersion: 2 > Bundle-Name: %PLUGIN_NAME > Bundle-SymbolicName: org.eclipse.hyades.execution; singleton:=true >-Bundle-Version: 4.4.100.qualifier >+Bundle-Version: 4.4.200.qualifier > Bundle-ClassPath: hexl.jar, > hexr.jar, > tptp-automation-client.jar,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 162605
: 91658 |
91659