Author: rob.stryker(a)jboss.com
Date: 2012-03-14 13:22:53 -0400 (Wed, 14 Mar 2012)
New Revision: 39513
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
Log:
JBIDE-11308 - adding some logging to help debug
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2012-03-14
17:03:19 UTC (rev 39512)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2012-03-14
17:22:53 UTC (rev 39513)
@@ -24,6 +24,7 @@
import org.eclipse.wst.server.core.model.IModuleFile;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.util.ModuleFile;
+import org.jboss.ide.eclipse.as.core.Trace;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
@@ -66,11 +67,12 @@
if( DeploymentMarkerUtils.supportsJBoss7MarkerDeployment(server)) {
status = handleJBoss7Deployment(method, server, module, publishType, delta, monitor);
} else {
+ Trace.trace(Trace.STRING_FINER, "Using as<=6 publishModule logic in
WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
IDeployableServer ds = ServerConverter.getDeployableServer(server);
String deployRoot = getDeployRoot(module, ds);
LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
status = util.publishModule(server, deployRoot, module, publishType, delta, monitor);
- monitor.done();
+ Trace.trace(Trace.STRING_FINER, "Zipping complete for module " +
module[module.length-1].getName() ); //$NON-NLS-1$ monitor.done();
}
return status;
}
@@ -83,12 +85,16 @@
IDeployableServer ds = ServerConverter.getDeployableServer(server);
String deployRoot = getDeployRoot(module, ds);
if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
+ Trace.trace(Trace.STRING_FINER, "Removing .dodeploy marker in WTPZippedPublisher
to undeploy module " + module[module.length-1].getName() ); //$NON-NLS-1$
DeploymentMarkerUtils.removeDeployedMarkerIfExists(method, ds, module, monitor);
} else {
+ Trace.trace(Trace.STRING_FINER, "Zipping module in WTPZippedPublisher for module
" + module[module.length-1].getName() ); //$NON-NLS-1$
LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
IStatus s = util.publishModule(server, deployRoot, module, publishType, delta,
monitor);
IPath outPath = util.getOutputFilePath();
if( util.hasBeenChanged()) {
+ Trace.trace(Trace.STRING_FINER, "Output zip changed. Copying file to
destination. WTPZippedPublisher for module " + module[module.length-1].getName() );
//$NON-NLS-1$
+
// Copy out file
IPath depPath = PublishUtil.getDeployPath(method, module, ds);
IPath folder = depPath.removeLastSegments(1);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java 2012-03-14
17:03:19 UTC (rev 39512)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractPublishMethod.java 2012-03-14
17:22:53 UTC (rev 39513)
@@ -18,6 +18,7 @@
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.ExtensionManager;
+import org.jboss.ide.eclipse.as.core.Trace;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
@@ -28,17 +29,15 @@
public void publishStart(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "Publish start in " + getClass().getName());
//$NON-NLS-1$
}
public int publishFinish(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
- IModule[] modules = behaviour.getServer().getModules();
- boolean allpublished= true;
- for (int i = 0; i < modules.length; i++) {
- if(behaviour.getServer().getModulePublishState(new
IModule[]{modules[i]})!=IServer.PUBLISH_STATE_NONE)
- allpublished=false;
- }
- return allpublished ? IServer.PUBLISH_STATE_NONE :
IServer.PUBLISH_STATE_INCREMENTAL;
+ Trace.trace(Trace.STRING_FINER, "Beginning publishFinish in " +
getClass().getName()); //$NON-NLS-1$
+ int result = getServerPublishState(behaviour);
+ Trace.trace(Trace.STRING_FINER, "Ending publishFinish with server restart state of
" + result); //$NON-NLS-1$
+ return result;
}
public int getServerPublishState(DeployableServerBehavior behaviour) {
@@ -56,6 +55,8 @@
public int publishModule(DeployableServerBehavior behaviour, int kind,
int deltaKind, IModule[] module, IProgressMonitor monitor)
throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "Beginning to publish module " +
module[module.length-1].getName()); //$NON-NLS-1$
+
// kind = [incremental, full, auto, clean] = [1,2,3,4]
// delta = [no_change, added, changed, removed] = [0,1,2,3]
if( module.length == 0 ) return IServer.PUBLISH_STATE_NONE;
@@ -68,6 +69,7 @@
IModuleResourceDelta[] deltas = new IModuleResourceDelta[]{};
if( deltaKind != ServerBehaviourDelegate.REMOVED)
deltas = behaviour.getPublishedResourceDelta(module);
+ Trace.trace(Trace.STRING_FINER, "Publisher for module " +
module[module.length-1].getName() + " is " + publisher.getClass().getName());
//$NON-NLS-1$//$NON-NLS-2$
if( publisher != null ) {
try {
IStatus result = publisher.publishModule(
@@ -78,6 +80,7 @@
ServerLogger.getDefault().log(behaviour.getServer(), result);
} catch( CoreException ce) {
// Let the user know
+ Trace.trace(Trace.STRING_FINER, "Exception publishing module: " +
ce.getMessage()); //$NON-NLS-1$
ServerLogger.getDefault().log(behaviour.getServer(), ce.getStatus());
throw ce;
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2012-03-14
17:03:19 UTC (rev 39512)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2012-03-14
17:22:53 UTC (rev 39513)
@@ -34,6 +34,7 @@
import org.eclipse.wst.server.core.util.ProjectModule;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.Trace;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.modules.ResourceModuleResourceUtil;
import org.jboss.ide.eclipse.as.core.publishers.patterns.IModulePathFilter;
@@ -109,6 +110,7 @@
status = unpublish(this.server, module, subMon);
} else {
if( ServerModelUtilities.isAnyDeleted(module) ) {
+ Trace.trace(Trace.STRING_FINER, "Handling a wtp 'deleted module' (aka
missing). No Action Taken. Returning state=unknown "); //$NON-NLS-1$
publishState = IServer.PUBLISH_STATE_UNKNOWN;
} else {
if (publishType == FULL_PUBLISH ) {
@@ -186,7 +188,8 @@
protected IStatus fullPublish(IModule[] moduleTree, IModule module, IProgressMonitor
monitor) throws CoreException {
monitor.beginTask("Full Publish: " +
moduleTree[moduleTree.length-1].getName(), 1000); //$NON-NLS-1$
-
+ Trace.trace(Trace.STRING_FINER, "Begin Handling a full publish for module " +
module.getName()); //$NON-NLS-1$
+
IPath deployPath = getDeployPath(moduleTree, server);
IPublishCopyCallbackHandler callback =
getCallbackHandler(getRootPath(deployPath).append(deployPath));
IModuleResource[] members = PublishUtil.getResources(module, getSubMon(monitor, 200));
@@ -200,9 +203,11 @@
//if( !ServerModelUtilities.isBinaryModule(module))
callback.deleteResource(new Path("/"), getSubMon(monitor, 100));
//$NON-NLS-1$
- if( monitor.isCanceled())
+ if( monitor.isCanceled()) {
+ Trace.trace(Trace.STRING_FINER, "Monitor canceled during full publish for module
" + module.getName()); //$NON-NLS-1$
return canceledStatus();
-
+ }
+
List<IStatus> list = new ArrayList<IStatus>();
boolean isBinaryObject = ServerModelUtilities.isBinaryModule(module);
@@ -218,6 +223,7 @@
list.addAll(Arrays.asList(transferForceZippedChild(deployPath, module, moduleTree,
monitor)));
}
+ Trace.trace(Trace.STRING_FINER, "full publish completed for module " +
module.getName()); //$NON-NLS-1$
monitor.done();
if( list.size() > 0 )
return createMultiStatus(list, module);
@@ -319,11 +325,13 @@
protected IStatus incrementalPublish(IModule[] moduleTree, IModule module,
IProgressMonitor monitor) throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "Begin Handling an incremental publish");
//$NON-NLS-1$
IStatus[] results = new IStatus[] {};
IPath deployPath = getDeployPath(moduleTree, server);
IPublishCopyCallbackHandler h1 = getCallbackHandler(deployPath);
// quick switch to full publish for JBIDE-9112, recent switch from zip to unzipped
requires full publish
if( h1.isFile(new Path("/"), new NullProgressMonitor())) { //$NON-NLS-1$
+ Trace.trace(Trace.STRING_FINER, "Incremental Publish forced to become full
publish, see JBIDE-9112"); //$NON-NLS-1$
return fullPublish(moduleTree, module, monitor);
}
@@ -362,6 +370,7 @@
IStatus ret = new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
IEventCodes.JST_PUB_FULL_SUCCESS,
NLS.bind(Messages.CountModifiedMembers, PublishUtil.countChanges(delta),
module.getName()), null);
+ Trace.trace(Trace.STRING_FINER, "End Handling an incremental publish. The copying
of files has been completed. "); //$NON-NLS-1$
return ret;
}
@@ -408,11 +417,13 @@
protected IStatus unpublish(IDeployableServer jbServer, IModule[] module,
IProgressMonitor monitor) throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "Handling an unpublish"); //$NON-NLS-1$
monitor.beginTask("Removing Module: " + module[module.length-1].getName(),
100); //$NON-NLS-1$
IPath remotePath = getDeployPath(module, server);
IPublishCopyCallbackHandler handler =
getCallbackHandler(getRootPath(remotePath).append(remotePath));
handler.deleteResource(new Path("/"), getSubMon(monitor, 100));
//$NON-NLS-1$
monitor.done();
+ Trace.trace(Trace.STRING_FINER, "Deleted deployment resource: " +
remotePath); //$NON-NLS-1$
return Status.OK_STATUS;
}
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2012-03-14
17:03:19 UTC (rev 39512)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2012-03-14
17:22:53 UTC (rev 39513)
@@ -20,6 +20,7 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.Trace;
import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.core.publishers.JSTPublisherXMLToucher;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
@@ -54,19 +55,22 @@
public synchronized IJBossBehaviourDelegate getDelegate() {
IJBossServerPublishMethodType type =
DeploymentPreferenceLoader.getCurrentDeploymentMethodType(getServer());
String id = type == null ? LocalPublishMethod.LOCAL_PUBLISH_METHOD : type.getId();
+ IJBossBehaviourDelegate ret = null;
if( id.equals(lastModeId) && delegate != null &&
delegate.getBehaviourTypeId().equals(id))
- return delegate;
-
- Behaviour b =
BehaviourModel.getModel().getBehaviour(getServer().getServerType().getId());
- BehaviourImpl impl = b.getImpl(id);
- if( impl != null ) {
- IJBossBehaviourDelegate d = impl.createBehaviourDelegate();
- d.setActualBehaviour(this);
- lastModeId = id;
- delegate = d;
- return delegate;
+ ret = delegate;
+ else {
+ Behaviour b =
BehaviourModel.getModel().getBehaviour(getServer().getServerType().getId());
+ BehaviourImpl impl = b.getImpl(id);
+ if( impl != null ) {
+ IJBossBehaviourDelegate d = impl.createBehaviourDelegate();
+ d.setActualBehaviour(this);
+ lastModeId = id;
+ ret = d;
+ }
}
- return null;
+ delegate = ret;
+ //Trace.trace(Trace.STRING_FINEST, "Finding DelegatingServerBehavior's
delegate for server " + getServer().getName() +". Class=" + (ret == null ?
null : ret.getClass().getName())); //$NON-NLS-1$//$NON-NLS-2$
+ return ret;
}
public IModulePathFilter getPathFilter(IModule[] moduleTree) {
@@ -77,6 +81,7 @@
}
public void stop(boolean force) {
+ Trace.trace(Trace.STRING_FINER, "DelegatingServerBehavior initiating stop for
server " + getServer().getName()); //$NON-NLS-1$
getDelegate().stop(force);
}
@@ -134,6 +139,7 @@
}
protected void publishFinish(final IProgressMonitor monitor) throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "PublishFinish in DelegatingServerBehavior");
//$NON-NLS-1$
try {
getDelegate().publishFinish(monitor);
} finally {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2012-03-14
17:03:19 UTC (rev 39512)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2012-03-14
17:22:53 UTC (rev 39513)
@@ -27,6 +27,7 @@
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Trace;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
import org.jboss.ide.eclipse.as.core.publishers.patterns.IModulePathFilter;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
@@ -59,6 +60,7 @@
protected void publishStart(IProgressMonitor monitor) throws CoreException {
if( method != null )
throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Already publishing")); //$NON-NLS-1$
+ Trace.trace(Trace.STRING_FINER, "Publish Start in DeployableServerBehavior");
//$NON-NLS-1$
method = getOrCreatePublishMethod();
publishTaskModel = new HashMap<String, Object>();
method.publishStart(this, monitor);
@@ -76,12 +78,16 @@
* @throws CoreException
*/
protected IJBossServerPublishMethod getOrCreatePublishMethod() throws CoreException {
- if( method == null )
+ if( method == null ) {
method = createPublishMethod();
+ Trace.trace(Trace.STRING_FINER, "Creating publish method " + (method == null
? null : method.getClass().getName())); //$NON-NLS-1$
+ }
return method;
}
protected void publishFinish(IProgressMonitor monitor) throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "PublishFinish in DeployableServerBehavior");
//$NON-NLS-1$
+
if( method == null )
throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Not publishing")); //$NON-NLS-1$
try {
@@ -105,6 +111,8 @@
}
protected void publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor
monitor) throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "Beginning to publish module " +
module[module.length-1].getName() + " in DeployableServerBehavior");
//$NON-NLS-1$ //$NON-NLS-2$
+
if( method == null )
throw new CoreException(new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID,
"Not publishing")); //$NON-NLS-1$
try {
@@ -114,6 +122,7 @@
setModuleState(module, IServer.STATE_STARTED );
}
} catch(CoreException ce) {
+ Trace.trace(Trace.STRING_FINER, "Error publishing module " +
module[module.length-1].getName() + " in DeployableServerBehavior. " +
ce.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$
setModulePublishState(module, IServer.PUBLISH_STATE_FULL);
setModuleState(module, IServer.STATE_UNKNOWN );
throw ce;
@@ -214,6 +223,7 @@
getServer().addServerListener(new IServerListener() {
public void serverChanged(ServerEvent event) {
if( event.getState() != serverStateVal ) {
+ Trace.trace(Trace.STRING_FINER, "Framework has changed server state from
starting to stopped. Ensuring server has stopped."); //$NON-NLS-1$
// something's been changed by the framework and NOT by us.
if( serverStateVal == IServer.STATE_STARTING && event.getState() ==
IServer.STATE_STOPPED) {
stop(true);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-03-14
17:03:19 UTC (rev 39512)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-03-14
17:22:53 UTC (rev 39513)
@@ -29,6 +29,7 @@
import org.eclipse.wst.server.core.IModule;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.Trace;
import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
@@ -81,6 +82,7 @@
@Override
protected void publishFinish(IProgressMonitor monitor) throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "PublishFinish in
DelegatingJBoss7ServerBehavior"); //$NON-NLS-1$
// Handle the dodeploy
try {
createDoDeployMarkers(monitor);
@@ -94,6 +96,7 @@
return;
}
List<IPath> paths = getMarkedDoDeploy();
+ Trace.trace(Trace.STRING_FINER, "Marking " + paths.size() + " dodeploy
files."); //$NON-NLS-1$//$NON-NLS-2$
monitor.beginTask("Completing Publishes", paths.size() + 1); //$NON-NLS-1$
createDoDeployMarker(getOrCreatePublishMethod(), paths, monitor);
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java 2012-03-14
17:03:19 UTC (rev 39512)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java 2012-03-14
17:22:53 UTC (rev 39513)
@@ -30,6 +30,7 @@
import org.eclipse.wst.server.core.model.IModuleFile;
import org.eclipse.wst.server.core.util.ModuleFile;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Trace;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
@@ -85,7 +86,9 @@
IPath depPath, IProgressMonitor monitor) throws CoreException {
IPath folder = depPath.removeLastSegments(1);
IPublishCopyCallbackHandler callback = method.getCallbackHandler(folder, server);
- callback.copyFile(createBlankModule(), new Path(depPath.lastSegment() + DO_DEPLOY),
monitor);
+ IPath lastSegment = new Path(depPath.lastSegment() + DO_DEPLOY);
+ callback.copyFile(createBlankModule(), lastSegment, monitor);
+ Trace.trace(Trace.STRING_FINER, "Creating dodeploy file: " +
folder.append(lastSegment)); //$NON-NLS-1$
return Status.OK_STATUS;
}
@@ -170,6 +173,8 @@
*/
public static IStatus removeDeployedMarkerIfExists(IJBossServerPublishMethod method,
IServer server, IPath depPath,
IProgressMonitor monitor) throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "Removing deployment marker file on path " +
depPath); //$NON-NLS-1$
+
try {
return removeFile(DEPLOYED, server, depPath, method, monitor);
} catch (CoreException e) {
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2012-03-14
17:03:19 UTC (rev 39512)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2012-03-14
17:22:53 UTC (rev 39513)
@@ -18,6 +18,7 @@
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
+import org.jboss.ide.eclipse.as.core.Trace;
import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.core.publishers.JSTPublisherXMLToucher;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
@@ -46,6 +47,8 @@
IServer server, IModule[] module,
int publishType, IModuleResourceDelta[] delta,
IProgressMonitor monitor) throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "Using AS7 publishModule logic in
JBoss7JSTPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
+
IDeployableServer ds = ServerConverter.getDeployableServer(server);
DeploymentMarkerUtils.removeDeployFailedMarker(method, server,
PublishUtil.getDeployPath(method, module, ds), monitor);
@@ -83,6 +86,7 @@
private void doDeployRequired(IJBossServerPublishMethod method,IDeployableServer
server,
IModule[] moduleTree, IProgressMonitor monitor ) throws CoreException {
IPath p = PublishUtil.getDeployPath(method, moduleTree, server);
+ Trace.trace(Trace.STRING_FINER, "Marking path " + p + " as requiring a
.dodeploy marker, but NOT creating the file yet"); //$NON-NLS-1$ //$NON-NLS-2$
DelegatingJBoss7ServerBehavior beh =
ServerConverter.getJBoss7ServerBehavior(server.getServer());
beh.markDoDeploy(p);
}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2012-03-14
17:03:19 UTC (rev 39512)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEPublishMethod.java 2012-03-14
17:22:53 UTC (rev 39513)
@@ -26,6 +26,7 @@
import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.Trace;
import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.publishers.AbstractPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
@@ -63,6 +64,7 @@
public void publishStart(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
+ super.publishStart(behaviour, monitor);
this.behaviour = behaviour;
loadRemoteDeploymentDetails();
ensureConnection(monitor);
@@ -71,11 +73,12 @@
if( b != null && getServer().getServerState() == IServer.STATE_STARTED ) {
stopDeploymentScanner();
}
- super.publishStart(behaviour, monitor);
+ Trace.trace(Trace.STRING_FINER, "Finished publish start for server " +
getServer().getName());
}
public int publishFinish(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
+ Trace.trace(Trace.STRING_FINER, "Beginning publishFinish for server " +
getServer().getName());
DelegatingServerBehavior b = (DelegatingServerBehavior)
behaviour.getServer().loadAdapter(DelegatingServerBehavior.class, new
NullProgressMonitor());
if( b != null && getServer().getServerState() == IServer.STATE_STARTED ) {
startDeploymentScanner();
@@ -84,12 +87,14 @@
}
protected void startDeploymentScanner() {
+ Trace.trace(Trace.STRING_FINER, "Starting remote deployment scanner for server
" + getServer().getName());
String cmd = getDeploymentScannerCommand(new NullProgressMonitor(), true);
if( cmd != null )
launchCommandNoResult((DelegatingServerBehavior)behaviour, 3000, cmd);
}
protected void stopDeploymentScanner() {
+ Trace.trace(Trace.STRING_FINER, "Stopping remote deployment scanner for server
" + getServer().getName());
String cmd = getDeploymentScannerCommand(new NullProgressMonitor(), false);
if( cmd != null )
launchCommandNoResult((DelegatingServerBehavior)behaviour, 3000, cmd);
@@ -131,10 +136,12 @@
}
public boolean ensureConnection(IProgressMonitor monitor) {
+ Trace.trace(Trace.STRING_FINER, "Ensuring connection to remote server for server
" + getServer().getName());
if (fileSubSystem != null && !fileSubSystem.isConnected()) {
try {
fileSubSystem.connect(monitor, false);
} catch (Exception e) {
+ Trace.trace(Trace.STRING_FINER, "Exception connecting to remote server: " +
e.getMessage());
// I'd rather not catch Exception, but that's all they throw
return false;
}
@@ -169,7 +176,9 @@
}
protected void loadRemoteDeploymentDetails() throws CoreException{
+ Trace.trace(Trace.STRING_FINER, "Ensuring RSE is initialized");
RSEUtils.waitForFullInit();
+ Trace.trace(Trace.STRING_FINER, "Loading remote deployment details for server
" + getServer().getName());
String connectionName = RSEUtils.getRSEConnectionName(behaviour.getServer());
IDeployableServer ds = ServerConverter.getDeployableServer(behaviour.getServer());
this.remoteRootFolder = new Path(RSEUtils.getDeployRootFolder(ds));
@@ -207,13 +216,13 @@
}
private void launchCommandNoResult(DelegatingServerBehavior behaviour, int delay, String
command) {
+ Trace.trace(Trace.STRING_FINER, "Launching remote command: " + command);
try {
ServerShellModel model =
RSEHostShellModel.getInstance().getModel(behaviour.getServer());
model.executeRemoteCommand("/", command, new String[]{}, new
NullProgressMonitor(), delay, true);
} catch( CoreException ce ) {
+ Trace.trace(Trace.STRING_FINER, "Exception launching remote command
(command="+command+"): " + ce.getMessage());
ServerLogger.getDefault().log(behaviour.getServer(), ce.getStatus());
}
}
-
-
}