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


Java Modules.EMPTY_MODULE属性代码示例

本文整理汇总了Java中com.google.inject.util.Modules.EMPTY_MODULE属性的典型用法代码示例。如果您正苦于以下问题:Java Modules.EMPTY_MODULE属性的具体用法?Java Modules.EMPTY_MODULE怎么用?Java Modules.EMPTY_MODULE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.google.inject.util.Modules的用法示例。


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

示例1: buildModule

public Module buildModule(ServerConfig serverConfig) {
    if (enabled) {

        Preconditions.checkNotNull(name);
        Preconditions.checkNotNull(defaultServiceUrl);
        Preconditions.checkNotNull(healthCheckUrl);
        Preconditions.checkNotNull(dataCenter);

        Properties properties = new Properties();

        properties.setProperty("eureka.name", name);
        properties.setProperty("eureka.serviceUrl.default", defaultServiceUrl.toString());
        properties.setProperty("eureka.healthCheckUrl", healthCheckUrl);
        properties.setProperty("eureka.datacenter", dataCenter == DataCenter.LOCAL ? "local" : "cloud");

        properties.setProperty("eureka.port", String.valueOf(serverConfig.getPort()));
        properties.setProperty("eureka.vipAddress", vipAddress != null ? vipAddress : name);
        properties.setProperty("eureka.statusPageUrl", healthCheckUrl);

        return new EurekaModule(properties);
    }
    return Modules.EMPTY_MODULE;
}
 
开发者ID:schibsted,项目名称:ratpack-eureka,代码行数:23,代码来源:EurekaFactory.java

示例2: getRuntimeModule

private static Module getRuntimeModule(String transport, String host, int port, Properties joynrConfig) {
    Module runtimeModule;
    if (transport != null) {
        if (transport.contains("websocketcc")) {
            configureWebSocket(host, port, joynrConfig);
            runtimeModule = new CCWebSocketRuntimeModule();
        } else if (transport.contains("websocket")) {
            configureWebSocket(host, port, joynrConfig);
            runtimeModule = new LibjoynrWebSocketRuntimeModule();
        } else {
            runtimeModule = new CCInProcessRuntimeModule();
        }

        Module backendTransportModules = Modules.EMPTY_MODULE;
        if (transport.contains("http")) {
            backendTransportModules = Modules.combine(backendTransportModules, new AtmosphereMessagingModule());
        }

        if (transport.contains("mqtt")) {
            configureMqtt(joynrConfig);
            backendTransportModules = Modules.combine(backendTransportModules, new MqttPahoModule());
        }
        return Modules.override(runtimeModule).with(backendTransportModules);
    }
    return Modules.override(new CCInProcessRuntimeModule()).with(new MqttPahoModule());
}
 
开发者ID:bmwcarit,项目名称:joynr,代码行数:26,代码来源:MyRadioProviderApplication.java

示例3: forModule

/** Returns a module which creates bindings for provider methods from the given module. */
static Module forModule(Module module) {
  // avoid infinite recursion, since installing a module always installs itself
  if (module instanceof CheckedProviderMethodsModule) {
    return Modules.EMPTY_MODULE;
  }

  return new CheckedProviderMethodsModule(module);
}
 
开发者ID:google,项目名称:guice,代码行数:9,代码来源:CheckedProviderMethodsModule.java

示例4: forObject

private static Module forObject(
    Object object, boolean skipFastClassGeneration, ModuleAnnotatedMethodScanner scanner) {
  // avoid infinite recursion, since installing a module always installs itself
  if (object instanceof ProviderMethodsModule) {
    return Modules.EMPTY_MODULE;
  }

  return new ProviderMethodsModule(object, skipFastClassGeneration, scanner);
}
 
开发者ID:google,项目名称:guice,代码行数:9,代码来源:ProviderMethodsModule.java

示例5: forModule

/**
 * Returns a module which creates bindings for provider methods from the given module.
 */
static Module forModule(Module module) {
  // avoid infinite recursion, since installing a module always installs itself
  if (module instanceof CheckedProviderMethodsModule) {
    return Modules.EMPTY_MODULE;
  }

  return new CheckedProviderMethodsModule(module);
}
 
开发者ID:cgruber,项目名称:guice-old,代码行数:11,代码来源:CheckedProviderMethodsModule.java

示例6: forObject

/**
 * Returns a module which creates bindings for provider methods from the given object.
 * This is useful notably for <a href="http://code.google.com/p/google-gin/">GIN</a>
 */
