Search in sources :

Example 11 with JoynrInjectorFactory

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();
}
Also used : DummyJoynrApplication(io.joynr.integration.util.DummyJoynrApplication) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) Module(com.google.inject.Module) AtmosphereMessagingModule(io.joynr.messaging.AtmosphereMessagingModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) AtmosphereMessagingModule(io.joynr.messaging.AtmosphereMessagingModule) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory)

Example 12 with JoynrInjectorFactory

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);
}
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 13 with JoynrInjectorFactory

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;
}
Also used : Properties(java.util.Properties) Module(com.google.inject.Module) 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) StaticDomainAccessControlProvisioningModule(io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule) JoynrApplicationModule(io.joynr.runtime.JoynrApplicationModule) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory) JoynrApplication(io.joynr.runtime.JoynrApplication) AbstractJoynrApplication(io.joynr.runtime.AbstractJoynrApplication)

Example 14 with JoynrInjectorFactory

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();
}
Also used : Properties(java.util.Properties) Module(com.google.inject.Module) LibjoynrWebSocketRuntimeModule(io.joynr.runtime.LibjoynrWebSocketRuntimeModule) JoynrApplicationModule(io.joynr.runtime.JoynrApplicationModule) StaticDomainAccessControlProvisioningModule(io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule) WebsocketModule(io.joynr.messaging.websocket.WebsocketModule) StaticDomainAccessControlProvisioningModule(io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule) JoynrApplicationModule(io.joynr.runtime.JoynrApplicationModule) JoynrApplication(io.joynr.runtime.JoynrApplication) AbstractJoynrApplication(io.joynr.runtime.AbstractJoynrApplication) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory)

Example 15 with JoynrInjectorFactory

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();
}
Also used : Properties(java.util.Properties) 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) StaticDomainAccessControlProvisioningModule(io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule) JoynrApplicationModule(io.joynr.runtime.JoynrApplicationModule) JoynrApplication(io.joynr.runtime.JoynrApplication) AbstractJoynrApplication(io.joynr.runtime.AbstractJoynrApplication) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory)

Aggregations

JoynrInjectorFactory (io.joynr.runtime.JoynrInjectorFactory)31 Module (com.google.inject.Module)22 CCInProcessRuntimeModule (io.joynr.runtime.CCInProcessRuntimeModule)21 Properties (java.util.Properties)20 MqttPahoModule (io.joynr.messaging.mqtt.paho.client.MqttPahoModule)11 AbstractJoynrApplication (io.joynr.runtime.AbstractJoynrApplication)11 JoynrApplication (io.joynr.runtime.JoynrApplication)11 JoynrApplicationModule (io.joynr.runtime.JoynrApplicationModule)11 DummyJoynrApplication (io.joynr.integration.util.DummyJoynrApplication)10 AtmosphereMessagingModule (io.joynr.messaging.AtmosphereMessagingModule)10 LibjoynrWebSocketRuntimeModule (io.joynr.runtime.LibjoynrWebSocketRuntimeModule)10 WebsocketModule (io.joynr.messaging.websocket.WebsocketModule)9 AbstractModule (com.google.inject.AbstractModule)7 StaticDomainAccessControlProvisioningModule (io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule)7 CCWebSocketRuntimeModule (io.joynr.runtime.CCWebSocketRuntimeModule)7 Injector (com.google.inject.Injector)5 TestGlobalAddressModule (io.joynr.messaging.routing.TestGlobalAddressModule)5 JoynrRuntime (io.joynr.runtime.JoynrRuntime)5 MqttModule (io.joynr.messaging.mqtt.MqttModule)3 ClusterControllerRuntime (io.joynr.runtime.ClusterControllerRuntime)3