From 00006ce6d59364fe3c379761749213e9a949cc40 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 15 Mar 2016 11:37:38 +0000
Subject: [PATCH] Removed unused types: InvokableComponent interface and InvokableMethod class

---
 /dev/null                                                                       |  372 ---------------------------------
 opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java       |  159 ++------------
 opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java  |   39 ---
 opendj-server-legacy/src/main/java/org/opends/server/types/DirectoryConfig.java |   34 ---
 4 files changed, 24 insertions(+), 580 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/api/InvokableComponent.java b/opendj-server-legacy/src/main/java/org/opends/server/api/InvokableComponent.java
deleted file mode 100644
index 46fdf2d..0000000
--- a/opendj-server-legacy/src/main/java/org/opends/server/api/InvokableComponent.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2015-2016 ForgeRock AS.
- */
-package org.opends.server.api;
-
-
-
-import org.opends.server.config.ConfigAttribute;
-import org.opends.server.types.DirectoryException;
-import org.forgerock.opendj.ldap.DN;
-import org.opends.server.types.InvokableMethod;
-
-
-
-/**
- * This class defines an interface that may be implemented by
- * Directory Server components that have methods that may be invoked
- * either via adding configuration entries (e.g., task plugins) or
- * through JMX.
- */
-@org.opends.server.types.PublicAPI(
-     stability=org.opends.server.types.StabilityLevel.VOLATILE,
-     mayInstantiate=false,
-     mayExtend=true,
-     mayInvoke=false)
-public interface InvokableComponent
-{
-  /**
-   * Retrieves the DN of the configuration entry with which this
-   * component is associated.
-   *
-   * @return  The DN of the configuration entry with which this
-   *          component is associated.
-   */
-  DN getInvokableComponentEntryDN();
-
-
-
-  /**
-   * Retrieves a list of the methods that may be invoked for this
-   * component.
-   *
-   * @return  A list of the methods that may be invoked for this
-   *          component.
-   */
-  InvokableMethod[] getOperationSignatures();
-
-
-
-  /**
-   * Invokes the specified method with the provided arguments.
-   *
-   * @param  methodName  The name of the method to invoke.
-   * @param  arguments   The set of configuration attributes holding
-   *                     the arguments to use for the method.
-   *
-   * @return  The return value for the method, or {@code null} if it
-   *          did not return a value.
-   *
-   * @throws  DirectoryException  If there was no such method, or if
-   *                              an error occurred while attempting
-   *                              to invoke it.
-   */
-  Object invokeMethod(String methodName, ConfigAttribute[] arguments)
-         throws DirectoryException;
-}
-
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java b/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java
index 4450df7..d407297 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java
@@ -40,14 +40,15 @@
 import org.forgerock.i18n.LocalizableMessage;
 import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.forgerock.opendj.ldap.ByteString;
+import org.forgerock.opendj.ldap.DN;
 import org.forgerock.opendj.ldap.ResultCode;
 import org.forgerock.opendj.ldap.SearchScope;
 import org.forgerock.opendj.ldap.schema.AttributeType;
+import org.forgerock.util.Utils;
 import org.opends.server.admin.std.server.MonitorProviderCfg;
 import org.opends.server.api.AlertGenerator;
 import org.opends.server.api.ClientConnection;
 import org.opends.server.api.DirectoryServerMBean;
-import org.opends.server.api.InvokableComponent;
 import org.opends.server.api.MonitorProvider;
 import org.opends.server.core.DirectoryServer;
 import org.opends.server.protocols.internal.InternalClientConnection;
@@ -55,9 +56,7 @@
 import org.opends.server.protocols.internal.SearchRequest;
 import org.opends.server.protocols.jmx.Credential;
 import org.opends.server.protocols.jmx.JmxClientConnection;
-import org.forgerock.opendj.ldap.DN;
 import org.opends.server.types.DirectoryException;
-import org.opends.server.types.InvokableMethod;
 
 import static org.opends.messages.ConfigMessages.*;
 import static org.opends.server.protocols.internal.Requests.*;
@@ -91,9 +90,6 @@
   /** The set of alert generators for this MBean. */
   private List<AlertGenerator> alertGenerators;
 
-  /** The set of invokable components for this MBean. */
-  private List<InvokableComponent> invokableComponents;
-
   /** The set of monitor providers for this MBean. */
   private List<MonitorProvider<? extends MonitorProviderCfg>> monitorProviders;
 
