[jboss-cvs] JBossAS SVN: r94270 - in projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal: impl and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 2 09:16:16 EDT 2009
Author: jesper.pedersen
Date: 2009-10-02 09:16:16 -0400 (Fri, 02 Oct 2009)
New Revision: 94270
Modified:
projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Unmarshaller.java
projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java
Log:
Make precondition checks on file handle
Modified: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Unmarshaller.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Unmarshaller.java 2009-10-02 12:54:45 UTC (rev 94269)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Unmarshaller.java 2009-10-02 13:16:16 UTC (rev 94270)
@@ -26,6 +26,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URISyntaxException;
import java.net.URL;
import javax.xml.stream.XMLInputFactory;
@@ -56,12 +57,27 @@
if (url == null)
throw new IllegalArgumentException("File is null");
+ File file = null;
+ try
+ {
+ file = new File(url.toURI());
+ }
+ catch (URISyntaxException use)
+ {
+ throw new IOException("File cant be constructed: " + file, use);
+ }
+
+ if (!file.exists())
+ throw new IOException("File doesn't exists: " + file);
+
+ if (file.isDirectory())
+ throw new IOException("File is a directory: " + file);
+
InputStream is = null;
try
{
Deployment deployment = new Deployment();
- File file = new File(url.toURI());
is = new FileInputStream(file);
XMLInputFactory xmlInputFactory = null;
Modified: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java 2009-10-02 12:54:45 UTC (rev 94269)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java 2009-10-02 13:16:16 UTC (rev 94270)
@@ -41,6 +41,7 @@
import java.util.List;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Future;
/**
* The deployment deployer (deploys .xml files)
@@ -100,7 +101,7 @@
for (BeanType bt : deployment.getBean())
{
Runnable r = new ServiceRunnable(bt, beans, kernel, beansLatch, parent);
- kernel.getExecutorService().execute(r);
+ Future<?> result = kernel.getExecutorService().submit(r);
}
beansLatch.await();
More information about the jboss-cvs-commits
mailing list