Search in sources :

Example 6 with JoynrApplication

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

the class ConsumerApplication method main.

public static void main(String[] args) {
    try {
        invocationParameters = new ConsumerInvocationParameters(args);
        JoynrApplication consumerApp = createJoynrApplication();
        consumerApp.run();
        consumerApp.shutdown();
    } catch (Exception exception) {
        System.err.println(exception.getMessage());
        System.exit(-1);
    }
}
Also used : JoynrApplication(io.joynr.runtime.JoynrApplication) AbstractJoynrApplication(io.joynr.runtime.AbstractJoynrApplication)

Example 7 with JoynrApplication

use of io.joynr.runtime.JoynrApplication 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 8 with JoynrApplication

use of io.joynr.runtime.JoynrApplication 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)

Example 9 with JoynrApplication

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

the class EchoProviderApplication method createJoynrApplication.

private static JoynrApplication createJoynrApplication() throws Exception {
    Module runtimeModule = Modules.override(getRuntimeModule()).with(getBackendModule());
    Properties joynrConfig = createJoynrConfig();
    Properties appConfig = createAppConfig();
    JoynrInjectorFactory injectorFactory = new JoynrInjectorFactory(joynrConfig, runtimeModule, new StaticDomainAccessControlProvisioningModule());
    JoynrApplication joynrApplication = injectorFactory.createApplication(new JoynrApplicationModule(EchoProviderApplication.class, appConfig));
    return joynrApplication;
}
Also used : Module(com.google.inject.Module) MqttPahoModule(io.joynr.messaging.mqtt.paho.client.MqttPahoModule) CCInProcessRuntimeModule(io.joynr.runtime.CCInProcessRuntimeModule) JoynrApplicationModule(io.joynr.runtime.JoynrApplicationModule) StaticDomainAccessControlProvisioningModule(io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule) Properties(java.util.Properties) 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 10 with JoynrApplication

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

the class EchoProviderApplication method main.

public static void main(String[] args) {
    try {
        invocationParams = new EchoProviderInvocationParameters(args);
        JoynrApplication joynrApplication = createJoynrApplication();
        joynrApplication.run();
        joynrApplication.shutdown();
    } catch (Exception exception) {
        System.err.println(exception.getMessage());
        System.exit(-1);
    }
}
Also used : JoynrRuntimeException(io.joynr.exceptions.JoynrRuntimeException) JoynrApplication(io.joynr.runtime.JoynrApplication) AbstractJoynrApplication(io.joynr.runtime.AbstractJoynrApplication)

Aggregations

JoynrApplication (io.joynr.runtime.JoynrApplication)15 AbstractJoynrApplication (io.joynr.runtime.AbstractJoynrApplication)13 JoynrApplicationModule (io.joynr.runtime.JoynrApplicationModule)11 JoynrInjectorFactory (io.joynr.runtime.JoynrInjectorFactory)11 Properties (java.util.Properties)9 Module (com.google.inject.Module)8 CCInProcessRuntimeModule (io.joynr.runtime.CCInProcessRuntimeModule)8 WebsocketModule (io.joynr.messaging.websocket.WebsocketModule)7 LibjoynrWebSocketRuntimeModule (io.joynr.runtime.LibjoynrWebSocketRuntimeModule)7 StaticDomainAccessControlProvisioningModule (io.joynr.accesscontrol.StaticDomainAccessControlProvisioningModule)6 AtmosphereMessagingModule (io.joynr.messaging.AtmosphereMessagingModule)6 MqttPahoModule (io.joynr.messaging.mqtt.paho.client.MqttPahoModule)5 CCWebSocketRuntimeModule (io.joynr.runtime.CCWebSocketRuntimeModule)2 CommandLine (org.apache.commons.cli.CommandLine)2 CommandLineParser (org.apache.commons.cli.CommandLineParser)2 DefaultParser (org.apache.commons.cli.DefaultParser)2 HelpFormatter (org.apache.commons.cli.HelpFormatter)2 Options (org.apache.commons.cli.Options)2 ParseException (org.apache.commons.cli.ParseException)2 DiscoveryScope (io.joynr.arbitration.DiscoveryScope)1