e.printStackTrace(); } catch (ActivityIsEndingException e) { e.printStackTrace(); } catch (UnrecognizedActivityException e) { e.printStackTrace();
public void fireEvent(EventTypeID eventTypeId, Object event, Address address, ServiceID serviceID, EventContext reference) throws ActivityIsEndingException, SLEEException { if (isEnding()) { throw new ActivityIsEndingException(getActivityContextHandle() .toString()); } if (acReferencesHandler != null) { acReferencesHandler.eventReferenceCreated(); } fireEvent( sleeContainer.getEventContextFactory().createEventContext( eventTypeId, event, this, address, serviceID, reference), sleeContainer .getTransactionManager().getTransactionContext()); }
public void fireEvent(EventTypeID eventTypeId, Object event, Address address, ServiceID serviceID, EventProcessingSucceedCallback succeedCallback, EventProcessingFailedCallback failedCallback, EventUnreferencedCallback unreferencedCallback) throws ActivityIsEndingException, SLEEException { if (isEnding()) { throw new ActivityIsEndingException(getActivityContextHandle() .toString()); } if (acReferencesHandler != null) { acReferencesHandler.eventReferenceCreated(); } fireEvent( sleeContainer.getEventContextFactory().createEventContext( eventTypeId, event, this, address, serviceID, succeedCallback, failedCallback, unreferencedCallback), sleeContainer.getTransactionManager().getTransactionContext()); }
private ActivityContext getActivityContext(SleeActivityHandle handle) throws ActivityIsEndingException, IllegalStateException, SystemException { String activityContextId; if((activityContextId = sleeContainer.getActivityContextFactory().getActivityContextId(handle)) == null) { // ac does not exist if(sleeContainer.getSleeState().equals(SleeState.STOPPING)) { return null; } else if(sleeContainer.getSleeState().equals(SleeState.STOPPED)) { // FIXME check it's right throw new IllegalStateException(); } else { return sleeContainer.getActivityContextFactory().getActivityContext(handle); } } else { // ac exists, retreive it ActivityContext ac = sleeContainer.getActivityContextFactory().getActivityContextById(activityContextId); // check state if (!ac.getState().equals(ActivityContextState.ACTIVE)) { throw new ActivityIsEndingException ("activity is ending/ended!"); } return ac; } }