當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。