-public class RemoteRpcProvider implements AutoCloseable, Provider{
-
- private static final Logger LOG = LoggerFactory.getLogger(RemoteRpcProvider.class);
-
- private final ActorSystem actorSystem;
- private ActorRef rpcBroker;
- private ActorRef rpcRegistry;
- private final RpcProvisionRegistry rpcProvisionRegistry;
- private Broker.ProviderSession brokerSession;
- private RpcListener rpcListener;
- private RoutedRpcListener routeChangeListener;
- private RemoteRpcImplementation rpcImplementation;
- public RemoteRpcProvider(ActorSystem actorSystem, RpcProvisionRegistry rpcProvisionRegistry) {
- this.actorSystem = actorSystem;
- this.rpcProvisionRegistry = rpcProvisionRegistry;
- }
-
- @Override
- public void close() throws Exception {
- this.actorSystem.shutdown();
- unregisterSupportedRpcs();
- unregisterSupportedRoutedRpcs();
- }
-
- @Override
- public void onSessionInitiated(Broker.ProviderSession session) {
- this.brokerSession = session;
- start();
- }