Remove deprecated methods from config-api. 51/2051/2
authorTomas Olvecky <tolvecky@cisco.com>
Mon, 21 Oct 2013 14:43:59 +0000 (16:43 +0200)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 21 Oct 2013 15:16:42 +0000 (15:16 +0000)
Remove methods that were supporting users before code generation was in place.

Change-Id: I6bb2106c98d7f4a1c0bcaa23bb7c565e93243fe2
Signed-off-by: Tomas Olvecky <tolvecky@cisco.com>
opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/DependencyResolver.java
opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/dependencyresolver/DependencyResolverImpl.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/impl/AbstractConfigTest.java
opendaylight/config/config-manager/src/test/java/org/opendaylight/controller/config/manager/testingservices/parallelapsp/TestingParallelAPSPModule.java

index a2b171a..7cac106 100644 (file)
@@ -38,12 +38,6 @@ public interface DependencyResolver {
             Class<? extends AbstractServiceInterface> expectedServiceInterface,
             ObjectName objectName, JmxAttribute jmxAttribute);
 
-    @Deprecated
-    // TODO remove once all config code is generated
-    void validateDependency(
-            Class<? extends AbstractServiceInterface> expectedServiceInterface,
-            ObjectName objectName, String attributeNameForErrorReporting);
-
     /**
      * To be used during commit phase to wire actual dependencies.
      *
@@ -54,7 +48,4 @@ public interface DependencyResolver {
     <T> T resolveInstance(Class<T> expectedType, ObjectName objectName,
             JmxAttribute jmxAttribute);
 
-    @Deprecated
-    <T> T resolveInstance(Class<T> expectedType, ObjectName objectName);
-
 }
index 87b2e1f..b355a5e 100644 (file)
@@ -105,14 +105,6 @@ final class DependencyResolverImpl implements DependencyResolver,
         }
     }
 
-    @Override
-    public void validateDependency(
-            Class<? extends AbstractServiceInterface> expectedServiceInterface,
-            ObjectName objectName, String attributeNameForErrorReporting) {
-        validateDependency(expectedServiceInterface, objectName,
-                new JmxAttribute(attributeNameForErrorReporting));
-    }
-
     /**
      * {@inheritDoc}
      */
@@ -155,13 +147,6 @@ final class DependencyResolverImpl implements DependencyResolver,
         }
     }
 
-    @Deprecated
-    @Override
-    public <T> T resolveInstance(Class<T> expectedType, ObjectName objectName) {
-        return resolveInstance(expectedType, objectName, new JmxAttribute(
-                "unknown attribute"));
-    }
-
     @Override
     public int compareTo(DependencyResolverImpl o) {
         transactionStatus.checkCommitted();
index 3eaa9b1..0b84d90 100644 (file)
@@ -117,16 +117,6 @@ public abstract class AbstractConfigTest extends
                 .size());
     }
 
-    @Deprecated
-    protected ObjectName createTestConfigBean(
-            ConfigTransactionJMXClient transaction, String implementationName,
-            String name, Class<?> clz) throws InstanceAlreadyExistsException {
-        ObjectName nameCreated = transaction.createModule(implementationName,
-                name);
-        transaction.newMXBeanProxy(nameCreated, clz);
-        return nameCreated;
-    }
-
     protected ObjectName createTestConfigBean(
             ConfigTransactionJMXClient transaction, String implementationName,
             String name) throws InstanceAlreadyExistsException {
index de283fe..81ba49e 100644 (file)
@@ -17,6 +17,7 @@ import javax.annotation.concurrent.NotThreadSafe;
 import javax.management.ObjectName;
 
 import org.opendaylight.controller.config.api.DependencyResolver;
+import org.opendaylight.controller.config.api.JmxAttribute;
 import org.opendaylight.controller.config.api.ModuleIdentifier;
 import org.opendaylight.controller.config.api.annotations.RequireInterface;
 import org.opendaylight.controller.config.manager.testingservices.seviceinterface.TestingThreadPoolServiceInterface;
@@ -87,19 +88,22 @@ public class TestingParallelAPSPModule implements Module,
         return instance.getMaxNumberOfThreads();
     }
 
+    // this would be generated:
+    private final JmxAttribute threadPoolONJMXAttribute = new JmxAttribute("threadPoolON");
+
     @Override
     public void validate() {
         checkNotNull(threadPoolON, "Parameter 'threadPool' must be set");
         dependencyResolver.validateDependency(
                 TestingThreadPoolServiceInterface.class, threadPoolON,
-                "threadPoolON");
+                threadPoolONJMXAttribute);
 
         checkState(Strings.isNullOrEmpty(someParam) == false,
                 "Parameter 'SomeParam' is blank");
         // check that calling resolveInstance fails
         try {
             dependencyResolver.resolveInstance(TestingThreadPoolIfc.class,
-                    threadPoolON);
+                    threadPoolON, threadPoolONJMXAttribute);
             throw new RuntimeException("fail");
         } catch (IllegalStateException e) {
             checkState("Commit was not triggered".equals(e.getMessage()),
@@ -111,7 +115,7 @@ public class TestingParallelAPSPModule implements Module,
     public Closeable getInstance() {
         if (instance == null) {
             TestingThreadPoolIfc threadPoolInstance = dependencyResolver
-                    .resolveInstance(TestingThreadPoolIfc.class, threadPoolON);
+                    .resolveInstance(TestingThreadPoolIfc.class, threadPoolON, threadPoolONJMXAttribute);
 
             if (oldInstance != null) {
                 // changing thread pool is not supported