Skip to content
This repository was archived by the owner on Aug 17, 2018. It is now read-only.

Commit ba714e0

Browse files
author
Kin Man Chung
committed
- Port fix for 6646921
svn path=/trunk/; revision=1066
1 parent 8c3900e commit ba714e0

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

impl/src/main/java/org/apache/jasper/runtime/TagHandlerPool.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,10 @@ public void reuse(Tag handler) {
187187
}
188188
// There is no need for other threads to wait for us to release
189189
handler.release();
190+
191+
if (resourceInjector != null) {
192+
resourceInjector.preDestroy(handler);
193+
}
190194
}
191195

192196
/**
@@ -196,6 +200,9 @@ public void reuse(Tag handler) {
196200
public synchronized void release() {
197201
for (int i=current; i>=0; i--) {
198202
handlers[i].release();
203+
if (resourceInjector != null) {
204+
resourceInjector.preDestroy(handlers[i]);
205+
}
199206
}
200207
}
201208

impl/src/main/java/org/glassfish/jsp/api/ResourceInjector.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,21 @@ public interface ResourceInjector {
6060
* associated with this ResourceInjector into the given tag handler
6161
* instance.
6262
*
63+
* <p>Any @PostConstruct methods on the class (and super-classes)
64+
* of the instance will be invoked after injection.
65+
*
6366
* @param handler The tag handler instance to be injected
6467
*
6568
* @throws Exception if an error occurs during injection
6669
*/
6770
public void inject(JspTag handler) throws Exception;
6871

72+
/**
73+
* Invokes any @PreDestroy methods defined on the instance's class
74+
* (and super-classes).
75+
*
76+
* @param handler The tag handler instance whose @PreDestroy methods
77+
* to call
78+
*/
79+
public void preDestroy(JspTag handler);
6980
}

0 commit comments

Comments
 (0)