Class JobBasedServerModulePublisher
java.lang.Object
com.e1c.g5.dt.internal.applications.wst.JobBasedServerModulePublisher
- All Implemented Interfaces:
IServerModulePublisher
Publishes server module using a separate job.
This implementation of
IServerModulePublisher
tries to provide both:
- Thread safety of
IServer.publish(int, List, org.eclipse.core.runtime.IAdaptable, org.eclipse.wst.server.core.IServer.IOperationListener)
by doing actual publishing in a background job as required by WST API. - Integration with
IProgressMonitor
in terms of user ability to cancel the operation.
- Operation has already been cancelled upon the call and this is reported as
IStatus.CANCEL
. - Publishing job finishes as a result of finishing publish process, an error or responding to cancellation. The same status returned as by publishing job.
- Caller thread gets interrupted and this is reported as
IStatus.CANCEL
. - Progress monitor specified by the caller gets cancelled and this is reported as
IStatus.CANCEL
. - If publishing job cannot be run. For example, if job manager is suspended then no jobs are
scheduled. This case is indicated by
Optional.empty()
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<org.eclipse.core.runtime.IStatus>
publish
(int kind, org.eclipse.wst.server.core.IServer server, org.eclipse.wst.server.core.IModule module, org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.swt.widgets.Shell shell) Publishes specified server module.
-
Constructor Details
-
JobBasedServerModulePublisher
public JobBasedServerModulePublisher()
-
-
Method Details
-
publish
public Optional<org.eclipse.core.runtime.IStatus> publish(int kind, org.eclipse.wst.server.core.IServer server, org.eclipse.wst.server.core.IModule module, org.eclipse.core.runtime.IProgressMonitor monitor, org.eclipse.swt.widgets.Shell shell) Description copied from interface:IServerModulePublisher
Publishes specified server module.- Specified by:
publish
in interfaceIServerModulePublisher
- Parameters:
kind
- Type of publishing. Should be one of the following:IServer.PUBLISH_INCREMENTAL
IServer.PUBLISH_FULL
IServer.PUBLISH_AUTO
IServer.PUBLISH_CLEAN
server
- Server where the module should be published. Must not benull
.module
- Module to be published. Must not benull
.monitor
- Progress monitor that user can cancel to cancel publication process. Must not benull
.shell
- Shell to be used to prompt user if necessary ornull
if not available.- Returns:
- Status of publication process or an empty value if publication operation has not been done.
Never
null
.
-