Package sg.edu.nus.comp.simTL.engine.exceptions

Examples of sg.edu.nus.comp.simTL.engine.exceptions.SynchronizingException


    templateInstance = ir.getInstance();
    ModelCorrespondence modelCorrespondence = ir.getModelCorrespondence();
   
    //validate
    if(templateInstance == null){
      throw new SynchronizingException("TemplateInstanceModel is null. Stop synchronization.");
    } else if(modelCorrespondence == null||modelCorrespondence.isEmpty()){
      throw new SynchronizingException("No explicit ModelCorrespondence given. Stop synchronization.");
    }
   
    synchronizer = SimTLFactory.createSynchronizer();
    synchronizer.startSynchronization(template, templateInstance, modelCorrespondence, decisionMaker);
   
View Full Code Here


      throws SimTLException {
    if(stillNotifying_temp){
      log.debug("Another model initialized these notifications. " +
          "As there are no indirect Views we can " +
          "ignore changeNotifactions while the initial changeNotification: " + sourceModel.getName() + " :: " + notification);
      throw new SynchronizingException("BUG: May not happen, as method is synchronized");
    }
    stillNotifying_temp = true;
    if(sourceModel.getModelType()==ModelType.TEMPLATE_MODEL
        ||sourceModel.getModelType()==ModelType.INPUT_MODEL) {
      log.warn("Changes in templateModel or instanceModel are ignored, yet");
View Full Code Here

                pPointer2Att,
                iPointer2Att,
                corrTLN.getPartOfTraceLink().getStaticContext());
          }
        } else {
          throw new SynchronizingException("Attribute in TemplateInstance is corresponding to EObject (no Attribute) in another model?");
        }
      } else {
        if(corrTLN.isAttribute()){
          EObject tObject = corrTLN.getAttribute().getParent();
          EAttribute tAtt = (EAttribute)tObject.eClass().getEStructuralFeature(iPointer2Att.getEAttribute().getName());
          if(tAtt==null) throw new SynchronizingException("No AttributeReference found with name " + iPointer2Att.getEAttribute().getName());

          tObject.eSet(tAtt, newValue);
        }
      }
    }
View Full Code Here

            decisionMaker.allocateAddOperation(tiChild,elementsInRange),tParent,tiChild);
      } else if(elementsInRange.size()==1){
        allocatedAddTo(
            elementsInRange.iterator().next(),tParent,tiChild);
      } else{
        throw new SynchronizingException("There is always at least a position!");
      }
    }
  }
View Full Code Here

       
    //PatternVersion below tObject
    EObjectTraceLinkReturnContainer tObjectETLRC = findTObject(iObject);
    EObject tParent = tObjectETLRC.getTObject();
    if(tParent==null){
      throw new SynchronizingException("Didn't find corresponding tObject for tiObject");
    }
    EReference tParent2ChildRef = (EReference)tParent.eClass().getEStructuralFeature(iReference2Element.getReferenceToChildren().getName());
    if(tParent2ChildRef==null){
      log.warn("Couldn't find tParentRef with name " + iReference2Element.getReferenceToChildren().getName());
    }
View Full Code Here

    EObject tObject = null;
    TraceLink tl = null;
    int i = 0;
    for(TraceLinkNode tObjectTLN : modelCorrespondence.getCorrespondingElement(tiObject)){
      if(tObjectTLN.getModel().getModelType()!=ModelType.TEMPLATE_MODEL){
        throw new SynchronizingException("ME2MELink pointed from template instance to " + tObjectTLN.getModel().getModelType().toString());
      }
      if(tObjectTLN.isAttribute()){
        throw new SynchronizingException("ModelElement in TemplateInstance is corresponding to attribute in template model");
      }
      if(tObject!=null){
        throw new SynchronizingException("There can only be one TraceLink for one element in TemplateInstance");
      }
      tObject=tObjectTLN.getModelElement();
      tl=tObjectTLN.getPartOfTraceLink();
      i++;
    }
    if(i>1) log.info("BUG: More corresponding tObjects!");
    if(i==0){
      //FIXME As for now we through an exception later we could try to tolerate
      // a certain degree of inconsistency
      throw new SynchronizingException("Didn't find corresponding tObject for tiObject");
    }
    return new EObjectTraceLinkReturnContainer(tObject,tl);
  }
View Full Code Here

  public GrayElementAddAllocation(AllocationType type, GrayPath grayPath, IContext context) throws SimTLException {
    super(type, context);
    this.grayPath = grayPath;
    if(type==AllocationType.FOR_NEWIT&&!(this instanceof NewIterationAddAllocation))
        throw new SimTLException("Use NewIterationAddAllocation instead!");
    if(grayPath==null) throw new SynchronizingException("GrayPath cannot be null");
    if(grayPath.getLeaf()==null) throw new SynchronizingException("GrayPath-Element cannot be null");
  }
View Full Code Here

  public PositionAddAllocation(AllocationType allocationType, EObject tParent, EReference referenceFromParent, Integer position, IContext referencedContext) throws SimTLException{
    super(allocationType, referencedContext);
    this.tParent = tParent;
    this.referenceFromParent = referenceFromParent;
    this.position = position;
    if(tParent==null) throw new SynchronizingException("tParent cannot be null");
    if(referenceFromParent==null) throw new SynchronizingException("referenceFromParent cannot be null");
    if(position==null) throw new SynchronizingException("Position cannot be null");
  }
View Full Code Here

 
  public void removeElement(EObject pElement, ReferenceFromParent pointerToList) throws SimTLException{
    log.debug("Remove element from parameterModel: " + Util.getFullName(pElement));
    List<?> parameterList = (List<?>)pointerToList.getReferencedValue();
    if(!parameterList.contains(pElement)){
      throw new SynchronizingException("InputModel collection doesn't contain inputModel element");
    }
    parameterList.remove(pElement);
   
    //TODO Remove all tracelinks of attributes to placeholder
    //below this element recursively
View Full Code Here

TOP

Related Classes of sg.edu.nus.comp.simTL.engine.exceptions.SynchronizingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.