/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* Per-MBean-interface behavior. A single instance of this class can be shared
* by all MBeans of the same kind (Standard MBean or MXBean) that have the same
* MBean interface.
*
* @since 1.6
*/
final class PerInterface<M> {
this.mbeanInterface = mbeanInterface;
this.introspector = introspector;
}
return mbeanInterface;
}
return mbeanInfo;
}
boolean isMXBean() {
return introspector.isMXBean();
}
throws AttributeNotFoundException,
else
throw new AttributeNotFoundException(msg);
}
}
throws AttributeNotFoundException,
else
throw new AttributeNotFoundException(msg);
}
}
throws MBeanException, ReflectionException {
cookie);
}
break;
}
}
} else {
"this signature: " + badSig;
}
cookie);
}
}
/*
* This method is called when invoke doesn't find the named method.
* Before throwing an exception, we check to see whether the
* jmx.invoke.getters property is set, and if so whether the method
* being invoked might be a getter or a setter. If so we invoke it
* and return the result. This is for compatibility
* with code based on JMX RI 1.0 or 1.1 which allowed invoking getters
* and setters. It is *not* recommended that new code use this feature.
*
* Since this method is either going to throw an exception or use
* functionality that is strongly discouraged, we consider that its
* performance is not very important.
*
* A simpler way to implement the functionality would be to add the getters
* and setters to the operations map when jmx.invoke.getters is set.
* However, that means that the property is consulted when an MBean
* interface is being introspected and not thereafter. Previously,
* the property was consulted on every invocation. So this simpler
* implementation could potentially break code that sets and unsets
* the property at different times.
*/
throws MBeanException, ReflectionException {
// Construct the exception that we will probably throw
final NoSuchMethodException nsme =
final ReflectionException exception =
if (introspector.isMXBean())
throw exception; // No compatibility requirement here
// Is the compatibility property set?
try {
} catch (Exception e) {
// We don't expect an exception here but if we get one then
// we'll simply assume that the property is not set.
}
if (invokeGettersS == null)
throw exception;
int rest = 0;
rest = 3;
rest = 2;
if (rest != 0)
rest = 3;
}
if (rest != 0) {
}
}
}
throw exception;
}
if (b.length() > 1)
b.append(", ");
b.append(s);
}
}
}
/**
* Visitor that sets up the method maps (operations, getters, setters).
*/
M getter,
M setter) {
}
}
}
M operation) {
else {
}
}
}
private class MethodAndSig {
M method;
}
}