X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2Fregistry%2FRpcRegistry.java;h=1dcc4e140595250a0414eba706eada3e776f4ece;hb=1b37a887301c6b9159ddb76492c4a3a820c0dfe8;hp=845c1c819a70ca6bac0fb1a717b31f7861b6a6b6;hpb=71c540b3572415aef56acd4a31b503f24e9da437;p=controller.git diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java index 845c1c819a..1dcc4e1405 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/registry/RpcRegistry.java @@ -8,8 +8,8 @@ package org.opendaylight.controller.remote.rpc.registry; import akka.actor.ActorRef; -import akka.event.Logging; -import akka.event.LoggingAdapter; +import akka.actor.Props; +import akka.japi.Creator; import akka.japi.Option; import akka.japi.Pair; import com.google.common.base.Preconditions; @@ -21,6 +21,8 @@ import org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.Remo import org.opendaylight.controller.remote.rpc.registry.RpcRegistry.Messages.SetLocalRouter; import org.opendaylight.controller.remote.rpc.registry.gossip.Bucket; import org.opendaylight.controller.remote.rpc.registry.gossip.BucketStore; +import org.opendaylight.controller.remote.rpc.registry.mbeans.RemoteRpcRegistryMXBean; +import org.opendaylight.controller.remote.rpc.registry.mbeans.RemoteRpcRegistryMXBeanImpl; import org.opendaylight.controller.sal.connector.api.RpcRouter; import org.opendaylight.controller.sal.connector.api.RpcRouter.RouteIdentifier; @@ -32,12 +34,14 @@ import org.opendaylight.controller.sal.connector.api.RpcRouter.RouteIdentifier; */ public class RpcRegistry extends BucketStore { - final LoggingAdapter log = Logging.getLogger(getContext().system(), this); - public RpcRegistry() { getLocalBucket().setData(new RoutingTable()); } + public static Props props() { + return Props.create(new RpcRegistryCreator()); + } + @Override protected void handleReceive(Object message) throws Exception { //TODO: if sender is remote, reject message @@ -224,4 +228,15 @@ public class RpcRegistry extends BucketStore { } } } + + private static class RpcRegistryCreator implements Creator { + private static final long serialVersionUID = 1L; + + @Override + public RpcRegistry create() throws Exception { + RpcRegistry registry = new RpcRegistry(); + RemoteRpcRegistryMXBean mxBean = new RemoteRpcRegistryMXBeanImpl(registry); + return registry; + } + } }