@Commit private void FixupRecordPersonIds() { for (PersonInfo pi : getPersonInfoList()) { String personId = pi.getPersonId(); for (Record r : pi.getRecords()) { r.setPersonId(personId); } } }
/** * This function is called by SimpleXML after deserialisation in order to * recreate the map of equipment cofngiurations from the list. */ @Commit public void build() { for (EquipmentConfiguration configuration : equipmentConfigurationList) { equipmentConfigurations.put(configuration.getId(), configuration); } }
/** * Is responsible for solving dependencies child elements/objects may have on the P-Mode id. Currently this applies * to the identification of the delivery specifications included in the P-Mode. Because the Holodeck B2B Core * requires each delivery specification to have a unique id to enable reuse each delivery specification included in * the P-Mode is given an id combined of the P-Mode id, current time and type of delivery, for example the default * delivery specification defined on the Leg will have «P-Mode id»+"-"+«hhmmss» +"-defaultDelivery" as id. * <p>The objects containing the {@link DeliverySpecification}s are responsible for including these in the given * <code>Map</code> using the type of delivery as key and the object as value. * * @param dependencies A <code>Map</code> containing all {@link DeliverySpecification} objects that have to be * assigned an id. The key of the entry MUST be a <code>String</code> containing the type * of delivery, e.g. "defaultDelivery". */ @Commit public void solveDepencies(final Map dependencies) { if (dependencies == null) return; for(final Object k : dependencies.keySet()) { final Object dep = dependencies.get(k); if (k instanceof String && dep != null && dep instanceof DeliverySpecification) ((DeliverySpecification) dep).setId(this.pmodeId.id + "-" + new SimpleDateFormat("HHmmss").format(new Date()) + "-" + k); } }
/** * This method ensures that the {@link DeliverySpecification} for the default delivery method gets an unique id * based on the P-Mode id. Because we do not know the P-Mode id here we use the <i>commit</i> functionality of the * Simple framework (see <a href="http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#state"> * http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#state</a>). We put the <code> * defaultDelivery</code> object in the deserialization session so {@link PMode#solveDepencies(java.util.Map)} can * set the id using the P-Mode id. * * @param dependencies The Simple session object. */ @Commit public void setDepency(final Map dependencies) { if (defaultDelivery != null) { // Because multiple DefaultDelivery elements can exist in the P-Mode document when we enable Two-Way MEPs, // we make sure it get a unique id int i = 0; while (dependencies.containsKey("DefaultDelivery-" + i)) i++; dependencies.put("DefaultDelivery-"+i, defaultDelivery); } }
/** * This method ensures that the {@link DeliverySpecification} for the receipt delivery method gets an unique id * based on the P-Mode id. Because we do not know the P-Mode id here we use the <i>commit</i> functionality of the * Simple framework (see <a href="http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#state"> * http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#state</a>). We put the <code> * receiptDelivery</code> object in the deserialization session so {@link PMode#solveDepencies(java.util.Map)} can * set the id using the P-Mode id. * * @param dependencies The Simple session object. */ @Commit public void setDepency(final Map dependencies) { if (receiptDelivery != null) { // Because multiple ReceiptDelivery elements can exist in the P-Mode document when we enable Two-Way MEPs, // we make sure it get a unique id int i = 0; while (dependencies.containsKey("ReceiptDelivery-" + i)) i++; dependencies.put("ReceiptDelivery-"+i, receiptDelivery); } }
@Commit public void build() throws PersistenceException { for(Behavior behavior : allowedBehaviors) { behavior.question = questionMap.get(behavior.questionId); } for(AdditionalInformation ai : additionalInformation) { ai.behavior = behaviorMap.get(ai.behaviorId); } super.build(); }
@Commit public void build() throws PersistenceException { try { if(filenameBackgroundProgram != null) { backgroundKnowledge = ASPParser.parseProgram(new FileReader(filenameBackgroundProgram)); } } catch (FileNotFoundException | ParseException e) { throw new PersistenceException("Cannot parse background program in '" + filenameBackgroundProgram + "' - " + e.getMessage()); } }
@Commit public void onDeserialization() { AngeronaEnvironment sim = Angerona.getInstance().getActualSimulation(); if(sim != null) { setAgent(sim.getAgentByName(sender)); } }
@Commit public void commit() { for(AgentInstance ai : agents) { for(String viewedAgent : ai.fileViewMap.keySet()) { File f = ai.fileViewMap.get(viewedAgent); BeliefbaseConfigReal conf = SerializeHelper.get().loadXmlTry( BeliefbaseConfigReal.class, f); ai.realViewMap.put(viewedAgent, conf); } } }
@Commit protected void createOperationTypes() { // extract operation type from element name... ((OperationSetConfigReal)reasonerOperators).operationType = BaseReasoner.OPERATION_TYPE; ((OperationSetConfigReal)changeOperators).operationType = BaseChangeBeliefs.OPERATION_TYPE; ((OperationSetConfigReal)this.translators).operationType = BaseTranslator.OPERATION_TYPE; }
@Commit private void fixUpInternalThingReference() { dataXml.getAny().setThing(this); }
@Commit public void commit(Map map) { if(validated) { committed = true; } }
@Commit private void prepare() { if(trim) { text = text.trim(); } }
@Commit public void commit(Map map) { map.put(name, value); }
/** * Is a helper to construct the {@link Interval} object. Uses the commit function of the Simple framework. */ @Commit public void calculateInterval() { retryInterval = new Interval(retryIntervalDuration, TimeUnit.SECONDS); }
@Commit public void build() { MyApplication.d(LOG_TAG + "build() description [" + description + "]"); }
/** * This method ensures that the {@link DeliverySpecification} for the error delivery method gets an unique id * based on the P-Mode id. Because we do not know the P-Mode id here we use the <i>commit</i> functionality of the * Simple framework (see <a href="http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#state"> * http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#state</a>). We put the <code> * errorDelivery</code> object in the deserialization session so {@link PMode#solveDepencies(java.util.Map)} can * set the id using the P-Mode id. * * @param dependencies The Simple session object. */ @Commit public void setDepency(final Map dependencies) { if (errorDelivery != null) { // Because multiple ErrorDelivery elements can exist in the P-Mode document we make sure it get a unique id int i = 0; while (dependencies.containsKey("ErrorDelivery-" + i)) i++; dependencies.put("ErrorDelivery-"+i, errorDelivery); } }