Fix up the hashmap provider

This commit is contained in:
Tadgh 2021-04-13 11:12:26 -04:00
parent 346c9d783c
commit 63c9e892b6
1 changed files with 23 additions and 6 deletions

View File

@ -387,25 +387,42 @@ public class HashMapResourceProvider<T extends IBaseResource> implements IResour
if (!myIdToHistory.containsKey(theIdPart)) {
// Interceptor call: STORAGE_PRESTORAGE_RESOURCE_CREATED
HookParams params = new HookParams()
HookParams preStorageParams = new HookParams()
.add(RequestDetails.class, theRequestDetails)
.addIfMatchesType(ServletRequestDetails.class, theRequestDetails)
.add(IBaseResource.class, theResource)
.add(TransactionDetails.class, theTransactionDetails);
interceptorBroadcaster.callHooks(Pointcut.STORAGE_PRESTORAGE_RESOURCE_CREATED, params);
interceptorBroadcaster.callHooks(Pointcut.STORAGE_PRECOMMIT_RESOURCE_CREATED, params);
interceptorBroadcaster.callHooks(Pointcut.STORAGE_PRESTORAGE_RESOURCE_CREATED, preStorageParams);
// Interceptor call: STORAGE_PRECOMMIT_RESOURCE_CREATED
HookParams preCommitParams = new HookParams()
.add(RequestDetails.class, theRequestDetails)
.addIfMatchesType(ServletRequestDetails.class, theRequestDetails)
.add(IBaseResource.class, theResource)
.add(TransactionDetails.class, theTransactionDetails)
.add(Boolean.class, theTransactionDetails.isPointcutDeferred(Pointcut.STORAGE_PRECOMMIT_RESOURCE_CREATED));
interceptorBroadcaster.callHooks(Pointcut.STORAGE_PRECOMMIT_RESOURCE_CREATED, preCommitParams);
} else {
// Interceptor call: STORAGE_PRESTORAGE_RESOURCE_UPDATED
HookParams params = new HookParams()
HookParams preStorageParams = new HookParams()
.add(RequestDetails.class, theRequestDetails)
.addIfMatchesType(ServletRequestDetails.class, theRequestDetails)
.add(IBaseResource.class, myIdToHistory.get(theIdPart).getFirst())
.add(IBaseResource.class, theResource)
.add(TransactionDetails.class, theTransactionDetails);
interceptorBroadcaster.callHooks(Pointcut.STORAGE_PRESTORAGE_RESOURCE_UPDATED, params);
interceptorBroadcaster.callHooks(Pointcut.STORAGE_PRECOMMIT_RESOURCE_UPDATED, params);
interceptorBroadcaster.callHooks(Pointcut.STORAGE_PRESTORAGE_RESOURCE_UPDATED, preStorageParams);
// Interceptor call: STORAGE_PRECOMMIT_RESOURCE_UPDATED
HookParams preCommitParams = new HookParams()
.add(RequestDetails.class, theRequestDetails)
.addIfMatchesType(ServletRequestDetails.class, theRequestDetails)
.add(IBaseResource.class, myIdToHistory.get(theIdPart).getFirst())
.add(IBaseResource.class, theResource)
.add(TransactionDetails.class, theTransactionDetails)
.add(Boolean.class, theTransactionDetails.isPointcutDeferred(Pointcut.STORAGE_PRECOMMIT_RESOURCE_CREATED));
interceptorBroadcaster.callHooks(Pointcut.STORAGE_PRECOMMIT_RESOURCE_UPDATED, preCommitParams);
}
}