Spring Framework StaticMethodMatcherPointcut - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework StaticMethodMatcherPointcut class.

This code example shows how to use the following methods:
 * 
 * @author Juergen Hoeller 
 * @since 2.5.5 
 */ 
@SuppressWarnings("serial") 
abstract class TransactionAttributeSourcePointcut extends StaticMethodMatcherPointcut implements Serializable {
 
	@Override 
	public boolean matches(Method method, Class<?> targetClass) {
		TransactionAttributeSource tas = getTransactionAttributeSource();
		return (tas == null || tas.getTransactionAttribute(method, targetClass) != null);
	} 
 
	@Override 
	public boolean equals(Object other) {
		if (this == other) {
			return true; 
		} 
		if (!(other instanceof TransactionAttributeSourcePointcut)) {
			return false; 
6
CodeRank
This code example shows how to use the following methods:
 * 
 * @author Costin Leau 
 * @since 3.1 
 */ 
@SuppressWarnings("serial") 
abstract class CacheOperationSourcePointcut extends StaticMethodMatcherPointcut implements Serializable {
 
	@Override 
	public boolean matches(Method method, Class<?> targetClass) {
		CacheOperationSource cas = getCacheOperationSource();
		return (cas != null && !CollectionUtils.isEmpty(cas.getCacheOperations(method, targetClass)));
	} 
 
	@Override 
	public boolean equals(Object other) {
		if (this == other) {
			return true; 
		} 
		if (!(other instanceof CacheOperationSourcePointcut)) {
			return false; 
6
CodeRank
This code example shows how to use the following methods:
 * 
 * @author Stephane Nicoll 
 * @since 4.1 
 */ 
@SuppressWarnings("serial") 
public abstract class JCacheOperationSourcePointcut
		extends StaticMethodMatcherPointcut implements Serializable {
 
	@Override 
	public boolean matches(Method method, Class<?> targetClass) {
		JCacheOperationSource cas = getCacheOperationSource();
		return (cas != null && cas.getCacheOperation(method, targetClass) != null);
	} 
 
	/** 
	 * Obtain the underlying {@link JCacheOperationSource} (may be {@code null}). 
	 * To be implemented by subclasses. 
	 */ 
	protected abstract JCacheOperationSource getCacheOperationSource();
 
6
CodeRank
This code example shows how to use the following methods:
        attributeSource = beanFactory.getBean(metadataSourceBeanName, MethodSecurityMetadataSource.class); 
    } 
 
    //~ Inner Classes ================================================================================================== 
 
    class MethodSecurityMetadataSourcePointcut extends StaticMethodMatcherPointcut implements Serializable { 
        @SuppressWarnings("unchecked") 
        public boolean matches(Method m, Class targetClass) { 
            Collection attributes = attributeSource.getAttributes(m, targetClass); 
            return attributes != null && !attributes.isEmpty(); 
        } 
    } 
} 
5
CodeRank
This code example shows how to use the following methods:
 *  
 * Reference: https://nikunjp.wordpress.com/2011/07/24/spring-aop-a-go-through-with-simple-example/ 
 * 
 * @author Mitja Vardjan 
 */ 
public class CommsFwPointcut extends StaticMethodMatcherPointcut {
 
	private static Logger LOG = LoggerFactory.getLogger(CommsFwPointcut.class); 
 
	/* (non-Javadoc) 
	 * @see MethodMatcher#matches(java.lang.reflect.Method, Class) 
	 */ 
	@Override 
	public boolean matches(Method method, Class<?> targetClass) {
		 
		LOG.debug("matches()"); 
		 
		String methodName = method.getName();
		 
		if (methodName.equals("sendIQGet")) {
5
CodeRank
This code example shows how to use the following methods:setClassFilter
 
	private final TideDataPublishingPointcut pointcut = new TideDataPublishingPointcut(); 
 
 
	public TideDataPublishingAdvisor() { 
		pointcut.setClassFilter(new AnnotationClassFilter(DataEnabled.class)); 
	} 
 
	public TideDataPublishingAdvisor(TideDataPublishingInterceptor interceptor) { 
		setDataPublishingInterceptor(interceptor); 
	} 
 
	public void setDataPublishingInterceptor(TideDataPublishingInterceptor interceptor) { 
		this.dataPublishingInterceptor = interceptor; 
	} 
 
 
	public Advice getAdvice() { 
		return this.dataPublishingInterceptor; 
	} 
5
CodeRank
This code example shows how to use the following methods:
/** 
 * @version $Id$ 
 * @author Willie Wheeler (willie.wheeler@gmail.com) 
 */ 
@SuppressWarnings("serial") 
public class GuardListSourcePointcut extends StaticMethodMatcherPointcut implements Serializable {
	private static final Logger log = LoggerFactory.getLogger(GuardListSourcePointcut.class); 
	 
	private GuardListSource source;
	 
	public GuardListSource getSource() { return source; }
	 
	public void setSource(GuardListSource source) { this.source = source; }
	 
	/* (non-Javadoc) 
	 * @see org.springframework.aop.MethodMatcher#matches(java.lang.reflect.Method, java.lang.Class) 
	 */ 
	@Override 
	public boolean matches(Method method, Class<?> targetClass) {
		if (source == null) {
4
CodeRank
This code example shows how to use the following methods:
   * Create pointcut that uses the specific cache context source and operations on the specified interceptor type 
   * 
   * @param cacheContextSource Source to retrieve invocation context information from 
   * @param cacheInterceptor   The type of interceptor this pointcut is for 
   */ 
  public CacheStaticMethodMatcherPointcut(CacheContextSource<MethodInvocation> cacheContextSource, CacheMethodInterceptor cacheInterceptor) {
    Assert.notNull(cacheContextSource);
    Assert.notNull(cacheInterceptor);
 
    this.cacheContextSource = cacheContextSource;
    this.interceptorType = cacheInterceptor.getInterceptorType();
  } 
 
  /** 
   * Returns true if the configured {@link CacheContextSource#getMethodDetails(Method, Class)} 
   * method returns an {@link StaticCacheInvocationContext} with an {@link InterceptorType} that matches 
   * the type passed into the constructor 
   * 
   * @see org.springframework.aop.MethodMatcher#matches(java.lang.reflect.Method, java.lang.Class) 
   */ 
4
CodeRank
This code example shows how to use the following methods:
 */ 
class MethodAnnotationPointcut extends StaticMethodMatcherPointcut {
 
	private final Class<? extends Annotation> annotationType;
 
	MethodAnnotationPointcut(final Class<? extends Annotation> annotationType) {
		Assert.notNull(annotationType);
		this.annotationType = annotationType;
	} 
 
	@Override 
	public boolean matches(final Method method, final Class<?> targetClass) {
		return AnnotationUtils.findAnnotation(method, annotationType) != null;
	} 
 
} 
4
CodeRank
See Code Examples for Spring Framework StaticMethodMatcherPointcut Methods: