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