@@ -115,10 +111,9 @@
    */
   public static String getJmxName (DN configEntryDN)
   {
-      String typeStr = null;
-      String nameStr = null ;
       try
       {
+          String typeStr = null;
           String dnString = configEntryDN.toString();
           if (dnString != null && dnString.length() != 0)
           {
@@ -151,13 +146,13 @@
               typeStr = buffer.toString();
           }
 
-          nameStr = MBEAN_BASE_DOMAIN + ":" + "Name=rootDSE" + typeStr;
+          return MBEAN_BASE_DOMAIN + ":" + "Name=rootDSE" + typeStr;
       } catch (Exception e)
       {
         logger.traceException(e);
         logger.error(ERR_CONFIG_JMX_CANNOT_REGISTER_MBEAN, configEntryDN, e);
+        return null;
       }
-      return nameStr ;
   }
 
   /**
@@ -171,7 +166,6 @@
         this.configEntryDN = configEntryDN;
 
         alertGenerators = new CopyOnWriteArrayList<>();
-        invokableComponents = new CopyOnWriteArrayList<>();
         monitorProviders = new CopyOnWriteArrayList<>();
 
         MBeanServer mBeanServer = DirectoryServer.getJMXMBeanServer();
@@ -269,60 +263,6 @@
     }
   }
 
-
-
-  /**
-   * Retrieves the set of invokable components associated with this JMX MBean.
-   *
-   * @return  The set of invokable components associated with this JMX MBean.
-   */
-  public List<InvokableComponent> getInvokableComponents()
-  {
-    return invokableComponents;
-  }
-
-
-
-  /**
-   * Adds the provided invokable component to the set of components associated
-   * with this JMX MBean.
-   *
-   * @param  component  The component to add to the set of invokable components
-   *                    for this JMX MBean.
-   */
-  public void addInvokableComponent(InvokableComponent component)
-  {
-    synchronized (invokableComponents)
-    {
-      if (! invokableComponents.contains(component))
-      {
-        invokableComponents.add(component);
-      }
-    }
-  }
-
-
-
-  /**
-   * Removes the provided invokable component from the set of components
-   * associated with this JMX MBean.
-   *
-   * @param  component  The component to remove from the set of invokable
-   *                    components for this JMX MBean.
-   *
-   * @return  <CODE>true</CODE> if the specified component was successfully
-   *          removed, or <CODE>false</CODE> if not.
-   */
-  public boolean removeInvokableComponent(InvokableComponent component)
-  {
-    synchronized (invokableComponents)
-    {
-      return invokableComponents.remove(component);
-    }
-  }
-
-
-
   /**
    * Retrieves the set of monitor providers associated with this JMX MBean.
    *
@@ -451,20 +391,12 @@
     }
 
     // prepare the ldap search
-
     try
     {
       // Perform the Ldap operation for
       //  - ACI Check
       //  - Loggin purpose
-      SearchRequest request = newSearchRequest(configEntryDN, SearchScope.BASE_OBJECT);
-      InternalSearchOperation op = null;
-      if (clientConnection instanceof JmxClientConnection) {
-        op = ((JmxClientConnection) clientConnection).processSearch(request);
-      }
-      else if (clientConnection instanceof InternalClientConnection) {
-        op = ((InternalClientConnection) clientConnection).processSearch(request);
-      }
+      InternalSearchOperation op = searchMBeanConfigEntry(clientConnection);
       // BUG : op may be null
       ResultCode rc = op.getResultCode();
       if (rc != ResultCode.SUCCESS) {
@@ -530,15 +462,7 @@
     // Perform the Ldap operation for
     //  - ACI Check
     //  - Loggin purpose
-    SearchRequest request = newSearchRequest(configEntryDN, SearchScope.BASE_OBJECT);
-    InternalSearchOperation op = null;
-    if (clientConnection instanceof JmxClientConnection) {
-      op = ((JmxClientConnection) clientConnection).processSearch(request);
-    }
-    else if (clientConnection instanceof InternalClientConnection) {
-      op = ((InternalClientConnection) clientConnection).processSearch(request);
-    }
-
+    InternalSearchOperation op = searchMBeanConfigEntry(clientConnection);
     if (op == null)
     {
       return null;
@@ -577,6 +501,18 @@
     return attrList;
   }
 
+  private InternalSearchOperation searchMBeanConfigEntry(ClientConnection clientConnection)
+  {
+    SearchRequest request = newSearchRequest(configEntryDN, SearchScope.BASE_OBJECT);
+    if (clientConnection instanceof JmxClientConnection) {
+      return ((JmxClientConnection) clientConnection).processSearch(request);
+    }
+    else if (clientConnection instanceof InternalClientConnection) {
+      return ((InternalClientConnection) clientConnection).processSearch(request);
+    }
+    return null;
+  }
+
   /**
    * Sets the values of several attributes of the Dynamic MBean.
    *
@@ -617,49 +553,11 @@
   public Object invoke(String actionName, Object[] params, String[] signature)
          throws MBeanException
   {
-    for (InvokableComponent component : invokableComponents)
-    {
-      for (InvokableMethod method : component.getOperationSignatures())
-      {
-        if (method.hasSignature(actionName, signature))
-        {
-          try
-          {
-            method.invoke(component, params);
-          }
-          catch (MBeanException me)
-          {
-            logger.traceException(me);
-
-            throw me;
-          }
-          catch (Exception e)
-          {
-            logger.traceException(e);
-
-            throw new MBeanException(e);
-          }
-        }
-      }
-    }
-
-
     // If we've gotten here, then there is no such method so throw an exception.
     StringBuilder buffer = new StringBuilder();
     buffer.append(actionName);
     buffer.append("(");
-
-    if (signature.length > 0)
-    {
-      buffer.append(signature[0]);
-
-      for (int i=1; i < signature.length; i++)
-      {
-        buffer.append(", ");
-        buffer.append(signature[i]);
-      }
-    }
-
+    Utils.joinAsString(", ", (Object[]) signature);
     buffer.append(")");
 
     LocalizableMessage message = ERR_CONFIG_JMX_NO_METHOD.get(buffer, configEntryDN);
@@ -711,25 +609,12 @@
       }
     }
 
+    MBeanConstructorInfo[] mBeanConstructors = new MBeanConstructorInfo[0];
+    MBeanOperationInfo[] mBeanOperations = new MBeanOperationInfo[0];
 
     MBeanNotificationInfo[] mBeanNotifications = new MBeanNotificationInfo[notifications.size()];
     notifications.toArray(mBeanNotifications);
 
-
-    List<MBeanOperationInfo> ops = new ArrayList<>();
-    for (InvokableComponent component : invokableComponents)
-    {
-      for (InvokableMethod method : component.getOperationSignatures())
-      {
-        ops.add(method.toOperationInfo());
-      }
-    }
-
-    MBeanOperationInfo[] mBeanOperations = new MBeanOperationInfo[ops.size()];
-    ops.toArray(mBeanOperations);
-
-
-    MBeanConstructorInfo[]  mBeanConstructors  = new MBeanConstructorInfo[0];
     return new MBeanInfo(CLASS_NAME,
                          "Configurable Attributes for " + configEntryDN,
                          mBeanAttributes, mBeanConstructors, mBeanOperations,
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java b/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
index 8d24fd3..589ae27 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
@@ -61,6 +61,7 @@
 import org.forgerock.i18n.LocalizedIllegalArgumentException;
 import org.forgerock.i18n.slf4j.LocalizedLogger;
 import org.forgerock.opendj.config.server.ConfigException;
+import org.forgerock.opendj.ldap.DN;
 import org.forgerock.opendj.ldap.ResultCode;
 import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.forgerock.opendj.ldap.schema.CoreSchema;
@@ -103,7 +104,6 @@
 import org.opends.server.api.IdentityMapper;
 import org.opends.server.api.ImportTaskListener;
 import org.opends.server.api.InitializationCompletedListener;
-import org.opends.server.api.InvokableComponent;
 import org.opends.server.api.KeyManagerProvider;
 import org.opends.server.api.MonitorProvider;
 import org.opends.server.api.PasswordGenerator;
@@ -147,7 +147,6 @@
 import org.opends.server.types.Control;
 import org.opends.server.types.DITContentRule;
 import org.opends.server.types.DITStructureRule;
-import org.forgerock.opendj.ldap.DN;
 import org.opends.server.types.DirectoryEnvironmentConfig;
 import org.opends.server.types.DirectoryException;
 import org.opends.server.types.Entry;
@@ -3022,42 +3021,6 @@
   }
 
   /**
-   * Registers the provided invokable component with the Directory Server.
-   *
-   * @param  component  The invokable component to register.
-   */
-  public static void registerInvokableComponent(InvokableComponent component)
-  {
-    DN componentDN = component.getInvokableComponentEntryDN();
-    JMXMBean mBean = directoryServer.mBeans.get(componentDN);
-    if (mBean == null)
-    {
-      mBean = new JMXMBean(componentDN);
-      mBean.addInvokableComponent(component);
-      directoryServer.mBeans.put(componentDN, mBean);
-    }
-    else
-    {
-      mBean.addInvokableComponent(component);
-    }
-  }
-
-  /**
-   * Deregisters the provided invokable component with the Directory Server.
-   *
-   * @param  component  The invokable component to deregister.
-   */
-  public static void deregisterInvokableComponent(InvokableComponent component)
-  {
-    DN componentDN = component.getInvokableComponentEntryDN();
-    JMXMBean mBean = directoryServer.mBeans.get(componentDN);
-    if (mBean != null)
-    {
-      mBean.removeInvokableComponent(component);
-    }
-  }
-
-  /**
    * Registers the provided alert generator with the Directory Server.
    *
    * @param  alertGenerator  The alert generator to register.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/DirectoryConfig.java b/opendj-server-legacy/src/main/java/org/opends/server/types/DirectoryConfig.java
index 96f88d8..1af407f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/DirectoryConfig.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/DirectoryConfig.java
@@ -16,8 +16,6 @@
  */
 package org.opends.server.types;
 
