org.opends.server.types
Class InvokableMethod

java.lang.Object
  extended by org.opends.server.types.InvokableMethod

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=false,
           mayInvoke=true)
public class InvokableMethod
extends java.lang.Object

This class defines a data structure that holds information about a method that may be invoked for an invokable component.


Constructor Summary
InvokableMethod(java.lang.String name, java.lang.String description, ConfigAttribute[] arguments, java.lang.String returnType, boolean retrievesComponentInfo, boolean updatesComponentInfo)
          Creates a new invokable method with the provided information.
 
Method Summary
 ConfigAttribute[] getArguments()
          Retrieves the set of arguments for this invokable method.
 java.lang.String getDescription()
          Retrieves a description of this invokable method.
 java.lang.String getName()
          Retrieves the name of this invokable method.
 java.lang.String getReturnType()
          Retrieves the return type for this invokable method.
 boolean hasSignature(java.lang.String methodName, java.lang.String[] argumentTypes)
          Indicates whether this invokable method has the provided signature.
 java.lang.Object invoke(InvokableComponent component, java.lang.Object[] parameters)
          Calls upon the provided component to invoke this method using the given parameters.
 boolean retrievesComponentInfo()
          Indicates whether this method retrieves information about the associated component.
 javax.management.MBeanOperationInfo toOperationInfo()
          Retrieves an MBeanOperationInfo object that encapsulates the information in this invokable method.
 java.lang.String toString()
          Retrieves a string representation of this invokable method.
 boolean updatesComponentInfo()
          Indicates whether this method updates information about the associated component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvokableMethod

public InvokableMethod(java.lang.String name,
                       java.lang.String description,
                       ConfigAttribute[] arguments,
                       java.lang.String returnType,
                       boolean retrievesComponentInfo,
                       boolean updatesComponentInfo)
Creates a new invokable method with the provided information.

Parameters:
name - The name for this invokable method.
description - The description for this invokable method.
arguments - The object types for this method's arguments.
returnType - The object type for this method's return value.
retrievesComponentInfo - Indicates whether this method retrieves information about the associated component.
updatesComponentInfo - Indicates whether this method updates information about the associated component.
Method Detail

getName

public java.lang.String getName()
Retrieves the name of this invokable method.

Returns:
The name of this invokable method.

getDescription

public java.lang.String getDescription()
Retrieves a description of this invokable method.

Returns:
A description of this invokable method.

getArguments

public ConfigAttribute[] getArguments()
Retrieves the set of arguments for this invokable method.

Returns:
The set of arguments for this invokable method.

getReturnType

public java.lang.String getReturnType()
Retrieves the return type for this invokable method.

Returns:
The return type for this invokable method.

retrievesComponentInfo

public boolean retrievesComponentInfo()
Indicates whether this method retrieves information about the associated component.

Returns:
true if this method retrieves information about the associated component, or false if it does not.

updatesComponentInfo

public boolean updatesComponentInfo()
Indicates whether this method updates information about the associated component.

Returns:
true if this method updates information about the associated component, or false if it does not.

toOperationInfo

public javax.management.MBeanOperationInfo toOperationInfo()
Retrieves an MBeanOperationInfo object that encapsulates the information in this invokable method.

Returns:
An MBeanOperationInfo object that encapsulates the information in this invokable method.

hasSignature

public boolean hasSignature(java.lang.String methodName,
                            java.lang.String[] argumentTypes)
Indicates whether this invokable method has the provided signature.

Parameters:
methodName - The method name to use in the determination.
argumentTypes - The argument object types to use in the determination.
Returns:
true if this invokable method has the provided signature, or false if not.

invoke

public java.lang.Object invoke(InvokableComponent component,
                               java.lang.Object[] parameters)
                        throws javax.management.MBeanException
Calls upon the provided component to invoke this method using the given parameters.

Parameters:
component - The component to use to invoke this method.
parameters - The set of method arguments to use when invoking this method.
Returns:
The return value resulting from invoking the method, or null if it did not return a value.
Throws:
javax.management.MBeanException - If a problem occurred while invoking the method.

toString

public java.lang.String toString()
Retrieves a string representation of this invokable method. It will be in the form of a method signature, like "returnType name(arguments)".

Overrides:
toString in class java.lang.Object
Returns:
a string representation of this invokable method.