- public static RemoteRpcProvider createInstance(
- final Broker broker, final BundleContext bundleContext, final RemoteRpcProviderConfig config){
-
- RemoteRpcProvider rpcProvider =
- new RemoteRpcProvider(createActorSystem(bundleContext, config), (RpcProvisionRegistry) broker);
-
- broker.registerProvider(rpcProvider);
- return rpcProvider;
- }
-
- private static ActorSystem createActorSystem(BundleContext bundleContext, RemoteRpcProviderConfig config){
-
- // Create an OSGi bundle classloader for actor system
- BundleDelegatingClassLoader classLoader =
- new BundleDelegatingClassLoader(bundleContext.getBundle(),
- Thread.currentThread().getContextClassLoader());
-
- Config actorSystemConfig = config.get();
- if(LOG.isDebugEnabled()) {
- LOG.debug("Actor system configuration\n{}", actorSystemConfig.root().render());
- }
- if (config.isMetricCaptureEnabled()) {
- LOG.info("Instrumentation is enabled in actor system {}. Metrics can be viewed in JMX console.",
- config.getActorSystemName());
- }
-
- return ActorSystem.create(config.getActorSystemName(), actorSystemConfig, classLoader);