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());
}
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);
}
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);
}
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);
}
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());
}
Aggregations