File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
spring-beans/src/main/java/org/springframework/beans/factory/access
spring-context/src/main/java/org/springframework/ejb/interceptor Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2012 the original author or authors.
2+ * Copyright 2002-2013 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1616
1717package org .springframework .beans .factory .access ;
1818
19- import org .springframework .beans .FatalBeanException ;
2019import org .springframework .beans .factory .BeanFactory ;
2120
2221/**
@@ -49,11 +48,10 @@ public interface BeanFactoryReference {
4948 * <p>In an EJB usage scenario this would normally be called from
5049 * {@code ejbRemove()} and {@code ejbPassivate()}.
5150 * <p>This is safe to call multiple times.
52- * @throws FatalBeanException if the {@code BeanFactory} cannot be released
5351 * @see BeanFactoryLocator
5452 * @see org.springframework.context.access.ContextBeanFactoryReference
5553 * @see org.springframework.context.ConfigurableApplicationContext#close()
5654 */
57- void release () throws FatalBeanException ;
55+ void release ();
5856
5957}
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2012 the original author or authors.
2+ * Copyright 2002-2013 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
7171 * @see org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor
7272 * @see org.springframework.context.access.ContextSingletonBeanFactoryLocator
7373 * @see #getBeanFactoryLocatorKey
74- * @see org.springframework.ejb.support.AbstractEnterpriseBean#setBeanFactoryLocator
75- * @see org.springframework.ejb.support.AbstractEnterpriseBean#setBeanFactoryLocatorKey
7674 */
7775public class SpringBeanAutowiringInterceptor {
7876
@@ -99,9 +97,15 @@ public void autowireBean(InvocationContext invocationContext) {
9997 invocationContext .proceed ();
10098 }
10199 catch (RuntimeException ex ) {
100+ doReleaseBean (invocationContext .getTarget ());
102101 throw ex ;
103102 }
103+ catch (Error err ) {
104+ doReleaseBean (invocationContext .getTarget ());
105+ throw err ;
106+ }
104107 catch (Exception ex ) {
108+ doReleaseBean (invocationContext .getTarget ());
105109 // Cannot declare a checked exception on WebSphere here - so we need to wrap.
106110 throw new EJBException (ex );
107111 }
You can’t perform that action at this time.
0 commit comments