public class ProviderWrapper extends Object implements InvocationHandler
ServiceProvider and has a valid
service interface specified (that is it extends JoynrProvider). When the bean is discovered in
JoynrIntegrationBean.initialise() an instance of this class is registered as the provider with the joynr
runtime. When joynr wants to call a method of the specified service interface, then this instance will obtain a
reference to the bean via the JoynrIntegrationBean.beanManager and will delegate to the corresponding method
on that bean (i.e. with the same name and parameters). The result is then wrapped in a deferred / promise and
returned.| Constructor and Description |
|---|
ProviderWrapper(javax.enterprise.inject.spi.Bean<?> bean,
javax.enterprise.inject.spi.BeanManager beanManager,
com.google.inject.Injector injector)
Initialises the instance with the service interface which will be exposed and the bean reference it is meant to
wrap.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
invoke(Object proxy,
Method method,
Object[] args)
When a method is invoked via a joynr call, then it is delegated to an instance of the bean with which this
instance was initialised, if the method is part of the business interface and to this instance if it was part of
the
JoynrProvider interface or the Object class. |
public ProviderWrapper(javax.enterprise.inject.spi.Bean<?> bean,
javax.enterprise.inject.spi.BeanManager beanManager,
com.google.inject.Injector injector)
bean - the bean reference to which calls will be delegated.beanManager - the bean manager.injector - the Guice injector.public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
JoynrProvider interface or the Object class.invoke in interface InvocationHandlerproxy - the proxy object on which the method was called.method - the specific method which was called.args - the arguments with which the method was called.ThrowableCopyright © 2019. All rights reserved.