From 4523a01b834838f4e87743424e077fa16cd5e001 Mon Sep 17 00:00:00 2001 From: avera Date: Tue, 11 May 2010 15:26:00 +0000 Subject: [311794] PublisherDelegate do not provide delta kind information on execute() --- .../org/eclipse/wst/server/core/TaskModel.java | 11 ++++++++- .../server/core/model/ServerBehaviourDelegate.java | 28 +++++++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) (limited to 'plugins/org.eclipse.wst.server.core/servercore/org/eclipse') diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java index beab5c36a..2b7504e25 100644 --- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java +++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/TaskModel.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2007 IBM Corporation and others. + * Copyright (c) 2003, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -50,6 +50,15 @@ public class TaskModel { */ public static final String TASK_MODULES = "modules"; + /** + * Task model id for an array of delta kinds that maps to the modules in the TASK_MODULES. + * The value is a List containing Integer for the delta kind id. + * + * @see #getObject(String) + * @see TaskModel#putObject(String, Object) + */ + public static final String TASK_DELTA_KINDS = "deltaKinds"; + /** * Task model id for a launch mode. * diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java index b3fbff894..e1cf40af2 100644 --- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java +++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/model/ServerBehaviourDelegate.java @@ -914,7 +914,7 @@ public abstract class ServerBehaviourDelegate { tempMulti.addAll(taskStatus); // execute publishers - taskStatus = executePublishers(kind, moduleList, monitor, info2); + taskStatus = executePublishers(kind, moduleList, deltaKindList, monitor, info2); if (taskStatus != null && !taskStatus.isOK()) tempMulti.addAll(taskStatus); @@ -1118,6 +1118,7 @@ public abstract class ServerBehaviourDelegate { * Execute publishers. * * @param kind the publish kind + * @param modules the list of modules * @param monitor a progress monitor, or null if progress * reporting and cancellation are not desired * @param info the IAdaptable (or null) provided by the @@ -1127,8 +1128,30 @@ public abstract class ServerBehaviourDelegate { * org.eclipse.swt.widgets.Shell.class * @throws CoreException * @since 1.1 + * @deprecated Replaced by + * {@link #executePublishers(int, List, List, IProgressMonitor, IAdaptable)} */ protected MultiStatus executePublishers(int kind, List modules, IProgressMonitor monitor, IAdaptable info) throws CoreException { + return executePublishers(kind, modules, null, monitor, info); + } + + /** + * Execute publishers. + * + * @param kind the publish kind + * @param modules the list of modules + * @param deltaKinds the list of delta kind that maps to the list of modules + * @param monitor a progress monitor, or null if progress + * reporting and cancellation are not desired + * @param info the IAdaptable (or null) provided by the + * caller in order to supply UI information for prompting the + * user if necessary. When this parameter is not null, + * it should minimally contain an adapter for the + * org.eclipse.swt.widgets.Shell.class + * @throws CoreException + * @since 1.1 + */ + protected MultiStatus executePublishers(int kind, List modules, List deltaKinds, IProgressMonitor monitor, IAdaptable info) throws CoreException { Publisher[] publishers = ((Server)getServer()).getEnabledPublishers(); int size = publishers.length; Trace.trace(Trace.FINEST, "Executing publishers: " + size); @@ -1141,6 +1164,9 @@ public abstract class ServerBehaviourDelegate { TaskModel taskModel = new TaskModel(); taskModel.putObject(TaskModel.TASK_SERVER, getServer()); taskModel.putObject(TaskModel.TASK_MODULES, modules); + if (deltaKinds != null) { + taskModel.putObject(TaskModel.TASK_DELTA_KINDS, deltaKinds); + } for (int i = 0; i < size; i++) { Publisher pub = publishers[i]; -- cgit v1.2.3