Java Code Examples for org.springframework.jmx.support.JmxUtils#getMethodSignature()

The following examples show how to use org.springframework.jmx.support.JmxUtils#getMethodSignature() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MBeanClientInterceptor.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * Routes a method invocation (not a property get/set) to the corresponding
 * operation on the managed resource.
 * @param method the method corresponding to operation on the managed resource.
 * @param args the invocation arguments
 * @return the value returned by the method invocation.
 */
private Object invokeOperation(Method method, Object[] args) throws JMException, IOException {
	Assert.state(this.serverToUse != null, "No MBeanServerConnection available");

	MethodCacheKey key = new MethodCacheKey(method.getName(), method.getParameterTypes());
	MBeanOperationInfo info = this.allowedOperations.get(key);
	if (info == null) {
		throw new InvalidInvocationException("Operation '" + method.getName() +
				"' is not exposed on the management interface");
	}

	String[] signature;
	synchronized (this.signatureCache) {
		signature = this.signatureCache.get(method);
		if (signature == null) {
			signature = JmxUtils.getMethodSignature(method);
			this.signatureCache.put(method, signature);
		}
	}

	return this.serverToUse.invoke(this.objectName, method.getName(), args, signature);
}
 
Example 2
Source File: MBeanClientInterceptor.java    From java-technology-stack with MIT License 6 votes vote down vote up
/**
 * Routes a method invocation (not a property get/set) to the corresponding
 * operation on the managed resource.
 * @param method the method corresponding to operation on the managed resource.
 * @param args the invocation arguments
 * @return the value returned by the method invocation.
 */
private Object invokeOperation(Method method, Object[] args) throws JMException, IOException {
	Assert.state(this.serverToUse != null, "No MBeanServerConnection available");

	MethodCacheKey key = new MethodCacheKey(method.getName(), method.getParameterTypes());
	MBeanOperationInfo info = this.allowedOperations.get(key);
	if (info == null) {
		throw new InvalidInvocationException("Operation '" + method.getName() +
				"' is not exposed on the management interface");
	}

	String[] signature;
	synchronized (this.signatureCache) {
		signature = this.signatureCache.get(method);
		if (signature == null) {
			signature = JmxUtils.getMethodSignature(method);
			this.signatureCache.put(method, signature);
		}
	}

	return this.serverToUse.invoke(this.objectName, method.getName(), args, signature);
}
 
Example 3
Source File: MBeanClientInterceptor.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Routes a method invocation (not a property get/set) to the corresponding
 * operation on the managed resource.
 * @param method the method corresponding to operation on the managed resource.
 * @param args the invocation arguments
 * @return the value returned by the method invocation.
 */
private Object invokeOperation(Method method, Object[] args) throws JMException, IOException {
	MethodCacheKey key = new MethodCacheKey(method.getName(), method.getParameterTypes());
	MBeanOperationInfo info = this.allowedOperations.get(key);
	if (info == null) {
		throw new InvalidInvocationException("Operation '" + method.getName() +
				"' is not exposed on the management interface");
	}
	String[] signature = null;
	synchronized (this.signatureCache) {
		signature = this.signatureCache.get(method);
		if (signature == null) {
			signature = JmxUtils.getMethodSignature(method);
			this.signatureCache.put(method, signature);
		}
	}
	return this.serverToUse.invoke(this.objectName, method.getName(), args, signature);
}
 
Example 4
Source File: MBeanClientInterceptor.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
/**
 * Routes a method invocation (not a property get/set) to the corresponding
 * operation on the managed resource.
 * @param method the method corresponding to operation on the managed resource.
 * @param args the invocation arguments
 * @return the value returned by the method invocation.
 */
private Object invokeOperation(Method method, Object[] args) throws JMException, IOException {
	MethodCacheKey key = new MethodCacheKey(method.getName(), method.getParameterTypes());
	MBeanOperationInfo info = this.allowedOperations.get(key);
	if (info == null) {
		throw new InvalidInvocationException("Operation '" + method.getName() +
				"' is not exposed on the management interface");
	}
	String[] signature = null;
	synchronized (this.signatureCache) {
		signature = this.signatureCache.get(method);
		if (signature == null) {
			signature = JmxUtils.getMethodSignature(method);
			this.signatureCache.put(method, signature);
		}
	}
	return this.serverToUse.invoke(this.objectName, method.getName(), args, signature);
}