Updated ZeroMQ implementation
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / sal / dom / broker / ProviderContextImpl.xtend
index 3fdd7065770dac618a2fa5cc15ebeb1c37cb110a..bffc5705962b3fd7f2ad790a11214dee8166cbc7 100644 (file)
@@ -27,75 +27,74 @@ class ProviderContextImpl extends ConsumerContextImpl implements ProviderSession
     }
 
     override addRpcImplementation(QName rpcType, RpcImplementation implementation) throws IllegalArgumentException {
-        if(rpcType == null) {
+        if (rpcType == null) {
             throw new IllegalArgumentException("rpcType must not be null");
         }
-        if(implementation == null) {
+        if (implementation == null) {
             throw new IllegalArgumentException("Implementation must not be null");
         }
         broker.addRpcImplementation(rpcType, implementation);
         rpcImpls.put(rpcType, implementation);
-        
+
         return new RpcRegistrationImpl(rpcType, implementation, this);
     }
 
     def removeRpcImplementation(RpcRegistrationImpl implToRemove) throws IllegalArgumentException {
         val localImpl = rpcImpls.get(implToRemove.type);
-        if(localImpl !== implToRemove.instance) {
-            throw new IllegalStateException(
-                "Implementation was not registered in this session");
+        if (localImpl !== implToRemove.instance) {
+            throw new IllegalStateException("Implementation was not registered in this session");
         }
-        broker.removeRpcImplementation(implToRemove.type,localImpl);
+        broker.removeRpcImplementation(implToRemove.type, localImpl);
         rpcImpls.remove(implToRemove.type);
     }
-    
+
     override close() {
-               removeAllRpcImlementations
-       super.close
+        removeAllRpcImlementations
+        super.close
     }
-    
+
     private def removeAllRpcImlementations() {
-       if (!rpcImpls.empty) {
-               for (entry : rpcImpls.entrySet) {
-                       broker.removeRpcImplementation(entry.key,entry.value);
-               }
-               rpcImpls.clear
-       }
+        if (!rpcImpls.empty) {
+            for (entry : rpcImpls.entrySet) {
+                broker.removeRpcImplementation(entry.key, entry.value);
+            }
+            rpcImpls.clear
+        }
     }
-    
+
     override addMountedRpcImplementation(QName rpcType, RpcImplementation implementation) {
         throw new UnsupportedOperationException("TODO: auto-generated method stub")
     }
-    
+
     override addRoutedRpcImplementation(QName rpcType, RpcImplementation implementation) {
         throw new UnsupportedOperationException("TODO: auto-generated method stub")
     }
-    
+
     override getSupportedRpcs() {
         broker.getSupportedRpcs();
     }
-    
+
     override addRpcRegistrationListener(RpcRegistrationListener listener) {
         broker.addRpcRegistrationListener(listener);
     }
 }
 
 class RpcRegistrationImpl extends AbstractObjectRegistration<RpcImplementation> implements RpcRegistration {
-       
-       @Property
-       val QName type
-       
-       private var ProviderContextImpl context
-       
-       new(QName type, RpcImplementation instance, ProviderContextImpl ctx) {
-               super(instance)
-               _type = type
-               context = ctx
-       }
-       
-       override protected removeRegistration() {
-               context.removeRpcImplementation(this)
-               context = null  
-       }
+
+    @Property
+    val QName type
+
+    private var ProviderContextImpl context
+
+    new(QName type, RpcImplementation instance, ProviderContextImpl ctx) {
+        super(instance)
+        _type = type
+        context = ctx
+    }
+
+    override protected removeRegistration() {
+        context.removeRpcImplementation(this)
+        context = null
+    }
 
 }