The java.lang.reflect. Proxy can decorate the context factory and context classes (they both have interfaces) and delegate to the original class. This is effectively an around advice.
The way clients see it, it's still original class.
When such proxy detects a failure, it can 'reinitialise' behind the scene. See the org.mule.providers.jms.xa.ConnectionFactoryWrapper for a good usage sample.
Andrew Perepelytsya wrote: > > Kenneth, > > Can you check if it can be implemented with a standard JDK proxy? That > would > provide a consistent approach with the invocation handler.
> > Andrew >