import org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.UpdateRemoteEndpoints;
import org.opendaylight.controller.remote.rpc.registry.gossip.Bucket;
import org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreActor;
+import org.opendaylight.controller.remote.rpc.registry.mbeans.RemoteRpcRegistryMXBeanImpl;
/**
* Registry to look up cluster nodes that have registered for a given RPC.
*/
public class RpcRegistry extends BucketStoreActor<RoutingTable> {
private final ActorRef rpcRegistrar;
+ private final RemoteRpcRegistryMXBeanImpl mxBean;
public RpcRegistry(final RemoteRpcProviderConfig config, final ActorRef rpcInvoker, final ActorRef rpcRegistrar) {
super(config, config.getRpcRegistryPersistenceId(), new RoutingTable(rpcInvoker, ImmutableSet.of()));
this.rpcRegistrar = Preconditions.checkNotNull(rpcRegistrar);
+ this.mxBean = new RemoteRpcRegistryMXBeanImpl(this);
}
/**
return Props.create(RpcRegistry.class, config, rpcInvoker, rpcRegistrar);
}
+ @Override
+ public void postStop() {
+ super.postStop();
+ this.mxBean.unregister();
+ }
+
@Override
protected void handleCommand(final Object message) throws Exception {
if (message instanceof AddOrUpdateRoutes) {