[jbosstools-commits] JBoss Tools SVN: r22904 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: server/xpl and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Jun 21 02:27:49 EDT 2010


Author: rob.stryker at jboss.com
Date: 2010-06-21 02:27:48 -0400 (Mon, 21 Jun 2010)
New Revision: 22904

Modified:
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
   trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
Log:
JBDS-1103 trunk

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java	2010-06-20 22:50:38 UTC (rev 22903)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java	2010-06-21 06:27:48 UTC (rev 22904)
@@ -123,16 +123,9 @@
 		else
 			list.addAll(Arrays.asList(packModuleIntoJar(moduleTree[moduleTree.length-1], deployPath)));
 		
-		// adjust timestamps
-		FileFilter filter = new FileFilter() {
-			public boolean accept(File pathname) {
-				if( pathname.getAbsolutePath().toLowerCase().endsWith(IConstants.EXT_XML))
-					return true;
-				return false;
-			}
-		};
-		FileUtil.touch(filter, deployPath.toFile(), true);
 
+		touchXMLFiles(deployPath);
+
 		if( list.size() > 0 ) {
 			MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_FAIL, 
 					NLS.bind(Messages.FullPublishFail, module.getName()), null);
@@ -141,20 +134,31 @@
 			return ms;
 		}
 
-		
 		publishState = IServer.PUBLISH_STATE_NONE;
-		
 		IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_SUCCESS, 
 				NLS.bind(Messages.CountModifiedMembers, countMembers(module), module.getName()), null);
 		return ret;
 	}
+	
+	private void touchXMLFiles(IPath deployPath) {
+		// adjust timestamps
+		FileFilter filter = new FileFilter() {
+			public boolean accept(File pathname) {
+				if( pathname.getAbsolutePath().toLowerCase().endsWith(IConstants.EXT_XML))
+					return true;
+				return false;
+			}
+		};
+		FileUtil.touch(filter, deployPath.toFile(), true);
+	}
 
 	protected IStatus incrementalPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
 		IStatus[] results = new IStatus[] {};
 		IPath deployPath = getDeployPath(moduleTree, server);
 		IPath tempDeployPath = getTempDeployFolder(moduleTree, server);
+		LocalCopyCallback handler = null;
 		if( !deployPackaged(moduleTree) && !isBinaryObject(moduleTree)) {
-			LocalCopyCallback handler = new LocalCopyCallback(server.getServer(), deployPath, tempDeployPath);
+			handler = new LocalCopyCallback(server.getServer(), deployPath, tempDeployPath);
 			results = new PublishCopyUtil(handler).publishDelta(delta, monitor);
 		} else if( delta.length > 0 ) {
 			if( isBinaryObject(moduleTree))
@@ -169,6 +173,10 @@
 				ms.add(results[i]);
 			return ms;
 		}
+		
+		if( handler != null && handler.shouldRestartModule() )
+			touchXMLFiles(deployPath);
+
 		IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_SUCCESS, 
 				NLS.bind(Messages.CountModifiedMembers, countChanges(delta), module.getName()), null);
 		return ret;

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java	2010-06-20 22:50:38 UTC (rev 22903)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/xpl/PublishCopyUtil.java	2010-06-21 06:27:48 UTC (rev 22904)
@@ -100,6 +100,8 @@
 		private static final File tempDir = ServerPlugin.getInstance().getStateLocation().toFile();
 		private static final String TEMPFILE_PREFIX = "tmp"; //$NON-NLS-1$
 
+		private boolean shouldRestartModule = false;
+		
 		private IServer server;
 		private IPath deployRootFolder;
 		private IPath tmpDeployRootFolder;
@@ -109,8 +111,18 @@
 			this.tmpDeployRootFolder = temporaryFolder;
 		}
 		
+		public boolean shouldRestartModule() {
+			return shouldRestartModule;
+		}
+		
+		private void checkRestartModule(File file) {
+			if( file.getName().toLowerCase().endsWith(".jar")) //$NON-NLS-1$
+				shouldRestartModule = true;
+		}
+		
 		public IStatus[] copyFile(IModuleFile mf, IPath relativePath, IProgressMonitor monitor) throws CoreException {
 			File file = PublishUtil.getFile(mf);
+			checkRestartModule(file);
 			if( file != null ) {
 				InputStream in = null;
 				try {



More information about the jbosstools-commits mailing list