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. /**
  18. * A TargetSource is used to obtain the current "target" of
  19. * an AOP invocation, which will be invoked via reflection if no
  20. * around advice chooses to end the interceptor chain itself.
  21. * <br>If a TargetSource is "static", it will always
  22. * return the same target, allowing optimizations in the AOP framework.
  23. * Dynamic target sources can support pooling, hot swapping etc.
  24. * <br>Application developers don't usually need to work with TargetSources
  25. * directly: this is an AOP framework interface.
  26. * @author Rod Johnson
  27. * @version $Id: TargetSource.java,v 1.4 2004/03/18 02:46:07 trisberg Exp $
  28. */
  29. public interface TargetSource {
  30. Class getTargetClass();
  31. boolean isStatic();
  32. Object getTarget() throws Exception;
  33. void releaseTarget(Object target) throws Exception;
  34. }