1 17 package org.alfresco.repo.action; 18 19 import org.alfresco.repo.action.ActionServiceImpl.PendingAction; 20 import org.alfresco.repo.transaction.TransactionListener; 21 import org.alfresco.util.GUID; 22 23 28 public class ActionTransactionListener implements TransactionListener 29 { 30 33 private String id = GUID.generate(); 34 35 38 private RuntimeActionService actionService; 39 40 45 public ActionTransactionListener(RuntimeActionService actionService) 46 { 47 this.actionService = actionService; 48 } 49 50 53 public void flush() 54 { 55 } 56 57 60 public void beforeCommit(boolean readOnly) 61 { 62 } 63 64 67 public void beforeCompletion() 68 { 69 } 70 71 74 public void afterCommit() 75 { 76 for (PendingAction pendingAction : this.actionService.getPostTransactionPendingActions()) 77 { 78 this.actionService.getAsynchronousActionExecutionQueue().executeAction( 79 actionService, 80 pendingAction.getAction(), 81 pendingAction.getActionedUponNodeRef(), 82 pendingAction.getCheckConditions(), 83 pendingAction.getActionChain()); 84 } 85 } 86 87 90 public void afterRollback() 91 { 92 } 93 94 97 @Override 98 public int hashCode() 99 { 100 return this.id.hashCode(); 101 } 102 103 106 @Override 107 public boolean equals(Object obj) 108 { 109 if (this == obj) 110 { 111 return true; 112 } 113 if (obj instanceof ActionTransactionListener) 114 { 115 ActionTransactionListener that = (ActionTransactionListener) obj; 116 return (this.id.equals(that.id)); 117 } 118 else 119 { 120 return false; 121 } 122 } 123 124 } 125 | Popular Tags |