I am thinking of the following modifications:
1.) Add an abstract TilesTag and TilesBodyTag which extend TagSupport and BodyTagSupport and both implement TryCatchFinally.
2.) Existing tag classes which extend TagSupport will now extend TilesTag. Existing tag classes which extend BodyTagSupport will extend TilesBodyTag.
3.) Both TilesTag and TilesBodyTag will implement doCatch() in the following manner:
public void doCatch(Throwable throwable) throws Throwable
This is a default (no-op) implementation and will result in no change in handling exceptions thrown from tags.
4.) Both TilesTag and TilesBodyTag will implement doFinally in the following manner:
public void doFinally()
//reset any per-invocation resources
5.) TilesTag and TilesBodyTag will now define the reset method:
6.) The release() method will be defined as follows on TilesTag and TilesBodyTag:
- Release all allocated resources.
public void release()
7.) All logic found in existing release() methods will be moved to the reset() method and the release() methods removed.
Does anyone see any pitfalls or problems with this approach, or see a better way to resolve this issue?