class DelegateInvocationHandler implements InvocationHandler {

    @Override
    public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable
    {
        if ( delegate == null )
        {
            throw new StateChangedTransactionFailureException(
                    "This transaction made assumptions about the instance it is executing " +
                    "on that no longer hold true. This normally happens when a transaction " +
                    "expects the instance it is executing on to be in some specific cluster role" +
                    "(such as 'master' or 'slave') and the instance " +
                    "changing state while the transaction is executing. Simply retry your " +
                    "transaction and you should see a successful outcome." );
        }
        return proxyInvoke( delegate, method, args );
    }

    public  DelegateInvocationHandler( final Class<T> interfaceClass );

}