Java Code Examples for org.springframework.aop.support.AopUtils#isToStringMethod()

The following examples show how to use org.springframework.aop.support.AopUtils#isToStringMethod() . 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: CglibAopProxy.java    From spring-analysis-note with MIT License 5 votes vote down vote up
public CglibMethodInvocation(Object proxy, @Nullable Object target, Method method,
		Object[] arguments, @Nullable Class<?> targetClass,
		List<Object> interceptorsAndDynamicMethodMatchers, MethodProxy methodProxy) {

	super(proxy, target, method, arguments, targetClass, interceptorsAndDynamicMethodMatchers);

	// Only use method proxy for public methods not derived from java.lang.Object
	this.methodProxy = (Modifier.isPublic(method.getModifiers()) &&
			method.getDeclaringClass() != Object.class && !AopUtils.isEqualsMethod(method) &&
			!AopUtils.isHashCodeMethod(method) && !AopUtils.isToStringMethod(method) ?
			methodProxy : null);
}
 
Example 2
Source File: JaxWsPortClientInterceptor.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Override
@Nullable
public Object invoke(MethodInvocation invocation) throws Throwable {
	if (AopUtils.isToStringMethod(invocation.getMethod())) {
		return "JAX-WS proxy for port [" + getPortName() + "] of service [" + getServiceName() + "]";
	}
	// Lazily prepare service and stub if necessary.
	synchronized (this.preparationMonitor) {
		if (!isPrepared()) {
			prepare();
		}
	}
	return doInvoke(invocation);
}
 
Example 3
Source File: CglibAopProxy.java    From java-technology-stack with MIT License 5 votes vote down vote up
public CglibMethodInvocation(Object proxy, @Nullable Object target, Method method,
		Object[] arguments, @Nullable Class<?> targetClass,
		List<Object> interceptorsAndDynamicMethodMatchers, MethodProxy methodProxy) {

	super(proxy, target, method, arguments, targetClass, interceptorsAndDynamicMethodMatchers);

	// Only use method proxy for public methods not derived from java.lang.Object
	this.methodProxy = (Modifier.isPublic(method.getModifiers()) &&
			method.getDeclaringClass() != Object.class && !AopUtils.isEqualsMethod(method) &&
			!AopUtils.isHashCodeMethod(method) && !AopUtils.isToStringMethod(method) ?
			methodProxy : null);
}
 
Example 4
Source File: JaxWsPortClientInterceptor.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Override
@Nullable
public Object invoke(MethodInvocation invocation) throws Throwable {
	if (AopUtils.isToStringMethod(invocation.getMethod())) {
		return "JAX-WS proxy for port [" + getPortName() + "] of service [" + getServiceName() + "]";
	}
	// Lazily prepare service and stub if necessary.
	synchronized (this.preparationMonitor) {
		if (!isPrepared()) {
			prepare();
		}
	}
	return doInvoke(invocation);
}
 
Example 5
Source File: JaxWsPortClientInterceptor.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
	if (AopUtils.isToStringMethod(invocation.getMethod())) {
		return "JAX-WS proxy for port [" + getPortName() + "] of service [" + getServiceName() + "]";
	}
	// Lazily prepare service and stub if necessary.
	synchronized (this.preparationMonitor) {
		if (!isPrepared()) {
			prepare();
		}
	}
	return doInvoke(invocation);
}
 
Example 6
Source File: JaxWsPortClientInterceptor.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
	if (AopUtils.isToStringMethod(invocation.getMethod())) {
		return "JAX-WS proxy for port [" + getPortName() + "] of service [" + getServiceName() + "]";
	}
	// Lazily prepare service and stub if necessary.
	synchronized (this.preparationMonitor) {
		if (!isPrepared()) {
			prepare();
		}
	}
	return doInvoke(invocation);
}
 
Example 7
Source File: RmiClientInterceptor.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * Apply the given AOP method invocation to the given {@link RmiInvocationHandler}.
 * <p>The default implementation delegates to {@link #createRemoteInvocation}.
 * @param methodInvocation the current AOP method invocation
 * @param invocationHandler the RmiInvocationHandler to apply the invocation to
 * @return the invocation result
 * @throws RemoteException in case of communication errors
 * @throws NoSuchMethodException if the method name could not be resolved
 * @throws IllegalAccessException if the method could not be accessed
 * @throws InvocationTargetException if the method invocation resulted in an exception
 * @see org.springframework.remoting.support.RemoteInvocation
 */
@Nullable
protected Object doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler)
	throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {

	if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
		return "RMI invoker proxy for service URL [" + getServiceUrl() + "]";
	}

	return invocationHandler.invoke(createRemoteInvocation(methodInvocation));
}
 
Example 8
Source File: JndiRmiClientInterceptor.java    From spring-analysis-note with MIT License 3 votes vote down vote up
/**
 * Apply the given AOP method invocation to the given {@link RmiInvocationHandler}.
 * <p>The default implementation delegates to {@link #createRemoteInvocation}.
 * @param methodInvocation the current AOP method invocation
 * @param invocationHandler the RmiInvocationHandler to apply the invocation to
 * @return the invocation result
 * @throws RemoteException in case of communication errors
 * @throws NoSuchMethodException if the method name could not be resolved
 * @throws IllegalAccessException if the method could not be accessed
 * @throws InvocationTargetException if the method invocation resulted in an exception
 * @see org.springframework.remoting.support.RemoteInvocation
 */
protected Object doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler)
		throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {

	if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
		return "RMI invoker proxy for service URL [" + getJndiName() + "]";
	}

	return invocationHandler.invoke(createRemoteInvocation(methodInvocation));
}
 
