use of io.joynr.runtime.JoynrInjectorFactory in project joynr by bmwcarit.
the class SubscriptionEnd2EndTest method getRuntime.
@Override
protected JoynrRuntime getRuntime(Properties joynrConfig, Module... modules) {
Module runtimeModule = Modules.override(new CCInProcessRuntimeModule()).with(new AtmosphereMessagingModule());
Module modulesWithRuntime = Modules.override(modules).with(runtimeModule);
DummyJoynrApplication application = (DummyJoynrApplication) new JoynrInjectorFactory(joynrConfig, modulesWithRuntime).createApplication(DummyJoynrApplication.class);
dummyApplications.add(application);
return application.getRuntime();
}
use of io.joynr.runtime.JoynrInjectorFactory 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.JoynrInjectorFactory in project joynr by bmwcarit.
the class ConsumerApplication method createJoynrApplication.
private static JoynrApplication createJoynrApplication() throws Exception {
Properties joynrConfig = createJoynrConfig();
Module runtimeModule = getRuntimeModule(joynrConfig);
Properties appConfig = new Properties();
JoynrInjectorFactory injectorFactory = new JoynrInjectorFactory(joynrConfig, runtimeModule, new StaticDomainAccessControlProvisioningModule());
JoynrApplication joynrApplication = injectorFactory.createApplication(new JoynrApplicationModule(ConsumerApplication.class, appConfig));
return joynrApplication;
}
use of io.joynr.runtime.JoynrInjectorFactory in project joynr by bmwcarit.
the class ProviderApplication method main.
public static void main(String[] args) throws Exception {
if ((args.length != 1 && args.length != 2) || (args.length == 2 && !args[1].equals("runForever"))) {
LOG.error("\n\nUSAGE: java {} <local-domain> [runForever]\n\n NOTE: Providers are registered on the local domain.", ProviderApplication.class.getName());
return;
}
localDomain = args[0];
Properties joynrConfig = new Properties();
Module runtimeModule = getRuntimeModule(args, joynrConfig);
LOG.debug("Using the following runtime module: " + runtimeModule.getClass().getSimpleName());
LOG.debug("Registering provider on domain \"{}\"", localDomain);
joynrConfig.setProperty(MessagingPropertyKeys.PERSISTENCE_FILE, STATIC_PERSISTENCE_FILE);
joynrConfig.setProperty(PROPERTY_JOYNR_DOMAIN_LOCAL, localDomain);
Properties appConfig = new Properties();
// Use injected static provisioning of access control entries to allow access to anyone to this interface
provisionAccessControl(joynrConfig, localDomain);
JoynrApplication joynrApplication = new JoynrInjectorFactory(joynrConfig, runtimeModule, new StaticDomainAccessControlProvisioningModule()).createApplication(new JoynrApplicationModule(ProviderApplication.class, appConfig));
if (args.length == 2) {
runForever = true;
}
joynrApplication.run();
joynrApplication.shutdown();
}
use of io.joynr.runtime.JoynrInjectorFactory in project joynr by bmwcarit.
the class IltProviderApplication method main.
public static void main(String[] args) throws Exception {
if (args.length != 1 && args.length != 2) {
LOG.error("\n\nUSAGE: java {} <local-domain>\n\n NOTE: Providers are registered on the local domain.", IltProviderApplication.class.getName());
return;
}
String localDomain = args[0];
LOG.debug("Registering provider on domain \"{}\"", localDomain);
Properties joynrConfig = new Properties();
Module runtimeModule = getRuntimeModule(args, joynrConfig);
LOG.debug("Using the following runtime module: " + runtimeModule.getClass().getSimpleName());
LOG.debug("Registering provider on domain \"{}\"", localDomain);
joynrConfig.setProperty(MessagingPropertyKeys.PERSISTENCE_FILE, STATIC_PERSISTENCE_FILE);
joynrConfig.setProperty(PROPERTY_JOYNR_DOMAIN_LOCAL, localDomain);
Properties appConfig = new Properties();
// Use injected static provisioning of access control entries to allow access to anyone to this interface
provisionAccessControl(joynrConfig, localDomain);
JoynrApplication joynrApplication = new JoynrInjectorFactory(joynrConfig, runtimeModule, new StaticDomainAccessControlProvisioningModule()).createApplication(new JoynrApplicationModule(IltProviderApplication.class, appConfig));
joynrApplication.run();
joynrApplication.shutdown();
}
Aggregations