/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* This class defines a data structure that holds information about a
* method that may be invoked for an invokable component.
*/
mayInstantiate=false,
mayExtend=false,
mayInvoke=true)
public class InvokableMethod
{
/**
* 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. */
/** The description for this method. */
/** The name for this method. */
/** The return type for this method. */
/**
* 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.
*/
boolean retrievesComponentInfo,
boolean updatesComponentInfo)
{
this.description = description;
this.returnType = returnType;
{
}
else
{
}
}
/**
* Retrieves the name of this invokable method.
*
* @return The name of this invokable method.
*/
{
return name;
}
/**
* Retrieves a description of this invokable method.
*
* @return A description of this invokable method.
*/
{
return description;
}
/**
* Retrieves the set of arguments for this invokable method.
*
* @return The set of arguments for this invokable method.
*/
{
return arguments;
}
/**
* Retrieves the return type for this invokable method.
*
* @return The return type for this invokable method.
*/
{
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.
*/
{
{
}
int impact;
{
if (updatesComponentInfo)
{
}
else
{
}
}
else if (updatesComponentInfo)
{
}
else
{
}
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.
*/
{
{
return false;
}
{
return false;
}
{
arguments[i].toJMXParameterInfo();
{
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.
*/
Object[] parameters)
throws MBeanException
{
try
{
{
parameters[i]);
}
}
catch (DirectoryException de)
{
}
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.
*/
{
if (returnType == null)
{
}
else
{
}
{
{
}
}
}
}