/** * */ public void endActivity() { ActivityContext ac = getActivityContext(); if (ac != null) { ac.endActivity(); } }
public void endActivity() throws TransactionRequiredLocalException, SLEEException { // Check if in valid context. if (logger.isDebugEnabled()) { logger.debug("NullActivity.endActivity()"); } sleeContainer.getTransactionManager().mandateTransaction(); sleeContainer.getActivityContextFactory().getActivityContext( new NullActivityContextHandle(handle)) .endActivity(); }
.getActivityContext(handle); if (ac != null) { ac.endActivity();
public void failOverClusterMember(Address arg0) { // lets search and end all ACs that were local to the node which failed final ActivityContextFactory acFactory = resourceManagement.getSleeContainer() .getActivityContextFactory(); // ouch, this is going to be expensive for (ActivityContextHandle ach : acFactory.getAllActivityContextsHandles(ActivityType.RA)) { final ResourceAdaptorActivityContextHandleImpl raach = (ResourceAdaptorActivityContextHandleImpl) ach; if (raach.getActivityHandle().getClass() == ActivityHandleReference.class) { final ActivityHandleReference reference = (ActivityHandleReference) raach.getActivityHandle(); if (reference.getAddress().equals(arg0)) { final ActivityContext ac = acFactory.getActivityContext(raach); if (ac != null) { ac.endActivity(); } } } } }
public void activityUnreferenced() { if (logger.isDebugEnabled()) { logger.debug("Activity Context with handle " + activityContextHandle + " is now unreferenced"); } switch (activityContextHandle.getActivityType()) { case RA: // external activity, notify RA that the activity is unreferenced ((ResourceAdaptorActivityContextHandle) activityContextHandle) .getResourceAdaptorEntity() .getResourceAdaptorObject() .activityUnreferenced( activityContextHandle.getActivityHandle()); break; case NULL: // null activity unreferenced, end it ActivityContext ac = sleeContainer.getActivityContextFactory() .getActivityContext(activityContextHandle); if (ac != null) ac.endActivity(); break; default: // do nothing break; } }
ac.endActivity(); } else { throw new UnrecognizedActivityHandleException(handle.toString());