Author: rob.stryker(a)jboss.com
Date: 2011-12-13 08:24:37 -0500 (Tue, 13 Dec 2011)
New Revision: 37265
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/DeployableServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
Log:
JBIDE-9630 - to trunk
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 2011-12-13
13:23:45 UTC (rev 37264)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2011-12-13
13:24:37 UTC (rev 37265)
@@ -169,11 +169,11 @@
if( ds == null )
return;
- IJBossServerPublishMethod method = getOrCreatePublishMethod();
+ IJBossServerPublishMethod method = createPublishMethod();
IPath depPath = PublishUtil.getDeployPath(method, module, ds);
if( ServerModelUtilities.isBinaryModule(module[module.length-1]) ||
ds.zipsWTPDeployments()) {
// touch the file
- getOrCreatePublishMethod().getCallbackHandler(depPath.removeLastSegments(1),
getServer()).touchResource(new Path(depPath.lastSegment()));
+ method.getCallbackHandler(depPath.removeLastSegments(1),
getServer()).touchResource(new Path(depPath.lastSegment()));
} else {
// touch the descriptor
IPublishCopyCallbackHandler callback =
method.getCallbackHandler(AbstractServerToolsPublisher.getRootPath(depPath).append(depPath),
getServer());
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 2011-12-13
13:23:45 UTC (rev 37264)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2011-12-13
13:24:37 UTC (rev 37265)
@@ -60,6 +60,17 @@
method.publishStart(this, monitor);
}
+ /**
+ * Get the current publish method if one exists, or, create one and return it.
+ * Any created publish method will be cached and stored.
+ *
+ * This method should NOT be called except as part of the publishing process.
+ * Clients that need a disposable single-use publish method should call
+ * createPublishMethod() instead.
+ *
+ * @return
+ * @throws CoreException
+ */
protected IJBossServerPublishMethod getOrCreatePublishMethod() throws CoreException {
if( method == null )
method = createPublishMethod();
@@ -103,11 +114,16 @@
}
/**
- * This should only be called once per overall publish.
- * publishStart() should call this, cache the method, and use it
- * until after publishFinish() is called.
+ * This method creates a disposable publishMethod for use in publishing modules and
projects,
+ * touching files, copying files, or any other task relevent to publish methods.
*
- * @return
+ * This method will also be called once during a "publish cycle"
+ * between publishStart and publishFinish, with the
+ * IJBossServerPublishMethod cached for the duration.
+ *
+ * Other clients can use this API to have a disposable publish method to use.
+ *
+ * @return The publish method
*/
public IJBossServerPublishMethod createPublishMethod() {
IJBossServerPublishMethodType type =
DeploymentPreferenceLoader.getCurrentDeploymentMethodType(getServer());
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2011-12-13
13:23:45 UTC (rev 37264)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServerBehavior.java 2011-12-13
13:24:37 UTC (rev 37265)
@@ -169,11 +169,11 @@
if( ds == null )
return;
- IJBossServerPublishMethod method = getOrCreatePublishMethod();
+ IJBossServerPublishMethod method = createPublishMethod();
IPath depPath = PublishUtil.getDeployPath(method, module, ds);
if( ServerModelUtilities.isBinaryModule(module[module.length-1]) ||
ds.zipsWTPDeployments()) {
// touch the file
- getOrCreatePublishMethod().getCallbackHandler(depPath.removeLastSegments(1),
getServer()).touchResource(new Path(depPath.lastSegment()));
+ method.getCallbackHandler(depPath.removeLastSegments(1),
getServer()).touchResource(new Path(depPath.lastSegment()));
} else {
// touch the descriptor
IPublishCopyCallbackHandler callback =
method.getCallbackHandler(AbstractServerToolsPublisher.getRootPath(depPath).append(depPath),
getServer());
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 2011-12-13
13:23:45 UTC (rev 37264)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2011-12-13
13:24:37 UTC (rev 37265)
@@ -101,7 +101,7 @@
}
List<IPath> paths = getMarkedDoDeploy();
monitor.beginTask("Completing Publishes", paths.size() + 1); //$NON-NLS-1$
- createDoDeployMarker(paths, monitor);
+ createDoDeployMarker(getOrCreatePublishMethod(), paths, monitor);
}
@Override
@@ -110,9 +110,9 @@
if( ds == null )
return;
- IJBossServerPublishMethod method = getOrCreatePublishMethod();
+ IJBossServerPublishMethod method = createPublishMethod();
IPath depPath = PublishUtil.getDeployPath(method, module, ds);
- createDoDeployMarker(new IPath[]{depPath}, monitor);
+ createDoDeployMarker(method, new IPath[]{depPath}, monitor);
}
@Override
@@ -180,12 +180,14 @@
}
return (List<IPath>) o;
}
- private void createDoDeployMarker(IPath[] paths, IProgressMonitor monitor) throws
CoreException {
+ private void createDoDeployMarker(IJBossServerPublishMethod method, IPath[] paths,
IProgressMonitor monitor) throws CoreException {
List<IPath> allPaths = Arrays.asList(paths);
- createDoDeployMarker(allPaths, monitor);
+ createDoDeployMarker(method, allPaths, monitor);
}
- private void createDoDeployMarker(List<IPath> paths, IProgressMonitor monitor)
throws CoreException {
- DeploymentMarkerUtils.addDoDeployMarker(getOrCreatePublishMethod(), getServer(), paths,
monitor);
+ private void createDoDeployMarker(IJBossServerPublishMethod method, List<IPath>
paths, IProgressMonitor monitor) throws CoreException {
+ if( method == null )
+ method = createPublishMethod();
+ DeploymentMarkerUtils.addDoDeployMarker(method, getServer(), paths, monitor);
}
@Override