public ActivityContextInterface[] getActivities() throws TransactionRequiredLocalException, IllegalStateException, SLEEException { if (logger.isTraceEnabled()) { logger.trace("getActivities() " + this.sbbObject.getState()); } if (SbbObjectState.READY != this.sbbObject.getState()) { throw new IllegalStateException( "Cannot call SbbContext.getActivities() in " + this.sbbObject.getState()); } ActivityContextFactory acf = sleeContainer.getActivityContextFactory(); List<ActivityContextInterface> result = new ArrayList<ActivityContextInterface>(); ActivityContext ac = null; for (ActivityContextHandle ach : sbbObject.getSbbEntity() .getActivityContexts()) { ac = acf.getActivityContext(ach); if (ac != null) { result.add(ac.getActivityContextInterface()); } } return result.toArray(EMPTY_ACI_ARRAY); }
public ActivityContextInterface getActivityContextInterface() { return factory.getSleeContainer().getActivityContextFactory().getActivityContext(getActivityContextHandle()).getActivityContextInterface(); }
public ActivityContextInterface getActivityContextInterface( NullActivity nullActivity) throws NullPointerException, TransactionRequiredLocalException, UnrecognizedActivityException, FactoryException { if (nullActivity == null ) throw new NullPointerException ("null NullActivity ! huh!!"); if (! (nullActivity instanceof NullActivityImpl)) throw new UnrecognizedActivityException ("unrecognized activity"); NullActivityImpl nullActivityImpl = (NullActivityImpl) nullActivity; ActivityContextHandle ach = new NullActivityContextHandle(nullActivityImpl.getHandle()); ActivityContext ac = sleeContainer.getActivityContextFactory().getActivityContext(ach); if (ac == null) { throw new UnrecognizedActivityException(nullActivity); } return ac.getActivityContextInterface(); }
public ActivityContextInterface getActivityContextInterface(TimerID timerID) throws NullPointerException, TransactionRequiredLocalException, FacilityException { if (timerID == null) { throw new NullPointerException("null timerID"); } sleeContainer.getTransactionManager().mandateTransaction(); TimerFacilityTimerTaskData taskData = (TimerFacilityTimerTaskData) scheduler.getTimerTaskData(timerID); if (taskData != null) { try { return sleeContainer.getActivityContextFactory().getActivityContext(taskData.getActivityContextHandle()).getActivityContextInterface(); } catch (Exception e) { throw new FacilityException(e.getMessage(),e); } } else { return null; } }
/** * * @param sbbEntity * @param cmpFieldName * @return */ public static ActivityContextInterface getCMPFieldOfTypeActivityContextInterface(SbbEntity sbbEntity,String cmpFieldName) { final Object cmpFieldValue = sbbEntity.getCMPField(cmpFieldName); if (cmpFieldValue == null) { return null; } else { final ActivityContext ac = sleeContainer.getActivityContextFactory().getActivityContext((ActivityContextHandle) cmpFieldValue); if (ac != null) { return sbbEntity.asSbbActivityContextInterface(ac.getActivityContextInterface()); } else { return null; } } }
public ActivityContextInterface getActivityContextInterface( ServiceActivity serviceActivityImpl) throws NullPointerException, TransactionRequiredLocalException, UnrecognizedActivityException, FactoryException { ActivityContextHandle ach = new ServiceActivityContextHandle(new ServiceActivityHandleImpl(((ServiceActivityImpl) serviceActivityImpl).getServiceID())); ActivityContext ac = sleeContainer.getActivityContextFactory().getActivityContext(ach); if (ac == null) { throw new UnrecognizedActivityException(serviceActivityImpl); } return ac.getActivityContextInterface(); }
.getActivityContext(ach); if (ac != null) { return ac.getActivityContextInterface();
.getEventHandlerMethods().get(sleeEvent.getEventTypeId()); ActivityContextInterface aci = asSbbActivityContextInterface(ac.getActivityContextInterface());
public ActivityContextInterface getActivityContextInterface( ProfileTableActivity profileTableActivity) throws NullPointerException, TransactionRequiredLocalException, UnrecognizedActivityException, FactoryException { if (profileTableActivity == null || profileTableActivity.getProfileTableName() == null) { throw new NullPointerException("null profile table activity"); } serviceContainer.getTransactionManager().mandateTransaction(); ProfileTableImpl profileTableImpl = null; try { // check if this is an assigned profile table // name. profileTableImpl = profileManagementImpl.getProfileTable(profileTableActivity.getProfileTableName()); } catch (UnrecognizedProfileTableNameException e) { throw new UnrecognizedActivityException(profileTableActivity.getProfileTableName(),e); } ActivityContext ac = profileTableImpl.getActivityContext(); if (ac == null) { throw new UnrecognizedActivityException("No resource for: "+profileTableActivity.getProfileTableName(),profileTableActivity); } return ac.getActivityContextInterface(); } }
final ActivityContextInterface aci = ac.getActivityContextInterface();