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;
  17. import java.lang.reflect.Method;
  18. /**
  19. * Advice invoked before a method is invoked. Such advices cannot
  20. * prevent the method call proceeding, unless they throw a
  21. * Throwable.
  22. * @author Rod Johnson
  23. * @version $Id: MethodBeforeAdvice.java,v 1.3 2004/03/18 02:46:07 trisberg Exp $
  24. */
  25. public interface MethodBeforeAdvice extends BeforeAdvice {
  26. /**
  27. * Callback before a given method is invoked
  28. * @param m method being invoked
  29. * @param args arguments to the method
  30. * @param target target of the method invocation. May be null
  31. * @throws Throwable if this object wishes to abort the
  32. * call. Any exception thrown will be returned to the caller
  33. * if it's allowed by the method signature. Otherwise
  34. * the exception will be wrapped as a runtime exception.
  35. */
  36. void before(Method m, Object[] args, Object target) throws Throwable;
  37. }