/** * */ public void startActivity() { sleeContainer.getActivityContextFactory().createActivityContext(getActivityContextHandle(),ActivityFlags.NO_FLAGS); }
public NullActivityImpl createNullActivity( NullActivityHandle nullActivityHandle, boolean mandateTransaction) throws TransactionRequiredLocalException, FactoryException { // check mandated by SLEE TCK test CreateActivityWhileStoppingTest if (sleeContainer.getSleeState() != SleeState.RUNNING) { return null; } if (mandateTransaction) { sleeContainer.getTransactionManager().mandateTransaction(); } // create activity NullActivityImpl nullActivity = new NullActivityImpl(nullActivityHandle); // get an activity context for it try { sleeContainer.getActivityContextFactory().createActivityContext( new NullActivityContextHandle(nullActivityHandle), ActivityFlags.REQUEST_ACTIVITY_UNREFERENCED_CALLBACK); } catch (ActivityAlreadyExistsException e) { throw new FactoryException(e.getMessage(), e); } if (logger.isDebugEnabled()) { logger .debug("NullActivityFactory.createNullActivity() Created null activity " + nullActivity); } return nullActivity; }
private void startActivity(final ServiceComponent serviceComponent) { // create ac for the activity ActivityContextHandle ach = new ServiceActivityContextHandle( new ServiceActivityHandleImpl(serviceComponent.getServiceID())); ActivityContext ac = sleeContainer.getActivityContextFactory() .createActivityContext(ach, ActivityFlags.NO_FLAGS); if (logger.isDebugEnabled()) { logger.debug("Starting " + serviceComponent.getServiceID() + " activity."); } serviceComponent.setActivityEnded(false); // fire slee 1.0 and 1.1 service started events ServiceStartedEventImpl event = new ServiceStartedEventImpl( serviceComponent.getServiceID()); ac.fireEvent(ServiceStartedEventImpl.SLEE_10_EVENT_TYPE_ID, event, null, null, null, null, null); ac.fireEvent(ServiceStartedEventImpl.SLEE_11_EVENT_TYPE_ID, event, null, event.getService(), null, null, null); }
try { ac = acFactory.createActivityContext( new ResourceAdaptorActivityContextHandleImpl(raEntity, reference), activityFlags); ac = acFactory.createActivityContext( new ResourceAdaptorActivityContextHandleImpl(raEntity, handle), activityFlags);