コード例 #1
0
 public boolean evaluate(Object candidate) {
   ComponentResultSet_c selected = (ComponentResultSet_c) candidate;
   boolean retval = false;
   retval =
       (selected.getName().equals(m_p39975))
           & (selected.getType() == (m_p39976))
           & (selected.getId().equals(m_p39977));
   return retval;
 }
コード例 #2
0
 public static void batchRelateAll(
     ModelRoot modelRoot, boolean notifyChanges, boolean searchAllRoots, boolean relateProxies) {
   InstanceList instances = modelRoot.getInstanceList(ComponentResultSet_c.class);
   synchronized (instances) {
     Iterator<NonRootModelElement> cursor = instances.iterator();
     while (cursor.hasNext()) {
       final ComponentResultSet_c inst = (ComponentResultSet_c) cursor.next();
       inst.batchRelate(modelRoot, relateProxies, notifyChanges, searchAllRoots);
     }
   }
 }
コード例 #3
0
  // end declare accessors
  public static void checkClassConsistency(ModelRoot modelRoot) {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Component Result Set", //$NON-NLS-1$
        " Operation entered: Component Result Set::checkClassConsistency"); //$NON-NLS-1$
    if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$
      return;
    }
    ComponentResultSet_c[] objs =
        ComponentResultSet_c.ComponentResultSetInstances(modelRoot, null, false);

    for (int i = 0; i < objs.length; i++) {
      objs[i].checkConsistency();
    }
  }
コード例 #4
0
 public static ComponentResultSet_c createProxy(
     ModelRoot modelRoot,
     java.util.UUID p_m_id,
     String p_m_name,
     int p_m_type,
     String p_contentPath,
     IPath p_localPath) {
   ModelRoot resolvedModelRoot = ModelRoot.findModelRoot(modelRoot, p_contentPath, p_localPath);
   // if a model root was not resolved it is most likely
   // due to a missing file of the proxy, defualt back to
   // the original model root
   if (resolvedModelRoot != null) modelRoot = resolvedModelRoot;
   InstanceList instances = modelRoot.getInstanceList(ComponentResultSet_c.class);
   ComponentResultSet_c new_inst = null;
   synchronized (instances) {
     Object[] key = {p_m_name, p_m_id};
     new_inst = (ComponentResultSet_c) instances.get(key);
   }
   String contentPath = PersistenceUtil.resolveRelativePath(p_localPath, new Path(p_contentPath));
   if (modelRoot.isNewCompareRoot()) {
     // for comparisons we do not want to change
     // the content path
     contentPath = p_contentPath;
   }
   if (new_inst != null && !modelRoot.isCompareRoot()) {
     PersistableModelComponent pmc = new_inst.getPersistableComponent();
     if (pmc == null) {
       // dangling reference, redo this instance
       new_inst.batchUnrelate();
       new_inst.m_name = p_m_name;
       new_inst.m_type = p_m_type;
       // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
       new_inst.m_id = IdAssigner.preprocessUUID(p_m_id);
     }
   }
   if (new_inst == null) {
     // there is no instance matching the id, create a proxy
     // if the resource doesn't exist then this will be a dangling reference
     new_inst = new ComponentResultSet_c(modelRoot, p_m_id, p_m_name, p_m_type);
     new_inst.m_contentPath = contentPath;
   }
   return new_inst;
 }
コード例 #5
0
  public static ComponentResultSet_c resolveInstance(
      ModelRoot modelRoot, java.util.UUID p_m_id, String p_m_name, int p_m_type) {
    InstanceList instances = modelRoot.getInstanceList(ComponentResultSet_c.class);
    ComponentResultSet_c source = null;
    synchronized (instances) {
      Object[] key = {p_m_name, new UUID(0, new Long(p_m_type)), p_m_id};
      source = (ComponentResultSet_c) instances.get(key);
      if (source != null && !modelRoot.isCompareRoot()) {
        source.convertFromProxy();
        source.batchUnrelate();
        source.m_name = p_m_name;
        source.m_type = p_m_type;
        // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
        source.m_id = IdAssigner.preprocessUUID(p_m_id);

        return source;
      }
    }
    // there is no instance matching the id
    ComponentResultSet_c new_inst = new ComponentResultSet_c(modelRoot, p_m_id, p_m_name, p_m_type);
    return new_inst;
  }