public static Module forObject(Object object) {
  // avoid infinite recursion, since installing a module always installs itself
  if (object instanceof ProviderMethodsModule) {
    return Modules.EMPTY_MODULE;
  }

  return new ProviderMethodsModule(object);
}
 
开发者ID:cgruber,项目名称:guice-old,代码行数:12,代码来源:ProviderMethodsModule.java

示例7: getRuntimeModule

private static Module getRuntimeModule(String transport, String host, int port, Properties joynrConfig) {
    Module runtimeModule;
    if (transport != null) {
        if (transport.contains("websocket")) {
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_HOST, host);
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PORT, "" + port);
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PROTOCOL, "ws");
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PATH, "");
            runtimeModule = new LibjoynrWebSocketRuntimeModule();
        } else {
            runtimeModule = new CCInProcessRuntimeModule();
        }

        Module backendTransportModules = Modules.EMPTY_MODULE;
        if (transport.contains("http")) {
            backendTransportModules = Modules.combine(backendTransportModules, new AtmosphereMessagingModule());
        }

        if (transport.contains("mqtt")) {
            joynrConfig.put("joynr.messaging.mqtt.brokerUri", "tcp://localhost:1883");
            joynrConfig.put(MessagingPropertyKeys.PROPERTY_MESSAGING_PRIMARYGLOBALTRANSPORT, "mqtt");
            backendTransportModules = Modules.combine(backendTransportModules, new MqttPahoModule());
        }

        return Modules.override(runtimeModule).with(backendTransportModules);
    }

    return Modules.override(new CCInProcessRuntimeModule()).with(new MqttPahoModule());
}
 
开发者ID:bmwcarit,项目名称:joynr,代码行数:29,代码来源:MyRadioConsumerApplication.java

示例8: getRuntimeModule

private static Module getRuntimeModule(String[] args, Properties joynrConfig) {
    Module runtimeModule;
    if (args.length > 1) {
        String transport = args[1].toLowerCase();
        if (transport.contains("websocketcc")) {
            configureWebSocket(joynrConfig);
            runtimeModule = new CCWebSocketRuntimeModule();
        } else if (transport.contains("websocket")) {
            configureWebSocket(joynrConfig);
            runtimeModule = new LibjoynrWebSocketRuntimeModule();
        } else {
            runtimeModule = new CCInProcessRuntimeModule();
        }

        Module backendTransportModules = Modules.EMPTY_MODULE;
        if (transport.contains("http")) {
            LOG.info("Configuring HTTP...");
            backendTransportModules = Modules.combine(backendTransportModules, new AtmosphereMessagingModule());
        }

        if (transport.contains("mqtt")) {
            LOG.info("Configuring MQTT...");
            joynrConfig.put(MessagingPropertyKeys.PROPERTY_MESSAGING_PRIMARYGLOBALTRANSPORT, "mqtt");
            backendTransportModules = Modules.combine(backendTransportModules, new MqttPahoModule());
        }
        return Modules.override(runtimeModule).with(backendTransportModules);
    }
    return Modules.override(new CCInProcessRuntimeModule()).with(new AtmosphereMessagingModule());
}
 
开发者ID:bmwcarit,项目名称:joynr,代码行数:29,代码来源:IltProviderApplication.java

示例9: getRuntimeModule

private static Module getRuntimeModule(Properties joynrConfig) {
    LOG.info("getRuntimeModule: Entering");
    Module runtimeModule;
    String transport = System.getProperty("transport");
    if (transport == null) {
        throw new IllegalArgumentException("property \"transport\" not set");
    }
    LOG.info("getRuntimeModule: transport = " + transport);
    if (transport.contains("websocket")) {
        LOG.info("getRuntimeModule: websocket host = "
                + joynrConfig.getProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_HOST));
        LOG.info("getRuntimeModule: websocket port = "
                + joynrConfig.getProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PORT));
        LOG.info("getRuntimeModule: websocket protocol = "
                + joynrConfig.getProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PROTOCOL));
        LOG.info("getRuntimeModule: websocket path = "
                + joynrConfig.getProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PATH));
        LOG.info("getRuntimeModule: selecting LibjoynrWebSocketRuntimeModule");
        runtimeModule = new LibjoynrWebSocketRuntimeModule();
    } else {
        LOG.info("getRuntimeModule: selecting CCInProcessRuntimeModule");
        runtimeModule = new CCInProcessRuntimeModule();
    }

    Module backendTransportModules = Modules.EMPTY_MODULE;
    if (transport.contains("http")) {
        LOG.info("getRuntimeModule: using AtmosphereMessagingModule");
        backendTransportModules = Modules.combine(backendTransportModules, new AtmosphereMessagingModule());
    }

    if (transport.contains("mqtt")) {
        LOG.info("getRuntimeModule: using MqttPahoModule");
        joynrConfig.put(MessagingPropertyKeys.PROPERTY_MESSAGING_PRIMARYGLOBALTRANSPORT, "mqtt");
        backendTransportModules = Modules.combine(backendTransportModules, new MqttPahoModule());
    }

    LOG.info("getRuntimeModule: Leaving");
    return Modules.override(runtimeModule).with(backendTransportModules);
}
 
