01: /*
02: * Copyright 2002-2005 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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:
17: package org.springframework.beans.factory.config;
18:
19: import org.springframework.beans.BeansException;
20:
21: /**
22: * Subinterface of BeanPostProcessor that adds a before-destruction callback.
23: *
24: * <p>The typical usage will be to invoke custom destruction callbacks on
25: * specific bean types, matching corresponding initialization callbacks.
26: *
27: * @author Juergen Hoeller
28: * @since 1.0.1
29: * @see org.springframework.web.struts.ActionServletAwareProcessor
30: */
31: public interface DestructionAwareBeanPostProcessor extends
32: BeanPostProcessor {
33:
34: /**
35: * Apply this BeanPostProcessor to the given bean instance before
36: * its destruction. Can invoke custom destruction callbacks.
37: * <p>Like DisposableBean's <code>destroy</code> and a custom destroy method,
38: * this callback just applies to singleton beans in the factory (including
39: * inner beans).
40: * @param bean the bean instance to be destroyed
41: * @param beanName the name of the bean
42: * @throws org.springframework.beans.BeansException in case of errors
43: * @see org.springframework.beans.factory.DisposableBean
44: * @see org.springframework.beans.factory.support.AbstractBeanDefinition#setDestroyMethodName
45: */
46: void postProcessBeforeDestruction(Object bean, String beanName)
47: throws BeansException;
48:
49: }
|