Search in sources :

Example 1 with CCWebSocketRuntimeModule

use of io.joynr.runtime.CCWebSocketRuntimeModule in project joynr by bmwcarit.

the class MyRadioProviderApplication method 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());
}
Also used : LibjoynrWebSocketRuntimeModule(io.joynr.runtime.LibjoynrWebSocketRuntimeModule) MqttPahoModule(io.joynr.messaging.mqtt.paho.client.MqttPahoModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) CCWebSocketRuntimeModule(io.joynr.runtime.CCWebSocketRuntimeModule) Module(com.google.inject.Module) CCWebSocketRuntimeModule(io.joynr.runtime.CCWebSocketRuntimeModule) LibjoynrWebSocketRuntimeModule(io.joynr.runtime.LibjoynrWebSocketRuntimeModule) StaticDomainAccessControlProvisioningModule(io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule) AtmosphereMessagingModule(io.joynr.messaging.AtmosphereMessagingModule) MqttPahoModule(io.joynr.messaging.mqtt.paho.client.MqttPahoModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) JoynrApplicationModule(io.joynr.runtime.JoynrApplicationModule) WebsocketModule(io.joynr.messaging.websocket.WebsocketModule) AtmosphereMessagingModule(io.joynr.messaging.AtmosphereMessagingModule)

Example 2 with CCWebSocketRuntimeModule

use of io.joynr.runtime.CCWebSocketRuntimeModule in project joynr by bmwcarit.

the class ProviderProxyEnd2EndTest method createClusterController.

private ClusterControllerRuntime createClusterController(Properties webSocketConfig) {
    Properties ccConfig = new Properties();
    ccConfig.putAll(webSocketConfig);
    ccConfig.setProperty(ConfigurableMessagingSettings.PROPERTY_CC_CONNECTION_TYPE, "WEBSOCKET");
    Injector injectorCC = new JoynrInjectorFactory(ccConfig, new CCWebSocketRuntimeModule()).getInjector();
    return (ClusterControllerRuntime) injectorCC.getInstance(JoynrRuntime.class);
}
Also used : JoynrRuntime(io.joynr.runtime.JoynrRuntime) ClusterControllerRuntime(io.joynr.runtime.ClusterControllerRuntime) Injector(com.google.inject.Injector) CCWebSocketRuntimeModule(io.joynr.runtime.CCWebSocketRuntimeModule) Properties(java.util.Properties) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory)

Example 3 with CCWebSocketRuntimeModule

use of io.joynr.runtime.CCWebSocketRuntimeModule in project joynr by bmwcarit.

the class SubscriptionEnd2EndTest method createClusterController.

private ClusterControllerRuntime createClusterController(Properties webSocketConfig) {
    Properties ccConfig = new Properties();
    ccConfig.putAll(webSocketConfig);
    ccConfig.setProperty(ConfigurableMessagingSettings.PROPERTY_CC_CONNECTION_TYPE, "WEBSOCKET");
    Injector injectorCC = new JoynrInjectorFactory(ccConfig, new CCWebSocketRuntimeModule()).getInjector();
    return (ClusterControllerRuntime) injectorCC.getInstance(JoynrRuntime.class);
}
Also used : JoynrRuntime(io.joynr.runtime.JoynrRuntime) ClusterControllerRuntime(io.joynr.runtime.ClusterControllerRuntime) Injector(com.google.inject.Injector) CCWebSocketRuntimeModule(io.joynr.runtime.CCWebSocketRuntimeModule) Properties(java.util.Properties) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory)

Example 4 with CCWebSocketRuntimeModule

use of io.joynr.runtime.CCWebSocketRuntimeModule in project joynr by bmwcarit.

the class WebSocketProviderProxyEnd2EndTest method createClusterController.

private JoynrRuntime createClusterController(Properties webSocketConfig) {
    Properties ccConfig = new Properties();
    ccConfig.putAll(webSocketConfig);
    ccConfig.putAll(baseTestConfig);
    ccConfig.setProperty(ConfigurableMessagingSettings.PROPERTY_CC_CONNECTION_TYPE, "WEBSOCKET");
    injectorCC = new JoynrInjectorFactory(ccConfig, Modules.override(new CCWebSocketRuntimeModule()).with(new MqttPahoModule(), new AbstractModule() {

        @Override
        protected void configure() {
            bind(Boolean.class).annotatedWith(Names.named(WebSocketMessagingSkeleton.WEBSOCKET_IS_MAIN_TRANSPORT)).toInstance(Boolean.TRUE);
        }
    })).getInjector();
    return injectorCC.getInstance(JoynrRuntime.class);
}
Also used : MqttPahoModule(io.joynr.messaging.mqtt.paho.client.MqttPahoModule) CCWebSocketRuntimeModule(io.joynr.runtime.CCWebSocketRuntimeModule) Properties(java.util.Properties) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory) AbstractModule(com.google.inject.AbstractModule)

Example 5 with CCWebSocketRuntimeModule

use of io.joynr.runtime.CCWebSocketRuntimeModule in project joynr by bmwcarit.

the class IltProviderApplication method 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());
}
Also used : LibjoynrWebSocketRuntimeModule(io.joynr.runtime.LibjoynrWebSocketRuntimeModule) MqttPahoModule(io.joynr.messaging.mqtt.paho.client.MqttPahoModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) CCWebSocketRuntimeModule(io.joynr.runtime.CCWebSocketRuntimeModule) Module(com.google.inject.Module) CCWebSocketRuntimeModule(io.joynr.runtime.CCWebSocketRuntimeModule) LibjoynrWebSocketRuntimeModule(io.joynr.runtime.LibjoynrWebSocketRuntimeModule) StaticDomainAccessControlProvisioningModule(io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule) AtmosphereMessagingModule(io.joynr.messaging.AtmosphereMessagingModule) MqttPahoModule(io.joynr.messaging.mqtt.paho.client.MqttPahoModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) JoynrApplicationModule(io.joynr.runtime.JoynrApplicationModule) WebsocketModule(io.joynr.messaging.websocket.WebsocketModule) AtmosphereMessagingModule(io.joynr.messaging.AtmosphereMessagingModule)

Aggregations

CCWebSocketRuntimeModule (io.joynr.runtime.CCWebSocketRuntimeModule)6 JoynrInjectorFactory (io.joynr.runtime.JoynrInjectorFactory)4 Properties (java.util.Properties)4 Injector (com.google.inject.Injector)3 MqttPahoModule (io.joynr.messaging.mqtt.paho.client.MqttPahoModule)3 ClusterControllerRuntime (io.joynr.runtime.ClusterControllerRuntime)3 JoynrRuntime (io.joynr.runtime.JoynrRuntime)3 Module (com.google.inject.Module)2 StaticDomainAccessControlProvisioningModule (io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule)2 AtmosphereMessagingModule (io.joynr.messaging.AtmosphereMessagingModule)2 WebsocketModule (io.joynr.messaging.websocket.WebsocketModule)2 CCInProcessRuntimeModule (io.joynr.runtime.CCInProcessRuntimeModule)2 JoynrApplicationModule (io.joynr.runtime.JoynrApplicationModule)2 LibjoynrWebSocketRuntimeModule (io.joynr.runtime.LibjoynrWebSocketRuntimeModule)2 AbstractModule (com.google.inject.AbstractModule)1