コード例 #6
0
  public boolean checkConsistency() {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Component Result Set", //$NON-NLS-1$
        " Operation entered: Component Result Set::checkConsistency"); //$NON-NLS-1$
    if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$
      return true;
    }
    ModelRoot modelRoot = getModelRoot();
    boolean retval = true;
    class ComponentResultSet_c_test39974_c implements ClassQueryInterface_c {
      ComponentResultSet_c_test39974_c(String p39975, int p39976, java.util.UUID p39977) {
        m_p39975 = p39975;
        m_p39976 = p39976;
        m_p39977 = p39977;
      }

      private String m_p39975;
      private int m_p39976;
      private java.util.UUID m_p39977;

      public boolean evaluate(Object candidate) {
        ComponentResultSet_c selected = (ComponentResultSet_c) candidate;
        boolean retval = false;
        retval =
            (selected.getName().equals(m_p39975))
                & (selected.getType() == (m_p39976))
                & (selected.getId().equals(m_p39977));
        return retval;
      }
    }

    ComponentResultSet_c[] objs39973 =
        ComponentResultSet_c.ComponentResultSetInstances(
            modelRoot, new ComponentResultSet_c_test39974_c(getName(), getType(), getId()));

    if (((objs39973.length) == 0)) {

      if (CorePlugin.getDefault().isDebugging()) {
        Ooaofooa.log.println(
            ILogger.CONSISTENCY,
            "Component Result Set", //$NON-NLS-1$
            "Consistency: Object: Component Result Set: Cardinality of an identifier is zero. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs39973.length)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CorePlugin.logError(
            "Consistency: Object: Component Result Set: Cardinality of an identifier is zero. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs39973.length),
            e);
      }
      retval = false;
    }

    if (((objs39973.length) > 1)) {

      if (CorePlugin.getDefault().isDebugging()) {
        Ooaofooa.log.println(
            ILogger.CONSISTENCY,
            "Component Result Set", //$NON-NLS-1$
            "Consistency: Object: Component Result Set: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs39973.length)
                + " Name: "
                + getName()
                + " Type: "
                + Integer.toString(getType())
                + " Id: "
                + "Not Printable"); //$NON-NLS-1$
      } else {
        Exception e = new Exception();
        CorePlugin.logError(
            "Consistency: Object: Component Result Set: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs39973.length)
                + " Name: "
                + getName()
                + " Type: "
                + Integer.toString(getType())
                + " Id: "
                + "Not Printable",
            e); //$NON-NLS-1$
      }
      retval = false;
    }

    // Component Result Set is a referring class in association: rel.Numb = 8007
    // The participating class is: Component
    class Component_c_test39981_c implements ClassQueryInterface_c {
      Component_c_test39981_c(java.util.UUID p39982) {
        m_p39982 = p39982;
      }

      private java.util.UUID m_p39982;

      public boolean evaluate(Object candidate) {
        Component_c selected = (Component_c) candidate;
        boolean retval = false;
        retval = (selected.getId().equals(m_p39982));
        return retval;
      }
    }

    Component_c[] objs39980 =
        Component_c.ComponentInstances(modelRoot, new Component_c_test39981_c(getId()));

    // The participant is unconditional
    // The multiplicity of the participant is one
    if (((objs39980.length) != 1)) {

      if (CorePlugin.getDefault().isDebugging()) {
        Ooaofooa.log.println(
            ILogger.CONSISTENCY,
            "Component Result Set", //$NON-NLS-1$
            "Consistency: Object: Component Result Set: Association: 8007: Cardinality of a participant is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs39980.length)
                + " Id: "
                + "Not Printable"); //$NON-NLS-1$
      } else {
        Exception e = new Exception();
        CorePlugin.logError(
            "Consistency: Object: Component Result Set: Association: 8007: Cardinality of a participant is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs39980.length)
                + " Id: "
                + "Not Printable",
            e); //$NON-NLS-1$
      }
      retval = false;
    }

    // Component Result Set is a participating class in association: rel.Numb = 8008
    // Object: Component Visibility
    return retval;
  }