开发者ID:bmwcarit,项目名称:joynr,代码行数:39,代码来源:IltConsumerTest.java

示例10: getRuntimeModule

private static Module getRuntimeModule(Properties joynrConfig) {

        Module runtimeModule;
        Module backendTransportModules = Modules.EMPTY_MODULE;

        if (invocationParameters.getRuntimeMode() == RuntimeConfig.WEBSOCKET) {
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_HOST, invocationParameters.getCcHost());
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PORT, invocationParameters.getCcPort());
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PROTOCOL, "ws");
            joynrConfig.setProperty(WebsocketModule.PROPERTY_WEBSOCKET_MESSAGING_PATH, "");
            joynrConfig.setProperty(MessagingPropertyKeys.PERSISTENCE_FILE, STATIC_PERSISTENCE_FILE);

            runtimeModule = new LibjoynrWebSocketRuntimeModule();
        } else {
            runtimeModule = new CCInProcessRuntimeModule();
            if (invocationParameters.getBackendTransportMode() == BackendConfig.MQTT) {
                joynrConfig.put("joynr.messaging.mqtt.brokerUri", invocationParameters.getMqttBrokerUri());
                joynrConfig.put(MessagingPropertyKeys.PROPERTY_MESSAGING_PRIMARYGLOBALTRANSPORT, "mqtt");
                backendTransportModules = Modules.combine(backendTransportModules, new MqttPahoModule());
            } else {
                // HTTP
                backendTransportModules = Modules.combine(backendTransportModules, new AtmosphereMessagingModule());
            }
        }

        return Modules.override(runtimeModule).with(backendTransportModules);
    }
 
开发者ID:bmwcarit,项目名称:joynr,代码行数:27,代码来源:ConsumerApplication.java

示例11: getOverrides

protected Module getOverrides() {
    return Modules.EMPTY_MODULE;
}
 
开发者ID:ardielle,项目名称:ardielle-maven-plugin,代码行数:3,代码来源:RdlTest.java

示例12: newConfigModule

@Override
public Module newConfigModule() {
    return Modules.EMPTY_MODULE;
}
 
开发者ID:vespa-engine,项目名称:vespa,代码行数:4,代码来源:ServerProviderConformanceTestTest.java

示例13: moduleFor

private Module moduleFor(Class<?> spec) {
	InjectWith moduleDef = spec.getAnnotation(InjectWith.class);
	return moduleDef == null ? Modules.EMPTY_MODULE
			: instantiateModule(moduleDef);
}
 
开发者ID:oehme,项目名称:jnario-guice,代码行数:5,代码来源:GuiceSpecCreator.java

示例14: getChildServletModule

/**
 * Subclasses should override with a module that configures the servlets they are testing.
 *
 * @return A module used in the creation of the servlet container's child injector.
 */
protected Module getChildServletModule() {
  return Modules.EMPTY_MODULE;
}
 
开发者ID:PacktPublishing,项目名称:Mastering-Mesos,代码行数:8,代码来源:AbstractJettyTest.java

示例15: asModule

/**
 * Returns a module that, when installed, will scan all modules for methods with the annotations
 * {@literal @}{@link ProvidesIntoMap}, {@literal @}{@link ProvidesIntoSet}, and
 * {@literal @}{@link ProvidesIntoOptional}.
 *
 * <p>This is a convenience method, equivalent to doing {@code
 * binder().scanModulesForAnnotatedMethods(MultibindingsScanner.scanner())}.
 *
 * @deprecated This functionality is now installed by default. All references/installations can be
 *     eliminated.
 */
@Deprecated
public static Module asModule() {
  return Modules.EMPTY_MODULE;
}
 
开发者ID:google,项目名称:guice,代码行数:15,代码来源:MultibindingsScanner.java


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