Class DefaultJoynrRuntimeFactory

  • All Implemented Interfaces:
    JoynrRuntimeFactory

    public class DefaultJoynrRuntimeFactory
    extends Object
    implements JoynrRuntimeFactory
    Default implementation for JoynrRuntimeFactory, which will use information produced by JoynrProperties and JoynrLocalDomain, 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 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 (see JoynrProperties and JoynrLocalDomain ).

        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, by prepareJoynrProperties(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 them
        mqttClientIdProvider - can be optionally provided to generate custom mqtt client id
        beanManager - bean manager
        joynrStatusMetrics - 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: JoynrRuntimeFactory
        Call 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:
        create in interface JoynrRuntimeFactory
        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: JoynrRuntimeFactory
        Provides the guice injector to be used by the joynr runtime factory
        Specified by:
        getInjector in interface JoynrRuntimeFactory
        Returns:
        the guice intector to be used by the joynr runtime factory
      • getLocalDomain

        public String getLocalDomain()
        Description copied from interface: JoynrRuntimeFactory
        Provides the name of the local domain with which all providers will be registered.
        Specified by:
        getLocalDomain in interface JoynrRuntimeFactory
        Returns:
        the local domain name with which providers are registered.