1. /*
  2. * Copyright 2002-2004 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.springframework.aop.support;
  17. import org.aopalliance.aop.Advice;
  18. import org.springframework.aop.Pointcut;
  19. import org.springframework.aop.PointcutAdvisor;
  20. import org.springframework.core.Ordered;
  21. /**
  22. * Convenient class for regexp method pointcuts that hold an Interceptor,
  23. * making them an Advisor.
  24. * @author Dmitriy Kopylenko
  25. * @version $Id: RegexpMethodPointcutAdvisor.java,v 1.4 2004/03/23 14:29:45 jhoeller Exp $
  26. */
  27. public class RegexpMethodPointcutAdvisor extends RegexpMethodPointcut
  28. implements PointcutAdvisor, Ordered {
  29. private int order = Integer.MAX_VALUE;
  30. private Advice advice;
  31. public RegexpMethodPointcutAdvisor() {
  32. }
  33. public RegexpMethodPointcutAdvisor(Advice advice) {
  34. this.advice = advice;
  35. }
  36. public void setOrder(int order) {
  37. this.order = order;
  38. }
  39. public int getOrder() {
  40. return order;
  41. }
  42. public void setAdvice(Advice advice) {
  43. this.advice = advice;
  44. }
  45. public Advice getAdvice() {
  46. return this.advice;
  47. }
  48. public boolean isPerInstance() {
  49. throw new UnsupportedOperationException("perInstance property of Advisor is not yet supported in Spring");
  50. }
  51. public Pointcut getPointcut() {
  52. return this;
  53. }
  54. }