public ActivityContextImpl(ActivityContextHandle activityContextHandle, ActivityContextCacheDataWrapper cacheData, boolean updateAccessTime, ActivityContextFactoryImpl factory) { this.activityContextHandle = activityContextHandle; this.factory = factory; this.cacheData = cacheData; // set access time if needed if (updateAccessTime) { updateLastAccessTime(false); } // setup references handler if needed if (ActivityFlags.hasRequestSleeActivityGCCallback(getActivityFlags()) && !isEnding()) { acReferencesHandler = new ActivityContextReferencesHandler(this); } else { acReferencesHandler = null; } }
if (ah != null && ActivityFlags.hasRequestEndedCallback(activityFlags)) { object.activityEnded(ah);
&& !ActivityFlags.hasSleeMayMarshal(activityFlags)) { final ActivityHandleReference reference = raEntity .getHandleReferenceFactory().createActivityHandleReference(
public ActivityContextImpl( final ActivityContextHandle activityContextHandle, ActivityContextCacheDataWrapper cacheData, boolean updateAccessTime, Integer activityFlags, ActivityContextFactoryImpl factory) { this.activityContextHandle = activityContextHandle; this.factory = factory; this.cacheData = cacheData; // ac creation, create cache data and set activity flags this.cacheData.create(activityFlags); this.flags = activityFlags; // set access time if needed if (updateAccessTime) { updateLastAccessTime(true); } // setup references handler if needed if (ActivityFlags.hasRequestSleeActivityGCCallback(activityFlags) && !isEnding()) { acReferencesHandler = new ActivityContextReferencesHandler(this); } else { acReferencesHandler = null; } }
/** * Executes a non transacted start activity operation. * @param handle * @param activityFlags * @throws SLEEException */ void execute(final ActivityHandle handle, final int activityFlags, boolean suspendActivity) throws SLEEException { final SleeTransaction tx = super.suspendTransaction(); ActivityContextHandle ach = null; try { ach = sleeEndpoint._startActivity(handle, activityFlags, suspendActivity ? tx : null); } finally { if (tx != null) { super.resumeTransaction(tx); // the activity was started out of the tx but it will be suspended, if the flags request the unreferenced callback then // we can load the ac now, which will schedule a check for references in the end of the tx, this ensures that the callback is received if no events are fired or // events are fired but not handled, that is, no reference is ever ever created if (ach != null && ActivityFlags.hasRequestSleeActivityGCCallback(activityFlags)) { acFactory.getActivityContext(ach); } } } } }