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 a2b171aec0e12f40e82cca30cf9877e5b661ae05..7cac1060ba6357fd1cdd4e8bc26d4d9bf7118b52 100644 (file)
@@ -38,12 +38,6 @@ public interface DependencyResolver {
             Class<? extends AbstractServiceInterface> expectedServiceInterface,
             ObjectName objectName, JmxAttribute jmxAttribute);
 
             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.
      *
     /**
      * 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);
 
     <T> T resolveInstance(Class<T> expectedType, ObjectName objectName,
             JmxAttribute jmxAttribute);
 
-    @Deprecated
-    <T> T resolveInstance(Class<T> expectedType, ObjectName objectName);
-
 }
 }
index 87b2e1f752525e5cce27a0b883f8e247a8987e3a..b355a5e365e77614785b4de2b136e923b54de23b 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}
      */
     /**
      * {@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();
     @Override
     public int compareTo(DependencyResolverImpl o) {
         transactionStatus.checkCommitted();
index 3eaa9b1c7dfbba9416d50d35c4a9bcd50f4ae1be..0b84d905dfff907b82b88d287d5d70c94bdc43a0 100644 (file)
@@ -117,16 +117,6 @@ public abstract class AbstractConfigTest extends
                 .size());
     }
 
                 .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 {
     protected ObjectName createTestConfigBean(
             ConfigTransactionJMXClient transaction, String implementationName,
             String name) throws InstanceAlreadyExistsException {
index de283fec034bc9e596a2a958b1249ad5fd7db52c..81ba49e1aaad9ac6ef53d82404cfe8f9b481f027 100644 (file)
@@ -17,6 +17,7 @@ import javax.annotation.concurrent.NotThreadSafe;
 import javax.management.ObjectName;
 
 import org.opendaylight.controller.config.api.DependencyResolver;
 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;
 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();
     }
 
         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,
     @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,
 
         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()),
             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
     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
 
             if (oldInstance != null) {
                 // changing thread pool is not supported