Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package com.englishtown.vertx.promises.impl;
  
 
 
 public class DefaultWhenContainer implements WhenContainer {
 
     private final Container container;
     private final When<StringVoidwhen = new When<>();
 
     @Inject
     public DefaultWhenContainer(Container container) {
         this. = container;
     }

    
Deploy a verticle programmatically

Parameters:
main The main of the verticle
 
     @Override
     public Promise<StringVoiddeployVerticle(String main) {
         return deployVerticle(mainnull, 1);
     }

    
Deploy a verticle programmatically

Parameters:
main The main of the verticle
config JSON config to provide to the verticle
 
     @Override
     public Promise<StringVoiddeployVerticle(String mainJsonObject config) {
         return deployVerticle(mainconfig, 1);
     }

    
Deploy a verticle programmatically

Parameters:
main The main of the verticle
instances The number of instances to deploy (defaults to 1)
 
     @Override
     public Promise<StringVoiddeployVerticle(String mainint instances) {
         return deployVerticle(mainnullinstances);
     }

    
Deploy a verticle programmatically

Parameters:
main The main of the verticle
config JSON config to provide to the verticle
instances The number of instances to deploy (defaults to 1)
 
     @Override
     public Promise<StringVoiddeployVerticle(String mainJsonObject configint instances) {
         final Deferred<StringVoidd = .defer();
 
         .deployVerticle(mainconfiginstancesnew Handler<AsyncResult<String>>() {
             @Override
             public void handle(AsyncResult<Stringresult) {
                 if (result.succeeded()) {
                     d.getResolver().resolve(result.result());
                 } else {
                     reject(dresult.result(), result.cause());
                 }
             }
         });
 
         return d.getPromise();
     }

    
Deploy a module programmatically

Parameters:
moduleName The main of the module to deploy
 
     @Override
     public Promise<StringVoiddeployModule(String moduleName) {
         return deployModule(moduleNamenull, 1);
     }

    
Deploy a module programmatically

Parameters:
moduleName The main of the module to deploy
config JSON config to provide to the module
    @Override
    public Promise<StringVoiddeployModule(String moduleNameJsonObject config) {
        return deployModule(moduleNameconfig, 1);
    }

    
Deploy a module programmatically

Parameters:
moduleName The main of the module to deploy
instances The number of instances to deploy (defaults to 1)
    @Override
    public Promise<StringVoiddeployModule(String moduleNameint instances) {
        return deployModule(moduleNamenullinstances);
    }

    
Deploy a module programmatically

Parameters:
moduleName The main of the module to deploy
config JSON config to provide to the module
instances The number of instances to deploy (defaults to 1)
    @Override
    public Promise<StringVoiddeployModule(String moduleNameJsonObject configint instances) {
        final Deferred<StringVoidd = .defer();
        .deployModule(moduleNameconfiginstancesnew Handler<AsyncResult<String>>() {
            @Override
            public void handle(AsyncResult<Stringresult) {
                if (result.succeeded()) {
                    d.getResolver().resolve(result.result());
                } else {
                    reject(dresult.result(), result.cause());
                }
            }
        });
        return d.getPromise();
    }

    
Deploy a worker verticle programmatically

Parameters:
main The main of the verticle
multiThreaded if true then the verticle will be deployed as a multi-threaded worker
    @Override
    public Promise<StringVoiddeployWorkerVerticle(String mainboolean multiThreaded) {
        return deployWorkerVerticle(mainnull, 1, multiThreaded);
    }

    
Deploy a worker verticle programmatically

Parameters:
main The main of the verticle
config JSON config to provide to the verticle
multiThreaded if true then the verticle will be deployed as a multi-threaded worker
    @Override
    public Promise<StringVoiddeployWorkerVerticle(String mainJsonObject configboolean multiThreaded) {
        return deployWorkerVerticle(mainconfig, 1, multiThreaded);
    }

    
Deploy a worker verticle programmatically

Parameters:
main The main of the verticle
instances The number of instances to deploy (defaults to 1)
multiThreaded if true then the verticle will be deployed as a multi-threaded worker
    @Override
    public Promise<StringVoiddeployWorkerVerticle(String mainint instancesboolean multiThreaded) {
        return deployWorkerVerticle(mainnullinstancesmultiThreaded);
    }

    
Deploy a worker verticle programmatically

Parameters:
main The main of the verticle
config JSON config to provide to the verticle
instances The number of instances to deploy (defaults to 1)
multiThreaded if true then the verticle will be deployed as a multi-threaded worker
    @Override
    public Promise<StringVoiddeployWorkerVerticle(String mainJsonObject configint instancesboolean multiThreaded) {
        final Deferred<StringVoidd = .defer();
        .deployWorkerVerticle(mainconfiginstancesmultiThreadednew Handler<AsyncResult<String>>() {
            @Override
            public void handle(AsyncResult<Stringresult) {
                if (result.succeeded()) {
                    d.getResolver().resolve(result.result());
                } else {
                    reject(dresult.result(), result.cause());
                }
            }
        });
        return d.getPromise();
    }
    protected void reject(Deferred<StringVoiddString resultThrowable t) {
        RuntimeException e = (t == null || t instanceof RuntimeException ? (RuntimeExceptiont : new RuntimeException(t));
        d.getResolver().reject(new Value<>(resulte));
    }
New to GrepCode? Check out our FAQ X