public void setId(java.util.UUID newValue) {
   if (newValue != null) {
     if (newValue.equals(m_id)) {
       return;
     }
   } else if (m_id != null) {
     if (m_id.equals(newValue)) {
       return;
     }
   } else {
     return;
   }
   AttributeChangeModelDelta change =
       new AttributeChangeModelDelta(
           Modeleventnotification_c.DELTA_ATTRIBUTE_CHANGE, this, "Id", m_id, newValue, true);
   m_id = IdAssigner.preprocessUUID(newValue);
   Ooaofooa.getDefaultInstance().fireModelElementAttributeChanged(change);
 }
Ejemplo n.º 2
0
  // Public Constructors
  public ComponentInComponent_c(
      ModelRoot modelRoot, java.util.UUID p_m_id, java.util.UUID p_m_parent_id) {
    super(modelRoot);
    // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
    m_id = IdAssigner.preprocessUUID(p_m_id);
    // extract 28 bit value only
    m_idLongBased = 0xfffffff & p_m_id.getLeastSignificantBits();
    // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
    m_parent_id = IdAssigner.preprocessUUID(p_m_parent_id);

    setUniqueId(m_id);
    Object[] key = {m_id};
    addInstanceToMap(key);
  }
Ejemplo n.º 3
0
 public static ComponentInComponent_c createProxy(
     ModelRoot modelRoot,
     java.util.UUID p_m_id,
     java.util.UUID p_m_parent_id,
     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(ComponentInComponent_c.class);
   ComponentInComponent_c new_inst = null;
   synchronized (instances) {
     Object[] key = {p_m_id};
     new_inst = (ComponentInComponent_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();
       // 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);
       // extract 28 bit value only
       new_inst.m_idLongBased = 0xfffffff & p_m_id.getLeastSignificantBits();
       // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
       new_inst.m_parent_id = IdAssigner.preprocessUUID(p_m_parent_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 ComponentInComponent_c(modelRoot, p_m_id, p_m_parent_id);
     new_inst.m_contentPath = contentPath;
   }
   return new_inst;
 }
Ejemplo n.º 4
0
  public static ComponentInComponent_c resolveInstance(
      ModelRoot modelRoot, java.util.UUID p_m_id, java.util.UUID p_m_parent_id) {
    InstanceList instances = modelRoot.getInstanceList(ComponentInComponent_c.class);
    ComponentInComponent_c source = null;
    synchronized (instances) {
      Object[] key = {p_m_id};
      source = (ComponentInComponent_c) instances.get(key);
      if (source != null && !modelRoot.isCompareRoot()) {
        source.convertFromProxy();
        source.batchUnrelate();
        // 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);
        // extract 28 bit value only
        source.m_idLongBased = 0xfffffff & p_m_id.getLeastSignificantBits();
        // pre-process the uuid so that we re-use null uuid instance rather then creating a new one.
        source.m_parent_id = IdAssigner.preprocessUUID(p_m_parent_id);

        return source;
      }
    }
    // there is no instance matching the id
    ComponentInComponent_c new_inst = new ComponentInComponent_c(modelRoot, p_m_id, p_m_parent_id);
    return new_inst;
  }
Ejemplo n.º 5
0
 // declare attribute accessors
 public long getIdLongBased() {
   if (m_idLongBased == 0 && !IdAssigner.NULL_UUID.equals(m_id)) {
     return 0xfffffff & m_id.getLeastSignificantBits();
   }
   return m_idLongBased;
 }