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 superclass for Advisors that are also static pointcuts.
  23. * @author Rod Johnson
  24. * @version $Id: StaticMethodMatcherPointcutAdvisor.java,v 1.7 2004/03/23 14:29:45 jhoeller Exp $
  25. */
  26. public abstract class StaticMethodMatcherPointcutAdvisor extends StaticMethodMatcherPointcut
  27. implements PointcutAdvisor, Ordered {
  28. private int order = Integer.MAX_VALUE;
  29. private Advice advice;
  30. public StaticMethodMatcherPointcutAdvisor() {
  31. }
  32. public StaticMethodMatcherPointcutAdvisor(Advice advice) {
  33. this.advice = advice;
  34. }
  35. public void setOrder(int order) {
  36. this.order = order;
  37. }
  38. public int getOrder() {
  39. return order;
  40. }
  41. public void setAdvice(Advice advice) {
  42. this.advice = advice;
  43. }
  44. public Advice getAdvice() {
  45. return advice;
  46. }
  47. public Pointcut getPointcut() {
  48. return this;
  49. }
  50. public boolean isPerInstance() {
  51. throw new UnsupportedOperationException("perInstance property of Advisor is not yet supported in Spring");
  52. }
  53. }