* @see net.sf.hajdbc.durability.none.NoDurability#getInvoker(net.sf.hajdbc.invocation.Invoker, net.sf.hajdbc.durability.Durability.Phase, java.lang.Object, net.sf.hajdbc.ExceptionFactory)
*/
@Override
public <T, R, E extends Exception> Invoker<Z, D, T, R, E> getInvoker(final Invoker<Z, D, T, R, E> invoker, final Phase phase, final Object transactionId, final ExceptionFactory<E> exceptionFactory)
{
final DurabilityListener listener = this.cluster.getStateManager();
return new Invoker<Z, D, T, R, E>()
{
@Override
public R invoke(D database, T object) throws E
{
InvokerEvent event = new InvokerEventImpl(transactionId, phase, database.getId());
listener.beforeInvoker(event);
try
{
R result = invoker.invoke(database, object);
event.setResult(new InvokerResultImpl(result));
return result;
}
catch (Exception e)
{
event.setResult(new InvokerResultImpl(e));
throw exceptionFactory.createException(e);
}
finally
{
listener.afterInvoker(event);
}
}
};
}