/** * Determines into which store workitems should go. */ protected WorkItemStore determineStore (final InFlowItem item) { WorkItemStore defaultStore = null; final String participantName = item.getParticipantName(); final java.util.Iterator it = getContext().itemsOfClass(WorkItemStore.class).iterator(); while (it.hasNext()) { final WorkItemStore s = (WorkItemStore)it.next(); if (s.acceptsWorkItemsFor(participantName)) return s; if (s.isDefaultStore()) defaultStore = s; } return defaultStore; // default }
masterWi = getStore().getAndLock(null, masterId); getStore().release(null, masterId);
/** * A short cut to get the parent store's name. */ public String getStoreName () { return this.store.getName(); }
store.get(getSubject(), item.getLastExpressionId());
/** * Performs the initialization of the strategy (give it enough * info to do its task). */ public void init (final ApplicationContext context, final WorkItemStore store, final java.util.Map storeParams, final String storageName) throws StoreException { super.init(context, store, storeParams, storageName); this.cacheFileName = MapUtils.getAsString (storeParams, P_CACHE_FILE_NAME, DEFAULT_CACHE_FILE_NAME); log.debug("init() using cache at "+this.cacheFileName); this.slaveStoreName = MapUtils.getAsString (storeParams, P_SLAVE_STORE_NAME, store.getName()+"_cslaves"); log.debug("init() slaveStoreName set to "+this.slaveStoreName); loadState(); }
private InFlowWorkItem mergeMaster (final InFlowWorkItem incomingMaster) throws StoreException { final InFlowWorkItem currentMaster = getStorage().retrieveWorkItem (getStore().getName(), incomingMaster.getLastExpressionId()); //log.debug // ("mergeMaster() 0 currentMaster.fieldCount : "+ // currentMaster.getAttributes().size()); //log.debug // ("mergeMaster() 0 incomingMaster.fieldCount : "+ // incomingMaster.getAttributes().size()); //log.debug // ("mergeMaster() 0 currentMaster :\n"+ // XmlBeanCoder.dumpToString(currentMaster)); //log.debug // ("mergeMaster() 0 incomingMaster :\n"+ // XmlBeanCoder.dumpToString(incomingMaster)); MergeUtils.mergeInPlace(currentMaster, incomingMaster); //log.debug // ("mergeMaster() 1 currentMaster.fieldCount : "+ // currentMaster.getAttributes().size()); //log.debug // ("mergeMaster() 1 currentMaster :\n"+ // XmlBeanCoder.dumpToString(currentMaster)); return currentMaster; }