[jboss-svn-commits] JBoss Common SVN: r4276 - shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/exporter.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Apr 20 11:54:37 EDT 2010
Author: ALRubinger
Date: 2010-04-20 11:54:35 -0400 (Tue, 20 Apr 2010)
New Revision: 4276
Modified:
shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/exporter/JdkZipExporterDelegate.java
Log:
[SHRINKWRAP-153] Create and shut down the ES per export task
Modified: shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/exporter/JdkZipExporterDelegate.java
===================================================================
--- shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/exporter/JdkZipExporterDelegate.java 2010-04-20 15:41:22 UTC (rev 4275)
+++ shrinkwrap/trunk/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/exporter/JdkZipExporterDelegate.java 2010-04-20 15:54:35 UTC (rev 4276)
@@ -25,6 +25,7 @@
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -41,7 +42,6 @@
import org.jboss.shrinkwrap.impl.base.io.StreamErrorHandler;
import org.jboss.shrinkwrap.impl.base.io.StreamTask;
import org.jboss.shrinkwrap.impl.base.path.PathUtil;
-import org.jboss.shrinkwrap.spi.Configurable;
/**
* JDK-based implementation of a ZIP exporter. Cannot handle archives
@@ -175,9 +175,12 @@
};
// Get a handle and return it to the caller
- final ExecutorService service = this.getArchive().as(Configurable.class).getConfiguration().getExecutorService();
+ final ExecutorService service = Executors.newSingleThreadExecutor();
final Future<Void> job = service.submit(exportTask);
+ // Tell the service to shut down after the job has completed, and accept no new jobs
+ service.shutdown();
+
/*
* At this point the job will start, but hit the latch until we set up the streams
* and tell it to proceed.
More information about the jboss-svn-commits
mailing list