Example 9
Source File: RmiClientInterceptor.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * Apply the given AOP method invocation to the given {@link RmiInvocationHandler}.
 * <p>The default implementation delegates to {@link #createRemoteInvocation}.
 * @param methodInvocation the current AOP method invocation
 * @param invocationHandler the RmiInvocationHandler to apply the invocation to
 * @return the invocation result
 * @throws RemoteException in case of communication errors
 * @throws NoSuchMethodException if the method name could not be resolved
 * @throws IllegalAccessException if the method could not be accessed
 * @throws InvocationTargetException if the method invocation resulted in an exception
 * @see org.springframework.remoting.support.RemoteInvocation
 */
@Nullable
protected Object doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler)
	throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {

	if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
		return "RMI invoker proxy for service URL [" + getServiceUrl() + "]";
	}

	return invocationHandler.invoke(createRemoteInvocation(methodInvocation));
}
 
Example 10
Source File: JndiRmiClientInterceptor.java    From java-technology-stack with MIT License 3 votes vote down vote up
/**
 * Apply the given AOP method invocation to the given {@link RmiInvocationHandler}.
 * <p>The default implementation delegates to {@link #createRemoteInvocation}.
 * @param methodInvocation the current AOP method invocation
 * @param invocationHandler the RmiInvocationHandler to apply the invocation to
 * @return the invocation result
 * @throws RemoteException in case of communication errors
 * @throws NoSuchMethodException if the method name could not be resolved
 * @throws IllegalAccessException if the method could not be accessed
 * @throws InvocationTargetException if the method invocation resulted in an exception
 * @see org.springframework.remoting.support.RemoteInvocation
 */
protected Object doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler)
		throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {

	if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
		return "RMI invoker proxy for service URL [" + getJndiName() + "]";
	}

	return invocationHandler.invoke(createRemoteInvocation(methodInvocation));
}
 
Example 11
Source File: RmiClientInterceptor.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Apply the given AOP method invocation to the given {@link RmiInvocationHandler}.
 * <p>The default implementation delegates to {@link #createRemoteInvocation}.
 * @param methodInvocation the current AOP method invocation
 * @param invocationHandler the RmiInvocationHandler to apply the invocation to
 * @return the invocation result
 * @throws RemoteException in case of communication errors
 * @throws NoSuchMethodException if the method name could not be resolved
 * @throws IllegalAccessException if the method could not be accessed
 * @throws InvocationTargetException if the method invocation resulted in an exception
 * @see org.springframework.remoting.support.RemoteInvocation
 */
protected Object doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler)
	throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {

	if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
		return "RMI invoker proxy for service URL [" + getServiceUrl() + "]";
	}

	return invocationHandler.invoke(createRemoteInvocation(methodInvocation));
}
 
Example 12
Source File: JndiRmiClientInterceptor.java    From lams with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Apply the given AOP method invocation to the given {@link RmiInvocationHandler}.
 * <p>The default implementation delegates to {@link #createRemoteInvocation}.
 * @param methodInvocation the current AOP method invocation
 * @param invocationHandler the RmiInvocationHandler to apply the invocation to
 * @return the invocation result
 * @throws RemoteException in case of communication errors
 * @throws NoSuchMethodException if the method name could not be resolved
 * @throws IllegalAccessException if the method could not be accessed
 * @throws InvocationTargetException if the method invocation resulted in an exception
 * @see org.springframework.remoting.support.RemoteInvocation
 */
protected Object doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler)
		throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {

	if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
		return "RMI invoker proxy for service URL [" + getJndiName() + "]";
	}

	return invocationHandler.invoke(createRemoteInvocation(methodInvocation));
}
 
Example 13
Source File: RmiClientInterceptor.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * Apply the given AOP method invocation to the given {@link RmiInvocationHandler}.
 * <p>The default implementation delegates to {@link #createRemoteInvocation}.
 * @param methodInvocation the current AOP method invocation
 * @param invocationHandler the RmiInvocationHandler to apply the invocation to
 * @return the invocation result
 * @throws RemoteException in case of communication errors
 * @throws NoSuchMethodException if the method name could not be resolved
 * @throws IllegalAccessException if the method could not be accessed
 * @throws InvocationTargetException if the method invocation resulted in an exception
 * @see org.springframework.remoting.support.RemoteInvocation
 */
protected Object doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler)
	throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {

	if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
		return "RMI invoker proxy for service URL [" + getServiceUrl() + "]";
	}

	return invocationHandler.invoke(createRemoteInvocation(methodInvocation));
}
 
Example 14
Source File: JndiRmiClientInterceptor.java    From spring4-understanding with Apache License 2.0 3 votes vote down vote up
/**
 * Apply the given AOP method invocation to the given {@link RmiInvocationHandler}.
 * <p>The default implementation delegates to {@link #createRemoteInvocation}.
 * @param methodInvocation the current AOP method invocation
 * @param invocationHandler the RmiInvocationHandler to apply the invocation to
 * @return the invocation result
 * @throws RemoteException in case of communication errors
 * @throws NoSuchMethodException if the method name could not be resolved
 * @throws IllegalAccessException if the method could not be accessed
 * @throws InvocationTargetException if the method invocation resulted in an exception
 * @see org.springframework.remoting.support.RemoteInvocation
 */
protected Object doInvoke(MethodInvocation methodInvocation, RmiInvocationHandler invocationHandler)
		throws RemoteException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {

	if (AopUtils.isToStringMethod(methodInvocation.getMethod())) {
		return "RMI invoker proxy for service URL [" + getJndiName() + "]";
	}

	return invocationHandler.invoke(createRemoteInvocation(methodInvocation));
}