@Override
public void bindResource(Object key, Object resource) throws TransactionException
{
if (!(this.delegate instanceof NullTransaction))
{
throw new TransactionException(CoreMessages.createStaticMessage("Single resource transaction has already a resource bound"));
}
TransactionFactory transactionFactory = muleContext.getTransactionFactoryManager().getTransactionFactoryFor(key.getClass());
this.unbindTransaction();
this.delegate = transactionFactory.beginTransaction(muleContext);
delegate.bindResource(key, resource);