Example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.ops CloudApplicationOperation CloudApplicationOperation

List of usage examples for org.springframework.ide.eclipse.boot.dash.cloudfoundry.ops CloudApplicationOperation CloudApplicationOperation

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.dash.cloudfoundry.ops CloudApplicationOperation CloudApplicationOperation.

Prototype

public CloudApplicationOperation(String opName, CloudFoundryBootDashModel model, String appName,
            CancelationToken cancelationToken) 

Source Link

Usage

From source file:org.springframework.ide.eclipse.boot.dash.cloudfoundry.CloudAppDashElement.java

@Override
public void delete(UserInteractions ui) {
    CloudFoundryBootDashModel model = getCloudModel();
    CloudAppDashElement cloudElement = this;
    cloudElement.cancelOperations();// ww w .  j  a  v  a  2  s.  c om
    CancelationToken cancelToken = cloudElement.createCancelationToken();
    CloudApplicationOperation operation = new CloudApplicationOperation("Deleting: " + cloudElement.getName(),
            model, cloudElement.getName(), cancelToken) {

        @Override
        protected void doCloudOp(IProgressMonitor monitor) throws Exception, OperationCanceledException {
            // Delete from CF first. Do it outside of synch block to avoid
            // deadlock
            model.getRunTarget().getClient().deleteApplication(appName);
            model.getElementConsoleManager().terminateConsole(cloudElement.getName());
            model.removeApplication(cloudElement.getName());
            cloudElement.setProject(null);
        }
    };

    // Allow deletions to occur concurrently with any other application
    // operation
    operation.setSchedulingRule(null);
    getCloudModel().runAsynch(operation, ui);
}