public NullActivity createNullActivityNoTx() throws FactoryException { try { return createNullActivityImpl(false); } catch (TransactionRequiredLocalException e) { throw new FactoryException("Failed to create null activity without tx. Exception msg: "+e.getMessage()); } }
public ServiceActivity getActivity() throws TransactionRequiredLocalException, FactoryException { final SleeContainer sleeContainer = serviceManagement.getSleeContainer(); final SleeTransactionManager stm = sleeContainer.getTransactionManager(); stm.mandateTransaction(); ServiceID serviceID = SleeThreadLocals.getInvokingService(); if (serviceID == null) { throw new FactoryException("unable to find out the invoking service id"); } return new ServiceActivityImpl(serviceID); }
public ServiceActivity getActivity() throws TransactionRequiredLocalException, FactoryException { SleeTransactionManager stm = SleeContainer.getTransactionManager(); stm.mandateTransaction(); ServiceID serviceID = (ServiceID) stm.getTxLocalData(TXLOCALDATA_SERVICEID_KEY); try { return SleeContainer.lookupFromJndi().getService(serviceID).getServiceActivity(); } catch ( Exception ex ) { throw new FactoryException ("cannot get service activity for " + serviceID); } }
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; }
public ActivityContextInterface getActivityContextInterface( ProfileTableActivity profileTableActivity) throws NullPointerException, TransactionRequiredLocalException, UnrecognizedActivityException, FactoryException { if ( profileTableActivity == null || profileTableActivity.getProfileTableName() == null) { throw new NullPointerException("null profile table activity"); } SleeContainer serviceContainer = getServiceContainer(); SleeContainer.getTransactionManager().mandateTransaction(); try { // check if this is an assigned profile table // name. SleeProfileManager.getInstance().profileTableExists(profileTableActivity.getProfileTableName()); } catch (SystemException e) { throw new FactoryException(e.getMessage()); } String acid = serviceContainer.getActivityContextFactory().getActivityContextId(profileTableActivity); ActivityContextInterfaceImpl acii = new ActivityContextInterfaceImpl(serviceContainer, acid ); return acii; }