Spring Framework DisposableBean - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework DisposableBean class.

This code example shows how to use the following methods:destroy
		if (getBeanFactory() instanceof ConfigurableBeanFactory) {
			((ConfigurableBeanFactory) getBeanFactory()).destroyBean(getTargetBeanName(), target);
		} 
		else if (target instanceof DisposableBean) {
			try { 
				((DisposableBean) target).destroy();
			} 
			catch (Throwable ex) {
				logger.error("Couldn't invoke destroy method of bean with name '" + getTargetBeanName() + "'", ex);
			} 
		} 
	} 
 
 
	//--------------------------------------------------------------------- 
	// Serialization support 
	//--------------------------------------------------------------------- 
 
	private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
		throw new NotSerializableException("A prototype-based TargetSource itself is not deserializable - " +
5
CodeRank
This code example shows how to use the following methods:destroy
 
 
	@Override 
	public void destroy() throws Exception {
		if (this.target instanceof DisposableBean) {
			((DisposableBean) this.target).destroy();
		} 
	} 
 
} 
5
CodeRank
See Code Examples for Spring Framework DisposableBean Methods: