sera 14/08/03 09:27:58 Modified: aspectwerkz-2.0-gentoo.patch Added: aspectwerkz-2.0-modernise_api.patch Log: Don't bundle qdox Relies on com.sun classes for JDWP support, drop ppc ppc64 amd64-fbsd keywords Use final java.util.concurrent API so it can be built against >=1.5 without additional dependencies by Andrew John Hughes <gnu_and...@member.fsf.org> EAPI bump and modernize ebuild (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key 3C5CF75A)
Revision Changes Path 1.4 dev-java/aspectwerkz/files/aspectwerkz-2.0-gentoo.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/aspectwerkz/files/aspectwerkz-2.0-gentoo.patch?rev=1.4&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/aspectwerkz/files/aspectwerkz-2.0-gentoo.patch?rev=1.4&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/aspectwerkz/files/aspectwerkz-2.0-gentoo.patch?r1=1.3&r2=1.4 Index: aspectwerkz-2.0-gentoo.patch =================================================================== RCS file: /var/cvsroot/gentoo-x86/dev-java/aspectwerkz/files/aspectwerkz-2.0-gentoo.patch,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- aspectwerkz-2.0-gentoo.patch 20 May 2009 16:03:46 -0000 1.3 +++ aspectwerkz-2.0-gentoo.patch 3 Aug 2014 09:27:58 -0000 1.4 @@ -97,7 +97,7 @@ <include name="*.jar"/> <!-- add qdox manually to remove its META-INF/LICENSE.txt that is not the one of AW --> - <zipfileset src="${lib.dir}/qdox-1.4.jar" excludes="META-INF/*"/> -+ <zipfileset src="${lib.dir}/qdox.jar" excludes="META-INF/*"/> ++ <!-- <zipfileset src="${lib.dir}/qdox.jar" excludes="META-INF/*"/> --> </jar> <!-- nodeps --> - <jar destfile="${build.dir}/aspectwerkz-nodeps-jdk14-${version}.jar"> 1.1 dev-java/aspectwerkz/files/aspectwerkz-2.0-modernise_api.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/aspectwerkz/files/aspectwerkz-2.0-modernise_api.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-java/aspectwerkz/files/aspectwerkz-2.0-modernise_api.patch?rev=1.1&content-type=text/plain Index: aspectwerkz-2.0-modernise_api.patch =================================================================== --- src/main/org/codehaus/aspectwerkz/connectivity/RemoteProxyServer.java.old 2013-09-30 02:03:20.703138370 +0100 +++ src/main/org/codehaus/aspectwerkz/connectivity/RemoteProxyServer.java 2013-09-30 05:49:54.768369910 +0100 @@ -7,9 +7,13 @@ **************************************************************************************/ package org.codehaus.aspectwerkz.connectivity; -import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer; -import EDU.oswego.cs.dl.util.concurrent.LinkedQueue; -import EDU.oswego.cs.dl.util.concurrent.PooledExecutor; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.RejectedExecutionHandler; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + import org.codehaus.aspectwerkz.exception.WrappedRuntimeException; import java.io.FileInputStream; @@ -152,7 +156,7 @@ /** * The thread pool. */ - private PooledExecutor m_threadPool = null; + private ThreadPoolExecutor m_threadPool = null; /** * The class loader to use. @@ -262,13 +266,30 @@ final int threadPoolInitSize, final int keepAliveTime, final boolean waitWhenBlocked) { - m_threadPool = new PooledExecutor(new BoundedBuffer(threadPoolInitSize), threadPoolMaxSize); - m_threadPool.setKeepAliveTime(keepAliveTime); - m_threadPool.createThreads(threadPoolInitSize); - m_threadPool.setMinimumPoolSize(threadPoolMinSize); + m_threadPool = new ThreadPoolExecutor(threadPoolInitSize, threadPoolMaxSize, + keepAliveTime, TimeUnit.MILLISECONDS, + new ArrayBlockingQueue(threadPoolInitSize) { + protected void afterExecute(Runnable r, ThreadPoolExecutor e) { + if (waitWhenBlocked) e.notifyAll(); + } + }); + m_threadPool.prestartAllCoreThreads(); + m_threadPool.setCorePoolSize(threadPoolMinSize); if (waitWhenBlocked) { - m_threadPool.waitWhenBlocked(); - } + m_threadPool.setRejectedExecutionHandler(new RejectedExecutionHandler() { + public void rejectedExecution(Runnable r, ThreadPoolExecutor e) { + if (e.isTerminating() || e.isTerminated()) + return; + BlockingQueue<Runnable> tasks = e.getQueue(); + int maxSize = e.getMaximumPoolSize(); + while (tasks.remainingCapacity() == 0 || e.getPoolSize() == maxSize) + try { e.wait(); } catch (InterruptedException ex) {} + e.execute(r); + } + }); + } else { + m_threadPool.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); + } } /** @@ -281,9 +302,10 @@ private void createDynamicThreadPool(final int threadPoolMinSize, final int threadPoolInitSize, final int keepAliveTime) { - m_threadPool = new PooledExecutor(new LinkedQueue()); - m_threadPool.setKeepAliveTime(keepAliveTime); - m_threadPool.createThreads(threadPoolInitSize); - m_threadPool.setMinimumPoolSize(threadPoolMinSize); + m_threadPool = new ThreadPoolExecutor(threadPoolInitSize, Integer.MAX_VALUE, + keepAliveTime, TimeUnit.MILLISECONDS, + new LinkedBlockingQueue()); + m_threadPool.prestartAllCoreThreads(); + m_threadPool.setCorePoolSize(threadPoolMinSize); } -} \ No newline at end of file +}