You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2014/08/28 16:28:20 UTC
svn commit: r1621141 - in /tomee/tomee/trunk/container/openejb-core/src:
main/java/org/apache/openejb/assembler/Deployer.java
main/java/org/apache/openejb/assembler/DeployerEjb.java
test/java/org/apache/openejb/assembler/DeployerEjbTest.java
Author: andygumbrecht
Date: Thu Aug 28 14:28:20 2014
New Revision: 1621141
URL: http://svn.apache.org/r1621141
Log:
TOMEE-1338 - Initial work on test for WAR save. In progress.
Added:
tomee/tomee/trunk/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java
- copied unchanged from r1621140, tomee/tomee/branches/tomee-1.7.x/container/openejb-core/src/test/java/org/apache/openejb/assembler/DeployerEjbTest.java
Modified:
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/Deployer.java
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/Deployer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/Deployer.java?rev=1621141&r1=1621140&r2=1621141&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/Deployer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/Deployer.java Thu Aug 28 14:28:20 2014
@@ -25,12 +25,18 @@ import org.apache.openejb.assembler.clas
import java.util.Collection;
import java.util.Properties;
-// The signature of this intf must never change without caution
+// The signature of this interface must never change without caution
// it is used in many tools either internal or external (intellij idea)
public interface Deployer {
String FILENAME = "filename";
String ALT_DD = "altDD";
+ /**
+ * Returns a unique file per runtime. Clients can test for the existence of this file
+ * to determine if the deployer is on the local machine.
+ *
+ * @return String - The canonical pathname
+ */
String getUniqueFile();
Collection<AppInfo> getDeployedApps();
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java?rev=1621141&r1=1621140&r2=1621141&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/assembler/DeployerEjb.java Thu Aug 28 14:28:20 2014
@@ -106,7 +106,7 @@ public class DeployerEjb implements Depl
throw new OpenEJBRuntimeException(e);
}
} else {
- throw new OpenEJBRuntimeException("can't create unique file, please set java.io.tmpdir to a writable folder or create work folder", e);
+ throw new OpenEJBRuntimeException("cannot create unique file, please set java.io.tmpdir to a writable folder or create work folder", e);
}
}
uniqueFile = unique;
@@ -272,14 +272,14 @@ public class DeployerEjb implements Depl
}
}
- private void saveIfNeeded(Properties properties, File file, AppInfo appInfo) {
+ private void saveIfNeeded(final Properties properties, final File file, final AppInfo appInfo) {
if (SAVE_DEPLOYMENTS || "true".equalsIgnoreCase(properties.getProperty(OPENEJB_DEPLOYER_SAVE_DEPLOYMENTS, "false"))) {
appInfo.properties.setProperty("save-deployment","true");
saveDeployment(file, true);
}
}
- private static File copyBinaries(final Properties props) throws OpenEJBException {
+ private synchronized File copyBinaries(final Properties props) throws OpenEJBException {
final File dump = ProvisioningResolver.cacheFile(props.getProperty(OPENEJB_PATH_BINARIES, "dump.war"));
if (dump.exists()) {
Files.delete(dump);
@@ -314,7 +314,7 @@ public class DeployerEjb implements Depl
config = null;
}
if (config == null || !config.getParentFile().exists()) {
- LOGGER.info("can't save the added app because the conf folder doesn't exist, it will not be present next time you'll start");
+ LOGGER.info("Cannot save the added app because the conf folder does not exist, it will not be present on a restart");
return;
}
@@ -359,7 +359,7 @@ public class DeployerEjb implements Depl
os = IO.write(config);
JaxbOpenejb.marshal(AdditionalDeployments.class, additionalDeployments, os);
} catch (final Exception e) {
- LOGGER.error("can't save the added app, will not be present next time you'll start", e);
+ LOGGER.error("cannot save the added app, will not be present next time you'll start", e);
} finally {
IO.close(os);
}