|
@@ -29,8 +29,7 @@ |
29 |
29 |
|
|
30 |
30 |
|
public TransactionImpl( NonTransactionalFinder pNonTransactionalFinder, boolean pAugment ) |
31 |
31 |
|
{ |
32 |
|
- |
super( ORFacilitatorImpl.getInstance( pNonTransactionalFinder ), LOGGER, |
33 |
|
- |
pNonTransactionalFinder.isIncludingImmortalInactives(), // |
|
32 |
+ |
super( ORFacilitatorImpl.getInstance( pNonTransactionalFinder ), LOGGER, pNonTransactionalFinder.isIncludingImmortalInactives(), // |
34 |
33 |
|
pNonTransactionalFinder.getPOQueryFilterFactory() ); |
35 |
34 |
|
mNonTransactionalFinder = pNonTransactionalFinder; |
36 |
35 |
|
mID = getNextSequenceNumber( "Transactions" ); |
|
@@ -45,9 +44,7 @@ |
45 |
44 |
|
{ |
46 |
45 |
|
zHAfactory = zTAM.getHistoryAugmentorFactory(); |
47 |
46 |
|
zTAfactories = // Grab the current list |
48 |
|
- |
(zTAM instanceof TransactionAugmentationManagerInternalExtension) ? |
49 |
|
- |
((TransactionAugmentationManagerInternalExtension) zTAM).getRawTransactionAugmentorsArray() : |
50 |
|
- |
zTAM.getTransactionAugmentors(); |
|
47 |
+ |
(zTAM instanceof TransactionAugmentationManagerInternalExtension) ? ((TransactionAugmentationManagerInternalExtension) zTAM).getRawTransactionAugmentorsArray() : zTAM.getTransactionAugmentors(); |
51 |
48 |
|
} |
52 |
49 |
|
} |
53 |
50 |
|
mHistoryAugmentor = (zHAfactory != null) ? zHAfactory.createHistoryAugmentor() : null; |
|
@@ -196,8 +193,7 @@ |
196 |
193 |
|
{ |
197 |
194 |
|
if ( !mParticipantsManager.isEmpty() ) |
198 |
195 |
|
{ |
199 |
|
- |
throw new IllegalStateException( |
200 |
|
- |
"DeleteAugmentor may only be added BEFORE any POs are added to the Transaction" ); |
|
196 |
+ |
throw new IllegalStateException( "DeleteAugmentor may only be added BEFORE any POs are added to the Transaction" ); |
201 |
197 |
|
} |
202 |
198 |
|
mDeleteAugmentors.add( new DA_LinkListNode( pDeleteAugmentor ) ); |
203 |
199 |
|
} |
|
@@ -236,8 +232,7 @@ |
236 |
232 |
|
return getRequiredMetaDataForPO( pPersistedObjectRegistrationName ).createNew( this ); |
237 |
233 |
|
} |
238 |
234 |
|
|
239 |
|
- |
@SuppressWarnings({"unchecked"}) |
240 |
|
- |
@Override |
|
235 |
+ |
@SuppressWarnings({"unchecked"}) @Override |
241 |
236 |
|
public <T extends PersistentObject> T create( Class<T> pPersistedObjectClass ) |
242 |
237 |
|
throws DBException |
243 |
238 |
|
{ |
|
@@ -272,8 +267,7 @@ |
272 |
267 |
|
PersistentObject<?> existing = getPersistentObjectFromIdentityMap( url ); |
273 |
268 |
|
if ( existing != null ) |
274 |
269 |
|
{ |
275 |
|
- |
throw new UnsupportedOperationException( |
276 |
|
- |
pPersistedObject.getDisplayValue() + " already in the Transaction" ); |
|
270 |
+ |
throw new UnsupportedOperationException( pPersistedObject.getDisplayValue() + " already in the Transaction" ); |
277 |
271 |
|
} |
278 |
272 |
|
// todo: Caches |
279 |
273 |
|
//noinspection unchecked |
|
@@ -355,8 +349,9 @@ |
355 |
349 |
|
/** |
356 |
350 |
|
* Under rare circumstances, a POs Key Vvlaues are changed and the Transaction must re-index it! |
357 |
351 |
|
* <p/> |
|
352 |
+ |
* |
358 |
353 |
|
* @param pOrigURL !null |
359 |
|
- |
* @param pNewURL !null |
|
354 |
+ |
* @param pNewURL !null |
360 |
355 |
|
*/ |
361 |
356 |
|
@Override |
362 |
357 |
|
public void changedURL( PersistentObjectURL pOrigURL, PersistentObjectURL pNewURL ) |
|
@@ -371,9 +366,7 @@ |
371 |
366 |
|
|
372 |
367 |
|
mParticipantsManager.initiateCommitting( zParticipants ); |
373 |
368 |
|
|
374 |
|
- |
DataStoreChangeCollector zAllCollector = new DataStoreChangeCollector( getTransactionID(), |
375 |
|
- |
getTransactionSourceClassname(), |
376 |
|
- |
mXtraData ); |
|
369 |
+ |
DataStoreChangeCollector zAllCollector = new DataStoreChangeCollector( getTransactionID(), getTransactionSourceClassname(), mXtraData ); |
377 |
370 |
|
try |
378 |
371 |
|
{ |
379 |
372 |
|
if ( !zParticipants.isEmpty() ) |
|
@@ -404,9 +397,7 @@ |
404 |
397 |
|
|
405 |
398 |
|
TransactionCommitListenerManager zManager = getTransactionCommitListenerManager(); |
406 |
399 |
|
TransactionCommitListener[] zListeners = // Grab the current list |
407 |
|
- |
(zManager instanceof TransactionCommitListenerManagerInternalExtension) ? |
408 |
|
- |
((TransactionCommitListenerManagerInternalExtension) zManager).getRawTransactionCommitListenersArray() : |
409 |
|
- |
zManager.getListeners(); |
|
400 |
+ |
(zManager instanceof TransactionCommitListenerManagerInternalExtension) ? ((TransactionCommitListenerManagerInternalExtension) zManager).getRawTransactionCommitListenersArray() : zManager.getListeners(); |
410 |
401 |
|
|
411 |
402 |
|
if ( zListeners.length == 0 ) |
412 |
403 |
|
{ |
|
@@ -414,11 +405,9 @@ |
414 |
405 |
|
} |
415 |
406 |
|
else |
416 |
407 |
|
{ |
417 |
|
- |
TransactionSuccessfulCommitCallBack[] zCallBacks = |
418 |
|
- |
new TransactionSuccessfulCommitCallBack[zListeners.length]; |
|
408 |
+ |
TransactionSuccessfulCommitCallBack[] zCallBacks = new TransactionSuccessfulCommitCallBack[zListeners.length]; |
419 |
409 |
|
|
420 |
|
- |
PersistentObject[] zCommiting = |
421 |
|
- |
commiting.toArray( new PersistentObject[commiting.size()] ); |
|
410 |
+ |
PersistentObject[] zCommiting = commiting.toArray( new PersistentObject[commiting.size()] ); |
422 |
411 |
|
|
423 |
412 |
|
for ( int i = 0; i < zListeners.length; i++ ) |
424 |
413 |
|
{ |
|
@@ -449,12 +438,9 @@ |
449 |
438 |
|
} |
450 |
439 |
|
} |
451 |
440 |
|
} |
452 |
|
- |
SucceededTransactionCommitListenerManager zManager = |
453 |
|
- |
getSucceededTransactionCommitListenerManager(); |
|
441 |
+ |
SucceededTransactionCommitListenerManager zManager = getSucceededTransactionCommitListenerManager(); |
454 |
442 |
|
SucceededTransactionCommitListener[] zListeners = // Grab the current list |
455 |
|
- |
(zManager instanceof SucceededTransactionCommitListenerManagerInternalExtension) ? |
456 |
|
- |
((SucceededTransactionCommitListenerManagerInternalExtension) zManager).getRawTransactionCommitListenersArray() : |
457 |
|
- |
zManager.getListeners(); |
|
443 |
+ |
(zManager instanceof SucceededTransactionCommitListenerManagerInternalExtension) ? ((SucceededTransactionCommitListenerManagerInternalExtension) zManager).getRawTransactionCommitListenersArray() : zManager.getListeners(); |
458 |
444 |
|
|
459 |
445 |
|
collector.commitSucceeded( mTransactionSourceClassname, zListeners, mParticipantsManager ); |
460 |
446 |
|
} |
|
@@ -543,8 +529,7 @@ |
543 |
529 |
|
e.setWithPO( pPO ); |
544 |
530 |
|
throw e; |
545 |
531 |
|
} |
546 |
|
- |
throw new IllegalStateException( |
547 |
|
- |
"Unexpected CommitAction '" + zCommitAction + "' on " + pPO.getObjectName() + ": " + pPO ); |
|
532 |
+ |
throw new IllegalStateException( "Unexpected CommitAction '" + zCommitAction + "' on " + pPO.getObjectName() + ": " + pPO ); |
548 |
533 |
|
} |
549 |
534 |
|
|
550 |
535 |
|
@Override |
|
@@ -553,8 +538,7 @@ |
553 |
538 |
|
throws DBException |
554 |
539 |
|
{ |
555 |
540 |
|
// 1st we need to check into our transaction... |
556 |
|
- |
PersistentObject<?> po = getPersistentObjectFromIdentityMap( |
557 |
|
- |
new PersistentObjectURL( pPersistedObjectRegistrationName, pPersistentObjectUniqueKey ) ); |
|
541 |
+ |
PersistentObject<?> po = getPersistentObjectFromIdentityMap( new PersistentObjectURL( pPersistedObjectRegistrationName, pPersistentObjectUniqueKey ) ); |
558 |
542 |
|
return (po != null) ? new FindOneCacheResult( po ) : null; |
559 |
543 |
|
} |
560 |
544 |
|
|
|
@@ -588,8 +572,7 @@ |
588 |
572 |
|
return rv; |
589 |
573 |
|
} |
590 |
574 |
|
|
591 |
|
- |
@SuppressWarnings("unchecked") |
592 |
|
- |
@Override |
|
575 |
+ |
@SuppressWarnings("unchecked") @Override |
593 |
576 |
|
public <T extends PersistentObjectImpl> T addPO( T pPersistentObject ) |
594 |
577 |
|
{ |
595 |
578 |
|
return (T) mParticipantsManager.addPO( pPersistentObject ); |