use of org.alfresco.sync.events.types.TransactionRolledBackEvent in project alfresco-repository by Alfresco.
the class AbstractEventsService method afterRollback.
@Override
public void afterRollback() {
String txnId = AlfrescoTransactionSupport.getTransactionId();
long timestamp = System.currentTimeMillis();
String networkId = TenantUtil.getCurrentDomain();
String username = AuthenticationUtil.getFullyAuthenticatedUser();
Client alfrescoClient = getAlfrescoClient(null);
Event event = new TransactionRolledBackEvent(nextSequenceNumber(), txnId, networkId, timestamp, username, alfrescoClient);
if (logger.isDebugEnabled()) {
logger.debug("sendEvent " + event);
}
try {
messageProducer.send(event);
} catch (MessagingException e) {
// throw new AlfrescoRuntimeException("Failed to send event", e);
// TODO just log for now. How to deal with no running ActiveMQ?
logger.error("Failed to send event " + event, e);
} finally {
TxnEvents events = (TxnEvents) AlfrescoTransactionSupport.getResource(EVENTS_KEY);
if (events != null) {
events.clear();
}
}
}
Aggregations