-import org.forgerock.opendj.ldap.schema.AttributeType;
-
 import java.util.Collection;
 import java.util.List;
 import java.util.Map;
@@ -27,12 +25,12 @@
 import org.forgerock.opendj.config.server.ConfigException;
 import org.forgerock.opendj.ldap.DN;
 import org.forgerock.opendj.ldap.ResultCode;
+import org.forgerock.opendj.ldap.schema.AttributeType;
 import org.forgerock.opendj.ldap.schema.MatchingRule;
 import org.forgerock.opendj.ldap.schema.Syntax;
 import org.opends.server.api.AlertGenerator;
 import org.opends.server.api.ConfigHandler;
 import org.opends.server.api.ExtendedOperationHandler;
-import org.opends.server.api.InvokableComponent;
 import org.opends.server.api.SASLMechanismHandler;
 import org.opends.server.api.ServerShutdownListener;
 import org.opends.server.config.ConfigEntry;
@@ -622,36 +620,6 @@
     return DirectoryServer.getNameForm(lowerName);
   }
 
-
-
-  /**
-   * Registers the provided invokable component with the Directory
-   * Server.
-   *
-   * @param  component  The invokable component to register.
-   */
-  public static void registerInvokableComponent(
-                                InvokableComponent component)
-  {
-    DirectoryServer.registerInvokableComponent(component);
-  }
-
-
-
-  /**
-   * Deregisters the provided invokable component with the Directory
-   * Server.
-   *
-   * @param  component  The invokable component to deregister.
-   */
-  public static void deregisterInvokableComponent(
-                                InvokableComponent component)
-  {
-    DirectoryServer.deregisterInvokableComponent(component);
-  }
-
-
-
   /**
    * Registers the provided alert generator with the Directory Server.
    *
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/InvokableMethod.java b/opendj-server-legacy/src/main/java/org/opends/server/types/InvokableMethod.java
deleted file mode 100644
index 2a62573..0000000
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/InvokableMethod.java
+++ /dev/null
@@ -1,372 +0,0 @@
-/*
- * The contents of this file are subject to the terms of the Common Development and
- * Distribution License (the License). You may not use this file except in compliance with the
- * License.
- *
- * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
- * specific language governing permission and limitations under the License.
- *
- * When distributing Covered Software, include this CDDL Header Notice in each file and include
- * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
- * Header, with the fields enclosed by brackets [] replaced by your own identifying
- * information: "Portions Copyright [year] [name of copyright owner]".
- *
- * Copyright 2006-2008 Sun Microsystems, Inc.
- * Portions Copyright 2014-2015 ForgeRock AS.
- */
-package org.opends.server.types;
-
-import javax.management.Attribute;
-import javax.management.MBeanException;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanParameterInfo;
-
-import org.opends.server.api.InvokableComponent;
-import org.opends.server.config.ConfigAttribute;
-
-import org.forgerock.i18n.slf4j.LocalizedLogger;
-
-
-
-/**
- * This class defines a data structure that holds information about a
- * method that may be invoked for an invokable component.
- */
-@org.opends.server.types.PublicAPI(
-     stability=org.opends.server.types.StabilityLevel.VOLATILE,
-     mayInstantiate=false,
-     mayExtend=false,
-     mayInvoke=true)
-public class InvokableMethod
-{
-  private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
-
-
-
-
-  /**
-   * Indicates whether this method retrieves information about the
-   * associated component.
-   */
-  private boolean retrievesComponentInfo;
-
-  /**
-   * Indicates whether this method updates information about the
-   * associated component.
-   */
-  private boolean updatesComponentInfo;
-
-  /** The set of arguments for this method. */
-  private ConfigAttribute[] arguments;
-
-  /** The description for this method. */
-  private String description;
-
-  /** The name for this method. */
-  private String name;
-
-  /** The return type for this method. */
-  private String returnType;
-
-
-
-  /**
-   * Creates a new invokable method with the provided information.
-   *
-   * @param  name                    The name for this invokable
-   *                                 method.
-   * @param  description             The description for this
-   *                                 invokable method.
-   * @param  arguments               The object types for this
-   *                                 method's arguments.
-   * @param  returnType              The object type for this method's
-   *                                 return value.
-   * @param  retrievesComponentInfo  Indicates whether this method
-   *                                 retrieves information about the
-   *                                 associated component.
-   * @param  updatesComponentInfo    Indicates whether this method
-   *                                 updates information about the
-   *                                 associated component.
-   */
-  public InvokableMethod(String name, String description,
-                         ConfigAttribute[] arguments,
-                         String returnType,
-                         boolean retrievesComponentInfo,
-                         boolean updatesComponentInfo)
-  {
-    this.name                     = name;
-    this.description              = description;
-    this.returnType               = returnType;
-    this.retrievesComponentInfo   = retrievesComponentInfo;
-    this.updatesComponentInfo     = updatesComponentInfo;
-
-    if (arguments == null)
-    {
-      this.arguments = new ConfigAttribute[0];
-    }
-    else
-    {
-      this.arguments = arguments;
-    }
-  }
-
-
-
-  /**
-   * Retrieves the name of this invokable method.
-   *
-   * @return  The name of this invokable method.
-   */
-  public String getName()
-  {
-    return name;
-  }
-
-
-
-  /**
-   * Retrieves a description of this invokable method.
-   *
-   * @return  A description of this invokable method.
-   */
-  public String getDescription()
-  {
-    return description;
-  }
-
-
-
-  /**
-   * Retrieves the set of arguments for this invokable method.
-   *
-   * @return  The set of arguments for this invokable method.
-   */
-  public ConfigAttribute[] getArguments()
-  {
-    return arguments;
-  }
-
-
-
-  /**
-   * Retrieves the return type for this invokable method.
-   *
-   * @return  The return type for this invokable method.
-   */
-  public String getReturnType()
-  {
-    return returnType;
-  }
-
-
-
-  /**
-   * Indicates whether this method retrieves information about the
-   * associated component.
-   *
-   * @return  <CODE>true</CODE> if this method retrieves information
-   *          about the associated component, or <CODE>false</CODE> if
-   *          it does not.
-   */
-  public boolean retrievesComponentInfo()
-  {
-    return retrievesComponentInfo;
-  }
-
-
-
-  /**
-   * Indicates whether this method updates information about the
-   * associated component.
-   *
-   * @return  <CODE>true</CODE> if this method updates information
-   *          about the associated component, or <CODE>false</CODE> if
-   *          it does not.
-   */
-  public boolean updatesComponentInfo()
-  {
-    return updatesComponentInfo;
-  }
-
-
-
-  /**
-   * Retrieves an <CODE>MBeanOperationInfo</CODE> object that
-   * encapsulates the information in this invokable method.
-   *
-   * @return  An <CODE>MBeanOperationInfo</CODE> object that
-   *          encapsulates the information in this invokable method.
-   */
-  public MBeanOperationInfo toOperationInfo()
-  {
-    MBeanParameterInfo[] signature =
-         new MBeanParameterInfo[arguments.length];
-    for (int i=0; i < arguments.length; i++)
-    {
-      signature[i] = arguments[i].toJMXParameterInfo();
-    }
-
-
-    int impact;
-    if (retrievesComponentInfo)
-    {
-      if (updatesComponentInfo)
-      {
-        impact = MBeanOperationInfo.ACTION_INFO;
-      }
-      else
-      {
-        impact = MBeanOperationInfo.INFO;
-      }
-    }
-    else if (updatesComponentInfo)
-    {
-      impact = MBeanOperationInfo.ACTION;
-    }
-    else
-    {
-      impact = MBeanOperationInfo.UNKNOWN;
-    }
-
-
-    return new MBeanOperationInfo(name, description, signature,
-                                  returnType, impact);
-
-  }
-
-
-
-  /**
-   * Indicates whether this invokable method has the provided
-   * signature.
-   *
-   * @param  methodName     The method name to use in the
-   *                        determination.
-   * @param  argumentTypes  The argument object types to use in the
-   *                        determination.
-   *
-   * @return  <CODE>true</CODE> if this invokable method has the
-   *          provided signature, or <CODE>false</CODE> if not.
-   */
-  public boolean hasSignature(String methodName,
-                              String[] argumentTypes)
-  {
-    if (! methodName.equals(name))
-    {
-      return false;
-    }
-
-    if (argumentTypes.length != arguments.length)
-    {
-      return false;
-    }
-
-    for (int i=0; i < arguments.length; i++)
-    {
-      MBeanParameterInfo paramInfo =
-           arguments[i].toJMXParameterInfo();
-      if (! argumentTypes[i].equals(paramInfo.getType()))
-      {
-        return false;
-      }
-    }
-
-    return true;
-  }
-
-
-
-  /**
-   * Calls upon the provided component to invoke this method using the
-   * given parameters.
-   *
-   * @param  component      The component to use to invoke this
-   *                        method.
-   * @param  parameters     The set of method arguments to use when
-   *                        invoking this method.
-   *
-   * @return  The return value resulting from invoking the method, or
-   *          <CODE>null</CODE> if it did not return a value.
-   *
-   * @throws  MBeanException  If a problem occurred while invoking the
-   *                          method.
-   */
-  public Object invoke(InvokableComponent component,
-                       Object[] parameters)
-         throws MBeanException
-  {
-    try
-    {
-      ConfigAttribute[] methodArguments =
-           new ConfigAttribute[arguments.length];
-      for (int i=0; i < arguments.length; i++)
-      {
-        Attribute jmxAttr = new Attribute(arguments[i].getName(),
-                                          parameters[i]);
-
-        methodArguments[i] = arguments[i].duplicate();
-        methodArguments[i].setValue(jmxAttr);
-      }
-
-      return component.invokeMethod(name, methodArguments);
-    }
-    catch (DirectoryException de)
-    {
-      logger.traceException(de);
-
-      throw new MBeanException(de, de.getMessage());
-    }
-    catch (Exception e)
-    {
-      logger.traceException(e);
-
-      throw new MBeanException(e);
-    }
-  }
-
-
-
-  /**
-   * Retrieves a string representation of this invokable method.  It
-   * will be in the form of a method signature, like "returnType
-   * name(arguments)".
-   *
-   * @return  a string representation of this invokable method.
-   */
-  public String toString()
-  {
-    StringBuilder buffer = new StringBuilder();
-
-    if (returnType == null)
-    {
-      buffer.append("void ");
-    }
-    else
-    {
-      buffer.append(returnType);
-    }
-
-    buffer.append(name);
-    buffer.append('(');
-
-    if (arguments != null && arguments.length > 0)
-    {
-      buffer.append(arguments[0].getDataType());
-      buffer.append(' ');
-      buffer.append(arguments[0].getName());
-
-      for (int i=1; i < arguments.length; i++)
-      {
-        buffer.append(", ");
-        buffer.append(arguments[i].getDataType());
-        buffer.append(' ');
-        buffer.append(arguments[i].getName());
-      }
-    }
-
-    buffer.append(')');
-
-    return buffer.toString();
-  }
-}
-

--
Gitblit v1.10.0