diff --git a/src/Spring/Spring.Core/Objects/Factory/Support/DisposableObjectAdapter.cs b/src/Spring/Spring.Core/Objects/Factory/Support/DisposableObjectAdapter.cs index e1ec4c39..44c21e6a 100644 --- a/src/Spring/Spring.Core/Objects/Factory/Support/DisposableObjectAdapter.cs +++ b/src/Spring/Spring.Core/Objects/Factory/Support/DisposableObjectAdapter.cs @@ -26,22 +26,12 @@ namespace Spring.Objects.Factory.Support private List objectPostProcessors; /// - /// Disposables the bean adapter. - /// - /// The bean. - /// Name of the bean. - /// The bean definition. - /// The post processors. - /// The acc. /// Create a new DisposableBeanAdapter for the given bean. - /// @param bean the bean instance (never - /// null - /// ) - /// @param beanName the name of the bean - /// @param beanDefinition the merged bean definition - /// @param postProcessors the List of BeanPostProcessors - /// (potentially DestructionAwareBeanPostProcessor), if any - + /// + /// The bean instance (never null). + /// Name of the bean. + /// The merged bean definition. + /// the List of BeanPostProcessors (potentially IDestructionAwareBeanPostProcessor), if any. public DisposableObjectAdapter(object instance, string objectName, RootObjectDefinition objectDefinition, ISet postProcessors) { AssertUtils.ArgumentNotNull(instance, "Disposable object must not be null"); @@ -89,17 +79,6 @@ namespace Spring.Objects.Factory.Support this.objectPostProcessors = FilterPostProcessors(postProcessors); } - /** - * If the current value of the given beanDefinition's destroyMethodName property is - * {@link AbstractBeanDefinition#INFER_METHOD}, then attempt to infer a destroy method. - * Candidate methods are currently limited to public, no-arg methods named 'close' - * (whether declared locally or inherited). The given beanDefinition's - * destroyMethodName is updated to be null if no such method is found, otherwise set - * to the name of the inferred method. This constant serves as the default for the - * {@code @Bean#customDestroyMethod} attribute and the value of the constant may also be - * used in XML within the {@code } or {@code - * } attributes. - */ private void InferDestroyMethodIfNecessary(RootObjectDefinition beanDefinition) { if ("(Inferred)".Equals(beanDefinition.DestroyMethodName)) @@ -112,7 +91,7 @@ namespace Spring.Objects.Factory.Support beanDefinition.DestroyMethodName = candidate.Name; } } - catch (MissingMethodException ex) + catch (MissingMethodException) { // no candidate destroy method found beanDefinition.DestroyMethodName = null; @@ -121,13 +100,10 @@ namespace Spring.Objects.Factory.Support } /// - /// Filters the post processors. + /// Search for all s in the List. /// - /// The post processors. - /// - /// Search for all DestructionAwareBeanPostProcessors in the List. - /// @param postProcessors the List to search - /// @return the filtered List of DestructionAwareBeanPostProcessors + /// The List to search. + /// the filtered List of IDestructionAwareObjectPostProcessors. private List FilterPostProcessors(ISet postProcessors) { List filteredPostProcessors = null; @@ -141,6 +117,9 @@ namespace Spring.Objects.Factory.Support + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// public void Dispose() { if (this.objectPostProcessors != null && this.objectPostProcessors.Count != 0) @@ -273,24 +252,5 @@ namespace Spring.Objects.Factory.Support "' on object with name '" + this.objectName + "'", ex); } } - - - /** - * Serializes a copy of the state of this class, - * filtering out non-serializable BeanPostProcessors. - */ - //protected Object writeReplace() { - // List serializablePostProcessors = null; - // if (this.objectPostProcessors != null) { - // serializablePostProcessors = new ArrayList(); - // for (DestructionAwareBeanPostProcessor postProcessor : this.objectPostProcessors) { - // if (postProcessor instanceof Serializable) { - // serializablePostProcessors.add(postProcessor); - // } - // } - // } - // return new DisposableBeanAdapter(this.bean, this.beanName, this.invokeDisposableObject, - // this.nonPublicAccessAllowed, this.destroyMethodName, serializablePostProcessors); - //} } } \ No newline at end of file