@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2012 the original author or authors .
* Copyright 2002 - 2014 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -107,7 +107,7 @@ public class MBeanClientInterceptor
@@ -107,7 +107,7 @@ public class MBeanClientInterceptor
private boolean useStrictCasing = true ;
private Class managementInterface ;
private Class < ? > managementInterface ;
private ClassLoader beanClassLoader = ClassUtils . getDefaultClassLoader ( ) ;
@ -215,7 +215,7 @@ public class MBeanClientInterceptor
@@ -215,7 +215,7 @@ public class MBeanClientInterceptor
* setters and getters for MBean attributes and conventional Java methods
* for MBean operations .
* /
public void setManagementInterface ( Class managementInterface ) {
public void setManagementInterface ( Class < ? > managementInterface ) {
this . managementInterface = managementInterface ;
}
@ -223,7 +223,7 @@ public class MBeanClientInterceptor
@@ -223,7 +223,7 @@ public class MBeanClientInterceptor
* Return the management interface of the target MBean ,
* or { @code null } if none specified .
* /
protected final Class getManagementInterface ( ) {
protected final Class < ? > getManagementInterface ( ) {
return this . managementInterface ;
}
@ -262,7 +262,7 @@ public class MBeanClientInterceptor
@@ -262,7 +262,7 @@ public class MBeanClientInterceptor
this . invocationHandler = null ;
if ( this . useStrictCasing ) {
// Use the JDK's own MBeanServerInvocationHandler,
// in particular for native MXBean support on Java 6.
// in particular for native MXBean support on Java 6+ .
if ( JmxUtils . isMXBeanSupportAvailable ( ) ) {
this . invocationHandler =
new MBeanServerInvocationHandler ( this . serverToUse , this . objectName ,
@ -297,7 +297,7 @@ public class MBeanClientInterceptor
@@ -297,7 +297,7 @@ public class MBeanClientInterceptor
MBeanOperationInfo [ ] operationInfo = info . getOperations ( ) ;
this . allowedOperations = new HashMap < MethodCacheKey , MBeanOperationInfo > ( operationInfo . length ) ;
for ( MBeanOperationInfo infoEle : operationInfo ) {
Class [ ] paramTypes = JmxUtils . parameterInfoToTypes ( infoEle . getSignature ( ) , this . beanClassLoader ) ;
Class < ? > [ ] paramTypes = JmxUtils . parameterInfoToTypes ( infoEle . getSignature ( ) , this . beanClassLoader ) ;
this . allowedOperations . put ( new MethodCacheKey ( infoEle . getName ( ) , paramTypes ) , infoEle ) ;
}
}
@ -531,7 +531,7 @@ public class MBeanClientInterceptor
@@ -531,7 +531,7 @@ public class MBeanClientInterceptor
* is necessary
* /
protected Object convertResultValueIfNecessary ( Object result , MethodParameter parameter ) {
Class targetClass = parameter . getParameterType ( ) ;
Class < ? > targetClass = parameter . getParameterType ( ) ;
try {
if ( result = = null ) {
return null ;
@ -549,7 +549,7 @@ public class MBeanClientInterceptor
@@ -549,7 +549,7 @@ public class MBeanClientInterceptor
return convertDataArrayToTargetArray ( array , targetClass ) ;
}
else if ( Collection . class . isAssignableFrom ( targetClass ) ) {
Class elementType = GenericCollectionTypeResolver . getCollectionParameterType ( parameter ) ;
Class < ? > elementType = GenericCollectionTypeResolver . getCollectionParameterType ( parameter ) ;
if ( elementType ! = null ) {
return convertDataArrayToTargetCollection ( array , targetClass , elementType ) ;
}
@ -565,7 +565,7 @@ public class MBeanClientInterceptor
@@ -565,7 +565,7 @@ public class MBeanClientInterceptor
return convertDataArrayToTargetArray ( array , targetClass ) ;
}
else if ( Collection . class . isAssignableFrom ( targetClass ) ) {
Class elementType = GenericCollectionTypeResolver . getCollectionParameterType ( parameter ) ;
Class < ? > elementType = GenericCollectionTypeResolver . getCollectionParameterType ( parameter ) ;
if ( elementType ! = null ) {
return convertDataArrayToTargetCollection ( array , targetClass , elementType ) ;
}
@ -581,8 +581,8 @@ public class MBeanClientInterceptor
@@ -581,8 +581,8 @@ public class MBeanClientInterceptor
}
}
private Object convertDataArrayToTargetArray ( Object [ ] array , Class targetClass ) throws NoSuchMethodException {
Class targetType = targetClass . getComponentType ( ) ;
private Object convertDataArrayToTargetArray ( Object [ ] array , Class < ? > targetClass ) throws NoSuchMethodException {
Class < ? > targetType = targetClass . getComponentType ( ) ;
Method fromMethod = targetType . getMethod ( "from" , array . getClass ( ) . getComponentType ( ) ) ;
Object resultArray = Array . newInstance ( targetType , array . length ) ;
for ( int i = 0 ; i < array . length ; i + + ) {
@ -592,11 +592,11 @@ public class MBeanClientInterceptor
@@ -592,11 +592,11 @@ public class MBeanClientInterceptor
}
@SuppressWarnings ( "unchecked" )
private Collection convertDataArrayToTargetCollection ( Object [ ] array , Class collectionType , Class elementType )
private Collection < ? > convertDataArrayToTargetCollection ( Object [ ] array , Class < ? > collectionType , Class < ? > elementType )
throws NoSuchMethodException {
Method fromMethod = elementType . getMethod ( "from" , array . getClass ( ) . getComponentType ( ) ) ;
Collection resultColl = CollectionFactory . createCollection ( collectionType , Array . getLength ( array ) ) ;
Collection < Object > resultColl = CollectionFactory . createCollection ( collectionType , Array . getLength ( array ) ) ;
for ( int i = 0 ; i < array . length ; i + + ) {
resultColl . add ( ReflectionUtils . invokeMethod ( fromMethod , null , array [ i ] ) ) ;
}
@ -608,6 +608,7 @@ public class MBeanClientInterceptor
@@ -608,6 +608,7 @@ public class MBeanClientInterceptor
this . connector . close ( ) ;
}
/ * *
* Simple wrapper class around a method name and its signature .
* Used as the key when caching methods .
@ -616,7 +617,7 @@ public class MBeanClientInterceptor
@@ -616,7 +617,7 @@ public class MBeanClientInterceptor
private final String name ;
private final Class [ ] parameterTypes ;
private final Class < ? > [ ] parameterTypes ;
/ * *
* Create a new instance of { @code MethodCacheKey } with the supplied
@ -624,9 +625,9 @@ public class MBeanClientInterceptor
@@ -624,9 +625,9 @@ public class MBeanClientInterceptor
* @param name the name of the method
* @param parameterTypes the arguments in the method signature
* /
public MethodCacheKey ( String name , Class [ ] parameterTypes ) {
public MethodCacheKey ( String name , Class < ? > [ ] parameterTypes ) {
this . name = name ;
this . parameterTypes = ( parameterTypes ! = null ? parameterTypes : new Class [ 0 ] ) ;
this . parameterTypes = ( parameterTypes ! = null ? parameterTypes : new Class < ? > [ 0 ] ) ;
}
@Override