当前位置: 首页>>代码示例>>Java>>正文


Java VerticleFactory.removePrefix方法代码示例

本文整理汇总了Java中io.vertx.core.spi.VerticleFactory.removePrefix方法的典型用法代码示例。如果您正苦于以下问题:Java VerticleFactory.removePrefix方法的具体用法?Java VerticleFactory.removePrefix怎么用?Java VerticleFactory.removePrefix使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.vertx.core.spi.VerticleFactory的用法示例。


在下文中一共展示了VerticleFactory.removePrefix方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createVerticle

import io.vertx.core.spi.VerticleFactory; //导入方法依赖的package包/类
@Override
public Verticle createVerticle(String verticleName, ClassLoader classLoader) throws Exception {
    verticleName = VerticleFactory.removePrefix(verticleName);
    Class clazz;
    if (verticleName.endsWith(".java")) {
        CompilingClassLoader compilingLoader = new CompilingClassLoader(classLoader, verticleName);
        String className = compilingLoader.resolveMainClassName();
        clazz = compilingLoader.loadClass(className);
    } else {
        clazz = classLoader.loadClass(verticleName);
    }

    Verticle instance = (Verticle)clazz.newInstance();
    ConfigurationInjection.getConfigurationInjector().configure(instance);
    return instance;
}
 
开发者ID:apache,项目名称:incubator-tamaya-sandbox,代码行数:17,代码来源:ConfiguredJavaVerticleFactory.java

示例2: createVerticle

import io.vertx.core.spi.VerticleFactory; //导入方法依赖的package包/类
@Override
public Verticle createVerticle(String verticleName, ClassLoader classLoader) throws Exception {
    verticleName = VerticleFactory.removePrefix(verticleName);

    // Use the provided class loader to create an instance of GuiceVerticleLoader.  This is necessary when working with vert.x IsolatingClassLoader
    @SuppressWarnings("unchecked")
    Class<Verticle> loader = (Class<Verticle>) classLoader.loadClass(GuiceVerticleLoader.class.getName());
    Constructor<Verticle> ctor = loader.getConstructor(String.class, ClassLoader.class, Injector.class);

    if (ctor == null) {
        throw new IllegalStateException("Could not find GuiceVerticleLoader constructor");
    }

    return ctor.newInstance(verticleName, classLoader, getInjector());
}
 
开发者ID:kuangcao,项目名称:ninja-vertx-standalone,代码行数:16,代码来源:GuiceVerticleFactory.java

示例3: resolve

import io.vertx.core.spi.VerticleFactory; //导入方法依赖的package包/类
@Override
public void resolve(String id, DeploymentOptions deploymentOptions, ClassLoader classLoader,
    Future<String> resolution) {
  String identifier = VerticleFactory.removePrefix(id);
  String descriptorFile = identifier + ".json";
  try {
    JsonObject descriptor = readDescriptor(classLoader, descriptorFile);
    String main = readVerticleMainClass(descriptor, descriptorFile);

    // Any options specified in the module config will override anything specified at deployment time
    // Options and Config specified in knotx starter JSON will override those configurations
    JsonObject depOptions = deploymentOptions.toJson();
    JsonObject depConfig = depOptions.getJsonObject(CONFIG_KEY, new JsonObject());

    JsonObject knotOptions = descriptor.getJsonObject(OPTIONS_KEY, new JsonObject());
    JsonObject knotConfig = knotOptions.getJsonObject(CONFIG_KEY, new JsonObject());
    depOptions.mergeIn(knotOptions);
    depOptions.put(CONFIG_KEY, JsonObjectUtil.deepMerge(knotConfig, depConfig));

    JsonObject serviceDescriptor = new JsonObject().put(OPTIONS_KEY, depOptions);

    // Any options or config provided by system properties will override anything specified
    // at deployment time and on starter Json config
    serviceDescriptor = overrideConfigWithSystemProperties(identifier, serviceDescriptor);

    deploymentOptions.fromJson(serviceDescriptor.getJsonObject(OPTIONS_KEY));
    resolution.complete(main);
  } catch (Exception e) {
    resolution.fail(e);
  }
}
 
开发者ID:Cognifide,项目名称:knotx,代码行数:32,代码来源:KnotxModuleVerticleFactory.java

示例4: parseIdentifier

import io.vertx.core.spi.VerticleFactory; //导入方法依赖的package包/类
public static Identifier parseIdentifier(String identifier) {
  String identifierNoPrefix = VerticleFactory.removePrefix(identifier);
  String verticleName = identifierNoPrefix;
  String serviceFilter = null;
  int pos = identifierNoPrefix.lastIndexOf("::");
  if (pos != -1) {
    verticleName = identifierNoPrefix.substring(0, pos);
    serviceFilter = identifierNoPrefix.substring(pos + 2);
  }
  return new Identifier(verticleName, serviceFilter);
}
 
开发者ID:cstamas,项目名称:vertx-sisu,代码行数:12,代码来源:Identifier.java

示例5: createVerticle

import io.vertx.core.spi.VerticleFactory; //导入方法依赖的package包/类
@Override
public synchronized Verticle createVerticle(final String verticleName, final ClassLoader classLoader) throws Exception {
    final String className = VerticleFactory.removePrefix(verticleName);
    Class<?> clazz;
    if (className.endsWith(SUFFIX)) {
        CompilingClassLoader compilingLoader = new CompilingClassLoader(classLoader, className);
        clazz = compilingLoader.loadClass(compilingLoader.resolveMainClassName());
    } else {
        clazz = classLoader.loadClass(className);
    }
    return createVerticle(clazz, classLoader);
}
 
开发者ID:amoAHCP,项目名称:spring-vertx-ext,代码行数:13,代码来源:SpringVerticleFactory.java

示例6: createVerticle

import io.vertx.core.spi.VerticleFactory; //导入方法依赖的package包/类
@Override
public Verticle createVerticle(final String verticleName, final ClassLoader classLoader) throws Exception {
    final String clazz = VerticleFactory.removePrefix(verticleName);
    return (Verticle) applicationContext.getBean(Class.forName(clazz));
}
 
开发者ID:daniel-zarzeczny,项目名称:vertx-spring-boot-example,代码行数:6,代码来源:SpringVerticleFactory.java

示例7: createVerticle

import io.vertx.core.spi.VerticleFactory; //导入方法依赖的package包/类
@Override
public Verticle createVerticle(String verticleName, ClassLoader classLoader) throws Exception {
  String beanName = VerticleFactory.removePrefix(verticleName);
  log.debug(String.format("Getting Verticle bean (%s) from context", beanName));
  return (Verticle) applicationContext.getBean(beanName);
}
 
开发者ID:Invizible,项目名称:vertx-spring-aware,代码行数:7,代码来源:SpringVerticleFactory.java

示例8: createVerticle

import io.vertx.core.spi.VerticleFactory; //导入方法依赖的package包/类
@Override
public Verticle createVerticle(String verticleName, ClassLoader classLoader) throws Exception {
  return new NodeJSVerticle(VerticleFactory.removePrefix(verticleName), classLoader);
}
 
开发者ID:mellster2012,项目名称:vertx-nodejs-service-factory,代码行数:5,代码来源:NodeJSVerticleFactory.java


注:本文中的io.vertx.core.spi.VerticleFactory.removePrefix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。