Search in sources :

Example 6 with JoynrRuntime

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

the class JeeJoynrServiceLocatorTest method testGetNoProxyAvailable.

@Test(expected = IllegalArgumentException.class)
public void testGetNoProxyAvailable() {
    JoynrRuntime joynrRuntime = mock(JoynrRuntime.class);
    JoynrIntegrationBean joynrIntegrationBean = mock(JoynrIntegrationBean.class);
    when(joynrIntegrationBean.getRuntime()).thenReturn(joynrRuntime);
    JeeJoynrServiceLocator subject = new JeeJoynrServiceLocator(joynrIntegrationBean);
    subject.get(MyInvalidServiceSync.class, "local");
}
Also used : JoynrRuntime(io.joynr.runtime.JoynrRuntime) JeeJoynrServiceLocator(io.joynr.jeeintegration.JeeJoynrServiceLocator) JoynrIntegrationBean(io.joynr.jeeintegration.JoynrIntegrationBean) Test(org.junit.Test)

Example 7 with JoynrRuntime

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

the class DefaultJoynrRuntimeFactory method create.

@Override
public JoynrRuntime create(Set<Class<?>> providerInterfaceClasses) {
    LOG.info("Creating clusterable participant IDs for discovered providers.");
    createClusterableParticipantIds(providerInterfaceClasses);
    LOG.info("Provisioning access control for {}", providerInterfaceClasses);
    provisionAccessControl(joynrProperties, joynrLocalDomain, getProviderInterfaceNames(providerInterfaceClasses));
    LOG.info(format("Creating application with joynr properties:%n%s", joynrProperties));
    JoynrRuntime runtime = getInjector().getInstance(JoynrRuntime.class);
    LOG.info("Created runtime: {}", runtime);
    return runtime;
}
Also used : JoynrRuntime(io.joynr.runtime.JoynrRuntime)

Example 8 with JoynrRuntime

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

the class InitRuntimeTask method doInBackground.

@Override
protected JoynrRuntime doInBackground(Object... params) {
    try {
        Log.d("JAS", "starting joynr runtime");
        publishProgress("Starting joynr runtime...\n");
        // create/make persistence file absolute
        File appWorkingDir = applicationContext.getFilesDir();
        String persistenceFileName = appWorkingDir.getPath() + File.separator + joynrConfig.getProperty(MessagingPropertyKeys.PERSISTENCE_FILE, MessagingPropertyKeys.DEFAULT_PERSISTENCE_FILE);
        joynrConfig.setProperty(MessagingPropertyKeys.PERSISTENCE_FILE, persistenceFileName);
        // create/make participant ID persistence file absolute
        String participantIdPersistenceFileName = appWorkingDir.getPath() + File.separator + joynrConfig.getProperty(ConfigurableMessagingSettings.PROPERTY_PARTICIPANTIDS_PERSISISTENCE_FILE, ConfigurableMessagingSettings.DEFAULT_PARTICIPANTIDS_PERSISTENCE_FILE);
        joynrConfig.setProperty(ConfigurableMessagingSettings.PROPERTY_PARTICIPANTIDS_PERSISISTENCE_FILE, participantIdPersistenceFileName);
        publishProgress("Properties loaded\n");
        // Create an injector with all the required custom modules.
        // CCInProcessRuntimeModule is used by default but can be overwritten by custom modules
        Module combinedModules = Modules.override(new LibjoynrWebSocketRuntimeModule()).with(modules);
        Injector injectorA = new JoynrInjectorFactory(joynrConfig, combinedModules).createChildInjector();
        JoynrRuntime runtime = injectorA.getInstance(JoynrRuntime.class);
        if (runtime != null) {
            Log.d("JAS", "joynr runtime started");
        } else {
            Log.e("JAS", "joynr runtime not started");
        }
        publishProgress("joynr runtime started.\n");
        return runtime;
    } catch (Exception e) {
        Log.e("JAS", "joynr runtime not started", e);
        publishProgress(e.getMessage());
    }
    return null;
}
Also used : LibjoynrWebSocketRuntimeModule(io.joynr.runtime.LibjoynrWebSocketRuntimeModule) JoynrRuntime(io.joynr.runtime.JoynrRuntime) Injector(com.google.inject.Injector) Module(com.google.inject.Module) LibjoynrWebSocketRuntimeModule(io.joynr.runtime.LibjoynrWebSocketRuntimeModule) File(java.io.File) JoynrInjectorFactory(io.joynr.runtime.JoynrInjectorFactory)

Example 9 with JoynrRuntime

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

the class JoynrAndroidRuntime method shutdown.

@Override
public void shutdown(boolean clear) {
    JoynrRuntime runtime = getJoynrRuntime();
    runtime.shutdown(clear);
}
Also used : JoynrRuntime(io.joynr.runtime.JoynrRuntime)

Aggregations

JoynrRuntime (io.joynr.runtime.JoynrRuntime)9 Test (org.junit.Test)4 Properties (java.util.Properties)3 MyServiceSync (joynr.jeeintegration.servicelocator.MyServiceSync)2 Injector (com.google.inject.Injector)1 Module (com.google.inject.Module)1 DiscoveryQos (io.joynr.arbitration.DiscoveryQos)1 JeeJoynrServiceLocator (io.joynr.jeeintegration.JeeJoynrServiceLocator)1 JoynrIntegrationBean (io.joynr.jeeintegration.JoynrIntegrationBean)1 MessagingQos (io.joynr.messaging.MessagingQos)1 JoynrInjectorFactory (io.joynr.runtime.JoynrInjectorFactory)1 LibjoynrWebSocketRuntimeModule (io.joynr.runtime.LibjoynrWebSocketRuntimeModule)1 File (java.io.File)1 DefaulttestProvider (joynr.tests.DefaulttestProvider)1 joynr.tests.testProxy (joynr.tests.testProxy)1 After (org.junit.After)1