Package io.joynr.jeeintegration
Class DefaultJoynrRuntimeFactory
- java.lang.Object
-
- io.joynr.jeeintegration.DefaultJoynrRuntimeFactory
-
- All Implemented Interfaces:
JoynrRuntimeFactory
public class DefaultJoynrRuntimeFactory extends Object implements JoynrRuntimeFactory
Default implementation forJoynrRuntimeFactory, which will use information produced byJoynrPropertiesandJoynrLocalDomain, if available, to configure the joynr runtime and application with.IMPORTANT: This class requires the EE runtime to have been configured with a ManagedScheduledExecutorService resource which has been given the name 'concurrent/joynrMessagingScheduledExecutor'.
-
-
Constructor Summary
Constructors Constructor Description DefaultJoynrRuntimeFactory(javax.enterprise.inject.Instance<Properties> joynrProperties, javax.enterprise.inject.Instance<String> joynrLocalDomain, javax.enterprise.inject.Instance<RawMessagingPreprocessor> rawMessagePreprocessor, javax.enterprise.inject.Instance<MqttClientIdProvider> mqttClientIdProvider, javax.enterprise.inject.spi.BeanManager beanManager, JoynrStatusMetricsReceiver joynrStatusMetrics)Constructor in which the JEE runtime injects the managed resources and the JEE joynr integration specific configuration data (seeJoynrPropertiesandJoynrLocalDomain).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JoynrRuntimecreate(Set<Class<?>> providerInterfaceClasses)Call this method in order to create or obtain an instance of the joynr application this factory provides.com.google.inject.InjectorgetInjector()Provides the guice injector to be used by the joynr runtime factoryStringgetLocalDomain()Provides the name of the local domain with which all providers will be registered.MqttClientIdProvidergetMqttClientIdProvider()RawMessagingPreprocessorgetRawMessagePreprocessor()
-
-
-
Constructor Detail
-
DefaultJoynrRuntimeFactory
@Inject public DefaultJoynrRuntimeFactory(@JoynrProperties javax.enterprise.inject.Instance<Properties> joynrProperties, @JoynrLocalDomain javax.enterprise.inject.Instance<String> joynrLocalDomain, @JoynrRawMessagingPreprocessor javax.enterprise.inject.Instance<RawMessagingPreprocessor> rawMessagePreprocessor, @JoynrMqttClientIdProvider javax.enterprise.inject.Instance<MqttClientIdProvider> mqttClientIdProvider, javax.enterprise.inject.spi.BeanManager beanManager, JoynrStatusMetricsReceiver joynrStatusMetrics)
Constructor in which the JEE runtime injects the managed resources and the JEE joynr integration specific configuration data (seeJoynrPropertiesandJoynrLocalDomain).Note that if the EJB which contains the producer methods implements an interface, then the producer methods also need to be declared in that interface, otherwise CDI won't recognise the method implementations as producers.
- Parameters:
joynrProperties- the joynr properties, if present, byprepareJoynrProperties(Properties)to prepare the properties with which the injector is created.joynrLocalDomain- the joynr local domain name to use for the application.rawMessagePreprocessor- can be optionally provided to intercept incoming messages and inspect or modify themmqttClientIdProvider- can be optionally provided to generate custom mqtt client idbeanManager- bean managerjoynrStatusMetrics- Is passed to POJO joynr and receives metrics about the status of the mqtt connection.
-
-
Method Detail
-
create
public JoynrRuntime create(Set<Class<?>> providerInterfaceClasses)
Description copied from interface:JoynrRuntimeFactoryCall this method in order to create or obtain an instance of the joynr application this factory provides. The returned joynr application should be initialised, but not yet running.- Specified by:
createin interfaceJoynrRuntimeFactory- Parameters:
providerInterfaceClasses- the set of provider interface classes which will be provisioned for the joynr runtime. These are required in order to set up the access control entries during startup.- Returns:
- the instance of the joynr application this factory provides.
-
getInjector
public com.google.inject.Injector getInjector()
Description copied from interface:JoynrRuntimeFactoryProvides the guice injector to be used by the joynr runtime factory- Specified by:
getInjectorin interfaceJoynrRuntimeFactory- Returns:
- the guice intector to be used by the joynr runtime factory
-
getLocalDomain
public String getLocalDomain()
Description copied from interface:JoynrRuntimeFactoryProvides the name of the local domain with which all providers will be registered.- Specified by:
getLocalDomainin interfaceJoynrRuntimeFactory- Returns:
- the local domain name with which providers are registered.
-
getRawMessagePreprocessor
public RawMessagingPreprocessor getRawMessagePreprocessor()
-
getMqttClientIdProvider
public MqttClientIdProvider getMqttClientIdProvider()
-
-