Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Added SingleThreadedExecutors to data store instance."
[controller.git]
/
opendaylight
/
md-sal
/
sal-binding-broker
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
binding
/
impl
/
RpcProviderRegistryImpl.java
diff --git
a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java
b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java
index e0c7d260b5309c2242045821a1d827ae8931c6f1..952d84d885c41e73fe2312bf22c723f62cc44b35 100644
(file)
--- a/
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java
+++ b/
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java
@@
-7,6
+7,15
@@
*/
package org.opendaylight.controller.sal.binding.impl;
*/
package org.opendaylight.controller.sal.binding.impl;
+import static com.google.common.base.Preconditions.checkState;
+
+import java.util.EventListener;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.WeakHashMap;
+
import org.opendaylight.controller.md.sal.common.api.routing.RouteChange;
import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher;
import org.opendaylight.controller.md.sal.common.api.routing.RouteChange;
import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher;
@@
-28,15
+37,6
@@
import org.opendaylight.yangtools.yang.binding.RpcService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.EventListener;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.WeakHashMap;
-
-import static com.google.common.base.Preconditions.checkState;
-
public class RpcProviderRegistryImpl implements //
RpcProviderRegistry, //
RouteChangePublisher<RpcContextIdentifier, InstanceIdentifier<?>> {
public class RpcProviderRegistryImpl implements //
RpcProviderRegistry, //
RouteChangePublisher<RpcContextIdentifier, InstanceIdentifier<?>> {
@@
-60,19
+60,19
@@
public class RpcProviderRegistryImpl implements //
return name;
}
return name;
}
- public RpcProviderRegistryImpl(String name) {
+ public RpcProviderRegistryImpl(
final
String name) {
super();
this.name = name;
}
@Override
super();
this.name = name;
}
@Override
- public final <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(Class<T> type,
- T implementation) throws IllegalStateException {
+ public final <T extends RpcService> RoutedRpcRegistration<T> addRoutedRpcImplementation(
final
Class<T> type,
+
final
T implementation) throws IllegalStateException {
return getRpcRouter(type).addRoutedRpcImplementation(implementation);
}
@Override
return getRpcRouter(type).addRoutedRpcImplementation(implementation);
}
@Override
- public final <T extends RpcService> RpcRegistration<T> addRpcImplementation(
Class<T> type,
T implementation)
+ public final <T extends RpcService> RpcRegistration<T> addRpcImplementation(
final Class<T> type, final
T implementation)
throws IllegalStateException {
@SuppressWarnings("unchecked")
RpcRouter<T> potentialRouter = (RpcRouter<T>) rpcRouters.get(type);
throws IllegalStateException {
@SuppressWarnings("unchecked")
RpcRouter<T> potentialRouter = (RpcRouter<T>) rpcRouters.get(type);
@@
-92,7
+92,7
@@
public class RpcProviderRegistryImpl implements //
@SuppressWarnings("unchecked")
@Override
@SuppressWarnings("unchecked")
@Override
- public final <T extends RpcService> T getRpcService(Class<T> type) {
+ public final <T extends RpcService> T getRpcService(
final
Class<T> type) {
T potentialProxy = (T) publicProxies.get(type);
if (potentialProxy != null) {
T potentialProxy = (T) publicProxies.get(type);
if (potentialProxy != null) {
@@
-115,8
+115,8
@@
public class RpcProviderRegistryImpl implements //
}
}
}
}
- @SuppressWarnings(
"unchecked"
)
- public <T extends RpcService> RpcRouter<T> getRpcRouter(Class<T> type) {
+ @SuppressWarnings(
{ "unchecked", "rawtypes" }
)
+ public <T extends RpcService> RpcRouter<T> getRpcRouter(
final
Class<T> type) {
RpcRouter<?> potentialRouter = rpcRouters.get(type);
if (potentialRouter != null) {
return (RpcRouter<T>) potentialRouter;
RpcRouter<?> potentialRouter = rpcRouters.get(type);
if (potentialRouter != null) {
return (RpcRouter<T>) potentialRouter;
@@
-140,7
+140,7
@@
public class RpcProviderRegistryImpl implements //
}
}
}
}
- private void notifyGlobalRpcAdded(Class<? extends RpcService> type) {
+ private void notifyGlobalRpcAdded(
final
Class<? extends RpcService> type) {
for(ListenerRegistration<GlobalRpcRegistrationListener> listener : globalRpcListeners) {
try {
listener.getInstance().onGlobalRpcRegistered(type);
for(ListenerRegistration<GlobalRpcRegistrationListener> listener : globalRpcListeners) {
try {
listener.getInstance().onGlobalRpcRegistered(type);
@@
-151,7
+151,7
@@
public class RpcProviderRegistryImpl implements //
}
}
- private void notifyListenersRoutedCreated(RpcRouter<?> router) {
+ private void notifyListenersRoutedCreated(
final
RpcRouter<?> router) {
for (ListenerRegistration<RouterInstantiationListener> listener : routerInstantiationListener) {
try {
for (ListenerRegistration<RouterInstantiationListener> listener : routerInstantiationListener) {
try {
@@
-164,7
+164,7
@@
public class RpcProviderRegistryImpl implements //
}
public ListenerRegistration<RouterInstantiationListener> registerRouterInstantiationListener(
}
public ListenerRegistration<RouterInstantiationListener> registerRouterInstantiationListener(
- RouterInstantiationListener listener) {
+
final
RouterInstantiationListener listener) {
ListenerRegistration<RouterInstantiationListener> reg = routerInstantiationListener.register(listener);
try {
for (RpcRouter<?> router : rpcRouters.values()) {
ListenerRegistration<RouterInstantiationListener> reg = routerInstantiationListener.register(listener);
try {
for (RpcRouter<?> router : rpcRouters.values()) {
@@
-176,9
+176,10
@@
public class RpcProviderRegistryImpl implements //
return reg;
}
return reg;
}
+ @SuppressWarnings("unchecked")
@Override
public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(
@Override
public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(
- L listener) {
+
final
L listener) {
return (ListenerRegistration<L>) routeChangeListeners.register(listener);
}
return (ListenerRegistration<L>) routeChangeListeners.register(listener);
}
@@
-186,7
+187,7
@@
public class RpcProviderRegistryImpl implements //
return rpcFactory;
}
return rpcFactory;
}
- public void setRpcFactory(RuntimeCodeGenerator rpcFactory) {
+ public void setRpcFactory(
final
RuntimeCodeGenerator rpcFactory) {
this.rpcFactory = rpcFactory;
}
this.rpcFactory = rpcFactory;
}
@@
-194,7
+195,7
@@
public class RpcProviderRegistryImpl implements //
void onRpcRouterCreated(RpcRouter<?> router);
}
void onRpcRouterCreated(RpcRouter<?> router);
}
- public ListenerRegistration<GlobalRpcRegistrationListener> registerGlobalRpcRegistrationListener(GlobalRpcRegistrationListener listener) {
+ public ListenerRegistration<GlobalRpcRegistrationListener> registerGlobalRpcRegistrationListener(
final
GlobalRpcRegistrationListener listener) {
return globalRpcListeners.register(listener);
}
return globalRpcListeners.register(listener);
}
@@
-209,12
+210,12
@@
public class RpcProviderRegistryImpl implements //
private final Class<T> type;
private final Class<T> type;
- public RouteChangeForwarder(Class<T> type) {
+ public RouteChangeForwarder(
final
Class<T> type) {
this.type = type;
}
@Override
this.type = type;
}
@Override
- public void onRouteChange(RouteChange<Class<? extends BaseIdentity>, InstanceIdentifier<?>> change) {
+ public void onRouteChange(
final
RouteChange<Class<? extends BaseIdentity>, InstanceIdentifier<?>> change) {
Map<RpcContextIdentifier, Set<InstanceIdentifier<?>>> announcements = new HashMap<>();
for (Entry<Class<? extends BaseIdentity>, Set<InstanceIdentifier<?>>> entry : change.getAnnouncements()
.entrySet()) {
Map<RpcContextIdentifier, Set<InstanceIdentifier<?>>> announcements = new HashMap<>();
for (Entry<Class<? extends BaseIdentity>, Set<InstanceIdentifier<?>>> entry : change.getAnnouncements()
.entrySet()) {
@@
-245,9
+246,10
@@
public class RpcProviderRegistryImpl implements //
private final Class<T> serviceType;
private RpcProviderRegistryImpl registry;
private final Class<T> serviceType;
private RpcProviderRegistryImpl registry;
- public RpcProxyRegistration(
Class<T> type, T service,
RpcProviderRegistryImpl registry) {
+ public RpcProxyRegistration(
final Class<T> type, final T service, final
RpcProviderRegistryImpl registry) {
super(service);
super(service);
- serviceType = type;
+ this.serviceType = type;
+ this.registry = registry;
}
@Override
}
@Override